From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH v2 01/14] block: Generalized bio pool freeing Date: Thu, 24 May 2012 21:06:26 +0300 Message-ID: <4FBE78A2.8000803@panasas.com> References: <1337817771-25038-1-git-send-email-koverstreet@google.com> <1337817771-25038-2-git-send-email-koverstreet@google.com> <20120524174649.GC27550@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120524174649.GC27550-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: linux-bcache-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Vivek Goyal Cc: Kent Overstreet , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, neilb-l3A5Bk7waGM@public.gmane.org, drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org, mpatocka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org, yehuda-L5o5AL9CYN0tUFlbccrkMA@public.gmane.org List-Id: dm-devel.ids On 05/24/2012 08:46 PM, Vivek Goyal wrote: > On Wed, May 23, 2012 at 05:02:38PM -0700, Kent Overstreet wrote: >> With the old code, when you allocate a bio from a bio pool you have to >> implement your own destructor that knows how to find the bio pool the >> bio was originally allocated from. >> >> This adds a new field to struct bio (bi_pool) and changes >> bio_alloc_bioset() to use it. This makes various bio destructors >> unnecessary, so they're then deleted. >> > > [..] >> @@ -419,7 +406,11 @@ void bio_put(struct bio *bio) >> */ >> if (atomic_dec_and_test(&bio->bi_cnt)) { >> bio->bi_next = NULL; >> - bio->bi_destructor(bio); >> + >> + if (bio->bi_pool) >> + bio_free(bio, bio->bi_pool); >> + else >> + bio->bi_destructor(bio); > > If you have removed all the users of bi_destructor, then I am wondering that > why are we retaining this field and trying to call into it when bio_pool > is not set? > At this point there are still some users they are all removed and this field later in the patchset Boaz > Thanks > Vivek > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.linbit.com (zimbra.linbit.com [212.69.161.123]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id C0C991019A78 for ; Fri, 25 May 2012 09:03:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.linbit.com (Postfix) with ESMTP id B03C01B4268 for ; Fri, 25 May 2012 09:03:45 +0200 (CEST) Received: from zimbra.linbit.com ([127.0.0.1]) by localhost (zimbra.linbit.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vRimoVynTHdV for ; Fri, 25 May 2012 09:03:45 +0200 (CEST) Received: from soda.linbit (tuerlsteher.linbit.com [86.59.100.100]) by zimbra.linbit.com (Postfix) with ESMTP id 92DE51B4206 for ; Fri, 25 May 2012 09:03:45 +0200 (CEST) Resent-Message-ID: <20120525070345.GD12726@soda.linbit> Received: from natasha.panasas.com (natasha.panasas.com [67.152.220.90]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id 0C1E81017A2C for ; Thu, 24 May 2012 20:07:03 +0200 (CEST) Message-ID: <4FBE78A2.8000803@panasas.com> Date: Thu, 24 May 2012 21:06:26 +0300 From: Boaz Harrosh MIME-Version: 1.0 To: Vivek Goyal References: <1337817771-25038-1-git-send-email-koverstreet@google.com> <1337817771-25038-2-git-send-email-koverstreet@google.com> <20120524174649.GC27550@redhat.com> In-Reply-To: <20120524174649.GC27550@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: axboe@kernel.dk, dm-devel@redhat.com, neilb@suse.de, Kent Overstreet , linux-kernel@vger.kernel.org, tj@kernel.org, linux-bcache@vger.kernel.org, mpatocka@redhat.com, yehuda@hq.newdream.net, linux-fsdevel@vger.kernel.org, sage@newdream.net, agk@redhat.com, drbd-dev@lists.linbit.com Subject: Re: [Drbd-dev] [PATCH v2 01/14] block: Generalized bio pool freeing List-Id: Coordination of development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 05/24/2012 08:46 PM, Vivek Goyal wrote: > On Wed, May 23, 2012 at 05:02:38PM -0700, Kent Overstreet wrote: >> With the old code, when you allocate a bio from a bio pool you have to >> implement your own destructor that knows how to find the bio pool the >> bio was originally allocated from. >> >> This adds a new field to struct bio (bi_pool) and changes >> bio_alloc_bioset() to use it. This makes various bio destructors >> unnecessary, so they're then deleted. >> > > [..] >> @@ -419,7 +406,11 @@ void bio_put(struct bio *bio) >> */ >> if (atomic_dec_and_test(&bio->bi_cnt)) { >> bio->bi_next = NULL; >> - bio->bi_destructor(bio); >> + >> + if (bio->bi_pool) >> + bio_free(bio, bio->bi_pool); >> + else >> + bio->bi_destructor(bio); > > If you have removed all the users of bi_destructor, then I am wondering that > why are we retaining this field and trying to call into it when bio_pool > is not set? > At this point there are still some users they are all removed and this field later in the patchset Boaz > Thanks > Vivek > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH v2 01/14] block: Generalized bio pool freeing Date: Thu, 24 May 2012 21:06:26 +0300 Message-ID: <4FBE78A2.8000803@panasas.com> References: <1337817771-25038-1-git-send-email-koverstreet@google.com> <1337817771-25038-2-git-send-email-koverstreet@google.com> <20120524174649.GC27550@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Kent Overstreet , , , , , , , , , , , , To: Vivek Goyal Return-path: In-Reply-To: <20120524174649.GC27550-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: linux-bcache-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On 05/24/2012 08:46 PM, Vivek Goyal wrote: > On Wed, May 23, 2012 at 05:02:38PM -0700, Kent Overstreet wrote: >> With the old code, when you allocate a bio from a bio pool you have to >> implement your own destructor that knows how to find the bio pool the >> bio was originally allocated from. >> >> This adds a new field to struct bio (bi_pool) and changes >> bio_alloc_bioset() to use it. This makes various bio destructors >> unnecessary, so they're then deleted. >> > > [..] >> @@ -419,7 +406,11 @@ void bio_put(struct bio *bio) >> */ >> if (atomic_dec_and_test(&bio->bi_cnt)) { >> bio->bi_next = NULL; >> - bio->bi_destructor(bio); >> + >> + if (bio->bi_pool) >> + bio_free(bio, bio->bi_pool); >> + else >> + bio->bi_destructor(bio); > > If you have removed all the users of bi_destructor, then I am wondering that > why are we retaining this field and trying to call into it when bio_pool > is not set? > At this point there are still some users they are all removed and this field later in the patchset Boaz > Thanks > Vivek > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964902Ab2EXSHU (ORCPT ); Thu, 24 May 2012 14:07:20 -0400 Received: from natasha.panasas.com ([67.152.220.90]:52449 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933804Ab2EXSHS (ORCPT ); Thu, 24 May 2012 14:07:18 -0400 Message-ID: <4FBE78A2.8000803@panasas.com> Date: Thu, 24 May 2012 21:06:26 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Vivek Goyal CC: Kent Overstreet , , , , , , , , , , , , Subject: Re: [PATCH v2 01/14] block: Generalized bio pool freeing References: <1337817771-25038-1-git-send-email-koverstreet@google.com> <1337817771-25038-2-git-send-email-koverstreet@google.com> <20120524174649.GC27550@redhat.com> In-Reply-To: <20120524174649.GC27550@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/24/2012 08:46 PM, Vivek Goyal wrote: > On Wed, May 23, 2012 at 05:02:38PM -0700, Kent Overstreet wrote: >> With the old code, when you allocate a bio from a bio pool you have to >> implement your own destructor that knows how to find the bio pool the >> bio was originally allocated from. >> >> This adds a new field to struct bio (bi_pool) and changes >> bio_alloc_bioset() to use it. This makes various bio destructors >> unnecessary, so they're then deleted. >> > > [..] >> @@ -419,7 +406,11 @@ void bio_put(struct bio *bio) >> */ >> if (atomic_dec_and_test(&bio->bi_cnt)) { >> bio->bi_next = NULL; >> - bio->bi_destructor(bio); >> + >> + if (bio->bi_pool) >> + bio_free(bio, bio->bi_pool); >> + else >> + bio->bi_destructor(bio); > > If you have removed all the users of bi_destructor, then I am wondering that > why are we retaining this field and trying to call into it when bio_pool > is not set? > At this point there are still some users they are all removed and this field later in the patchset Boaz > Thanks > Vivek >