From patchwork Mon Oct 15 20:08:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 1595851 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by patchwork2.kernel.org (Postfix) with ESMTP id 72B9EDFB34 for ; Mon, 15 Oct 2012 20:14:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9FKBGI2010315; Mon, 15 Oct 2012 16:11:16 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9FKAa7o027131 for ; Mon, 15 Oct 2012 16:10:36 -0400 Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.18]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9FKAVKp026701 for ; Mon, 15 Oct 2012 16:10:31 -0400 Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9FK9iML007481 for ; Mon, 15 Oct 2012 16:10:23 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so5284636pbb.33 for ; Mon, 15 Oct 2012 13:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=2creR6RI8KuVTLRD7PnGd7cgY/aU35+DNUnNkow8/h0=; b=TlPAJNEU0wf3BctFFAUZ2fJiVjSSVXDpADqaQoPDixBFhsOnWXEjq142cuCRPXh/wL g17X80fkK9qCj7tQJHHaw7Nyo4aUKdORASubg3xJF03VD77WIiWXSYTl/csHjBjgz9o7 vBC0TzfamUYeJ7LXHJDzVNZFFzq1LhEXMNu7gvaxGWpqG2kb5bvcLqvYAVD/Yd3wPkoe 6tJ8h+cTm9/bJBdwF6iZ+ZcQjZM8FYJ7SmFmA9/BtdFKhPvvF3AbgNlQRnF24ZT7q9A7 hRM94XHb17L2MHPihgpRiWgCmSA5a+3h5tg0NfNQKZik0De+gn+khNvfxabOnNUm+BvG Z4rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=2creR6RI8KuVTLRD7PnGd7cgY/aU35+DNUnNkow8/h0=; b=P6axXM6fRQ7ChT38pLYmyoa64JYF74rM1l/ahiB1G3IWVoECmAOccSm6uNGSIP7uxu NxMWlpL7xqzRuh2mHGxzOL8rant0cubigkvouQzuMzHyV6FTWzmNPZILjQmM9xVd009+ 3GD6TsNGlW6o0J1aRnmiUueI0E0sC636bCtPKZm1EwkYQLk74j0QUrPK3HSqUICiVrHL XmEOqLyzuEUTw08dBlV7kXEUD9xjo43jR8Fwd4pxy4/LcGNfKcY5lI0YJM8dbarA/2Uz n6A6WNSToOz/phCrmmMo00b2KJsmX6I2b8FhhzJDvNvGDXgQjngWaj5tYBu7x6LHztkR lZGA== Received: by 10.68.225.3 with SMTP id rg3mr40748298pbc.27.1350331823718; Mon, 15 Oct 2012 13:10:23 -0700 (PDT) Received: from formenos.mtv.corp.google.com (formenos.mtv.corp.google.com [172.18.110.66]) by mx.google.com with ESMTPS id k9sm3021703paz.22.2012.10.15.13.10.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 13:10:22 -0700 (PDT) From: Kent Overstreet To: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com Date: Mon, 15 Oct 2012 13:08:59 -0700 Message-Id: <1350331769-14856-26-git-send-email-koverstreet@google.com> In-Reply-To: <1350331769-14856-1-git-send-email-koverstreet@google.com> References: <1350331769-14856-1-git-send-email-koverstreet@google.com> X-Gm-Message-State: ALoCoQlKAPQSe3m95C6om8n0usJKDwiVTg38C8pb1evpSAwgo4aJjoT5m4qCF5NBWzfdKqzLK4yv7VKrUEtPuIA2PFXbrIqXqsAc/5iQY4lpop+QoOBFeKg8elu7VocQvoA8cSGfP7wVqTAG8zAwSmu9a892aPQ6i8LX+pvsnWLTYe//aASjzDEWpzv9CzSNczrqiZkfzT5P X-RedHat-Spam-Score: -3.072 (BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.18 X-loop: dm-devel@redhat.com Cc: tj@kernel.org, axboe@kernel.dk, Kent Overstreet , vgoyal@redhat.com Subject: [dm-devel] [PATCH v4 1/2] block: Reorder struct bio_set X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com This is prep work for the next patch, which embeds a struct bio_list in struct bio_set. Signed-off-by: Kent Overstreet CC: Jens Axboe Acked-by: Tejun Heo --- include/linux/bio.h | 66 ++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 820e7aa..93d3d17 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -298,39 +298,6 @@ static inline int bio_associate_current(struct bio *bio) { return -ENOENT; } static inline void bio_disassociate_task(struct bio *bio) { } #endif /* CONFIG_BLK_CGROUP */ -/* - * bio_set is used to allow other portions of the IO system to - * allocate their own private memory pools for bio and iovec structures. - * These memory pools in turn all allocate from the bio_slab - * and the bvec_slabs[]. - */ -#define BIO_POOL_SIZE 2 -#define BIOVEC_NR_POOLS 6 -#define BIOVEC_MAX_IDX (BIOVEC_NR_POOLS - 1) - -struct bio_set { - struct kmem_cache *bio_slab; - unsigned int front_pad; - - mempool_t *bio_pool; -#if defined(CONFIG_BLK_DEV_INTEGRITY) - mempool_t *bio_integrity_pool; -#endif - mempool_t *bvec_pool; -}; - -struct biovec_slab { - int nr_vecs; - char *name; - struct kmem_cache *slab; -}; - -/* - * a small number of entries is fine, not going to be performance critical. - * basically we just need to survive - */ -#define BIO_SPLIT_ENTRIES 2 - #ifdef CONFIG_HIGHMEM /* * remember never ever reenable interrupts between a bvec_kmap_irq and @@ -527,6 +494,39 @@ static inline struct bio *bio_list_get(struct bio_list *bl) return bio; } +/* + * bio_set is used to allow other portions of the IO system to + * allocate their own private memory pools for bio and iovec structures. + * These memory pools in turn all allocate from the bio_slab + * and the bvec_slabs[]. + */ +#define BIO_POOL_SIZE 2 +#define BIOVEC_NR_POOLS 6 +#define BIOVEC_MAX_IDX (BIOVEC_NR_POOLS - 1) + +struct bio_set { + struct kmem_cache *bio_slab; + unsigned int front_pad; + + mempool_t *bio_pool; +#if defined(CONFIG_BLK_DEV_INTEGRITY) + mempool_t *bio_integrity_pool; +#endif + mempool_t *bvec_pool; +}; + +struct biovec_slab { + int nr_vecs; + char *name; + struct kmem_cache *slab; +}; + +/* + * a small number of entries is fine, not going to be performance critical. + * basically we just need to survive + */ +#define BIO_SPLIT_ENTRIES 2 + #if defined(CONFIG_BLK_DEV_INTEGRITY) #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))