From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH] bio: skip atomic inc/dec of ->bi_remaining for non-chains Date: Mon, 20 Apr 2015 10:42:13 -0600 Message-ID: <55352C65.4070805@fb.com> References: <20150417145933.GA4770@kernel.dk> <20150420160446.GL17020@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Jan Kara Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:26846 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbbDTQmT (ORCPT ); Mon, 20 Apr 2015 12:42:19 -0400 In-Reply-To: <20150420160446.GL17020@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 04/20/2015 10:04 AM, Jan Kara wrote: > On Fri 17-04-15 08:59:33, Jens Axboe wrote: >> @@ -292,8 +292,8 @@ void bio_reset(struct bio *bio) >> __bio_free(bio); >> >> memset(bio, 0, BIO_RESET_BYTES); >> - bio->bi_flags = flags|(1 << BIO_UPTODATE); >> - atomic_set(&bio->bi_remaining, 1); >> + bio->bi_flags = flags | 1 << BIO_UPTODATE; > Although this is correct, I'd prefer to keep parenthesis around 1 << > BIO_UPTODATE. Maybe I'm not a real C hacker but I had to lookup the > operator precedence of | vs << :). Heh, I think we can safely say you are a real C hacker, lets just keep the parenthesis if that makes it easier to read/verify. > Otherwise the patch looks good to me (but I'm not an expert in this area, I > just looked into the patch by accident because I thought it's another > respin of your direct IO patch ;). It's a parallel effort, getting rid of the atomics where we can... Thanks for looking at it, can I add your reviewed-by tag with the parenthesis change? -- Jens Axboe