From: Nick Piggin Subject: Re: [rfc][patch 2/3] fs: sync_sb_inodes fix Date: Wed, 12 Nov 2008 04:44:00 +0100 Message-ID: <20081112034400.GD26053@wotan.suse.de> References: <20081110132205.GA7183@wotan.suse.de> <20081110132308.GC7183@wotan.suse.de> <20081110134133.GA7425@infradead.org> <20081110151047.GA16924@wotan.suse.de> <20081111182541.GD25049@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Andrew Morton To: Christoph Hellwig Return-path: Received: from mx2.suse.de ([195.135.220.15]:58912 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752093AbYKLDoE (ORCPT ); Tue, 11 Nov 2008 22:44:04 -0500 Content-Disposition: inline In-Reply-To: <20081111182541.GD25049@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Nov 11, 2008 at 01:25:41PM -0500, Christoph Hellwig wrote: > On Mon, Nov 10, 2008 at 04:10:47PM +0100, Nick Piggin wrote: > > Static branch hint instruction could indeed turn off dynamic prediction > > so in that cause it would always mispredict even if the workload was > > continually going the other way. > > It's not just turning them off. In many cpu microarchitectures a wrong > static prediction means an pipeline stall that's much worse than a > dynamic mispredict because that information is interpreted much deeper > in the pipeline. Which ones? AFAIK, dynamic branch prediction happens no later than instruction decode, and can be earlier even than instruction fetch. > Please just don't use likely/unlikely unless really nessecary. Sure. It isn't really necessary here. > > However, I think you have to consider frequency, and also relative > > importance of each case. This is going to be taken on sys_sync, and > > sys_umount. And not taken for pdflush writeout. > > Yes. So dynamic branch prediction will get this perfectly right on > any reasonable CPU. Or, it will not have a relevant entry in the branch predictor, and short forward jumps tend to default to unlikely, so it might miss every time. Anyway... I won't argue any more :) I've gotten rid of it. > > > > + /* see dquot.c comment */ > > > > > > Not an exactly useful comment :) > > > > /* see fs/dquot.c:add_dquot_ref() comment */ ? > > > > Thanks, I will repost with these changes after waiting for more feedback. > > Please just copy the comment over. Looking somewhere else to follow > a comment is not very nice (and this is the more important file compared > to dquot.c anyway :)) OK.