From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755620AbcA1Qxd (ORCPT ); Thu, 28 Jan 2016 11:53:33 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:35325 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755094AbcA1Qx3 (ORCPT ); Thu, 28 Jan 2016 11:53:29 -0500 Date: Thu, 28 Jan 2016 17:53:27 +0100 From: Michal Hocko To: Christoph Lameter Cc: Mike Galbraith , Peter Zijlstra , LKML Subject: Re: [PATCH] mm, vmstat: make quiet_vmstat lighter (was: Re: fast path cycle muncher (vmstat: make vmstat_updater deferrable) again and shut down on idle) Message-ID: <20160128165326.GH15948@dhcp22.suse.cz> References: <20160122140418.GB19465@dhcp22.suse.cz> <20160122161201.GC19465@dhcp22.suse.cz> <1453566115.3529.8.camel@gmail.com> <20160127164825.GF13951@dhcp22.suse.cz> <20160128152119.GB15948@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu 28-01-16 10:40:10, Christoph Lameter wrote: > On Thu, 28 Jan 2016, Michal Hocko wrote: > > > +void quiet_vmstat(void) > > +{ > > + if (system_state != SYSTEM_RUNNING) > > + return; > > + > > + /* > > + * If we are already in hands of the shepherd then there > > + * is nothing for us to do here. > > + */ > > + if (cpumask_test_and_set_cpu(smp_processor_id(), cpu_stat_off)) > > + return; > > + > > + if (!need_update(smp_processor_id())) > > + return; > > + > > You can drop the need_update check. refresh_cpu_vm_stats() does the same > checks in a more efficient way. If you keep this the checks will > performed twice. refresh_cpu_vm_stats does this_cpu_xchg for each counter. Is it really more effective than memchr_inv? -- Michal Hocko SUSE Labs