From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754362AbdBGOjk (ORCPT ); Tue, 7 Feb 2017 09:39:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:47721 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753378AbdBGOji (ORCPT ); Tue, 7 Feb 2017 09:39:38 -0500 Date: Tue, 7 Feb 2017 12:04:19 +0100 From: Jan Kara To: Steven Rostedt Cc: LKML , Andrew Morton , Jan Kara Subject: Re: [PATCH] mm: Place "not" inside of unlikely() statement in wb_domain_writeout_inc() Message-ID: <20170207110419.GA13524@quack2.suse.cz> References: <20170206120035.3c2e2b91@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170206120035.3c2e2b91@gandalf.local.home> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 06-02-17 12:00:35, Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > The likely/unlikely profiler noticed that the unlikely statement in > wb_domain_writeout_inc() is constantly wrong. This is due to the "not" (!) > being outside the unlikely statement. It is likely that dom->period_time > will be set, but unlikely that it wont be. Move the not into the unlikely > statement. > > Signed-off-by: Steven Rostedt (VMware) Yeah, good catch. You can add: Reviewed-by: Jan Kara Andrew, will you merge this patch please? Thanks! Honza > --- > mm/page-writeback.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 290e8b7..94102c7 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -580,7 +580,7 @@ static void wb_domain_writeout_inc(struct wb_domain *dom, > __fprop_inc_percpu_max(&dom->completions, completions, > max_prop_frac); > /* First event after period switching was turned off? */ > - if (!unlikely(dom->period_time)) { > + if (unlikely(!dom->period_time)) { > /* > * We can race with other __bdi_writeout_inc calls here but > * it does not cause any harm since the resulting time when > -- > 2.9.3 > -- Jan Kara SUSE Labs, CR