From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161383AbcA1QkO (ORCPT ); Thu, 28 Jan 2016 11:40:14 -0500 Received: from resqmta-ch2-10v.sys.comcast.net ([69.252.207.42]:40482 "EHLO resqmta-ch2-10v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966658AbcA1QkL (ORCPT ); Thu, 28 Jan 2016 11:40:11 -0500 Date: Thu, 28 Jan 2016 10:40:10 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Michal Hocko 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) In-Reply-To: <20160128152119.GB15948@dhcp22.suse.cz> Message-ID: References: <20160121165148.GF29520@dhcp22.suse.cz> <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> Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > + /* > + * Just refresh counters and do not care about the pending delayed > + * vmstat_update. It doesn't fire that often to matter and canceling > + * it would be too expensive from this path. > + * vmstat_shepherd will take care about that for us. > + */ > + refresh_cpu_vm_stats(false); > +} > + >