Received: by 10.223.164.221 with SMTP id h29csp39357wrb; Fri, 3 Nov 2017 10:07:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TdslmoZkcF6ct2RslHoF+E5vrGPQqFKz7v2QXj/34aISI4KngzGle9p9W86YPYZDx3gz9g X-Received: by 10.84.131.111 with SMTP id 102mr7405790pld.178.1509728821960; Fri, 03 Nov 2017 10:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509728821; cv=none; d=google.com; s=arc-20160816; b=AkG88YTH/S8NajoAJWNdrZ7ZS7gPOQbSkhAK4iI8wUbCCFG9lkonojjgWiGXw87HjG nfyHJEfn6HM9YwmDJPi+PbtSwouErVgC0WE2vunScbJxEu1QhqErJcQW6Ia/iBYNWyyU Kz7jEi078fx/FBvDVQ3PiAPiYZdeFJyZkjzanfGL8BwOrrCAeBWOoiilacChWZ+AMeA4 oVG3QW+asteMNPx+WUoof//AIBcAbtWAUREKucF6GZhumkirZqNQx4rMBA+dp9gq96Y7 De2nVcX5gsnUWsEGT+G+1EMzG5GPh1lEnVxhFjz5aV20Wm1O0IVQ8JfiLdNvfxTnSMTM UQjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=98228c4KgvbHc1YwTXaq8n5luI6OsHdZr7ZU7Y2pqI4=; b=XsEKZUXWgXhiCE8dnkeItX2FXAMaii+pCsCJpbO/eM48Xg/LJ3iCRGe5HOV236H84X sjLQaJzWrYQ5BQdyyQ8LXm9oshe/9kQSEhVbeF+4uRE04JFO0vqzQ4RbY1YHe9o1hI4o RWyE8aUGIdDUmADUGlMY/rGd0x/QIjgqg3AxuBqGntsr4M7s0ODLHKGPIUz8Z2OOn40v YQX5Oy57h948fvsYiY+8t1RkC0XWc0s8Yp3IbT4x3FFfgN4+RSEBstcIb536EprBZZST U6u0yeJn+MAS4ieRZTGAqak9m8AItTYrYlxzgW/P+UF5nuTF5s6vugDD4kQ/4ZnPI3qz 350A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si5489947plb.26.2017.11.03.10.06.48; Fri, 03 Nov 2017 10:07:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933436AbdKCRFV (ORCPT + 93 others); Fri, 3 Nov 2017 13:05:21 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:56152 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756248AbdKCRFK (ORCPT ); Fri, 3 Nov 2017 13:05:10 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from cmetcalf@mellanox.com) with ESMTPS (AES256-SHA encrypted); 3 Nov 2017 19:05:05 +0200 Received: from ld-1.internal.tilera.com (ld-1.internal.tilera.com [10.15.7.41]) by mtbu-labmail01.internal.tilera.com (8.14.4/8.14.4) with ESMTP id vA3H53EQ008331; Fri, 3 Nov 2017 13:05:03 -0400 Received: (from cmetcalf@localhost) by ld-1.internal.tilera.com (8.14.7/8.13.8/Submit) id vA3H535r010516; Fri, 3 Nov 2017 13:05:03 -0400 From: Chris Metcalf To: Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andrew Morton , Rik van Riel , Tejun Heo , Frederic Weisbecker , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , Catalin Marinas , Will Deacon , Andy Lutomirski , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Chris Metcalf Subject: [PATCH v16 02/13] vmstat: add vmstat_idle function Date: Fri, 3 Nov 2017 13:04:41 -0400 Message-Id: <1509728692-10460-3-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1509728692-10460-1-git-send-email-cmetcalf@mellanox.com> References: <1509728692-10460-1-git-send-email-cmetcalf@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function checks to see if a vmstat worker is not running, and the vmstat diffs don't require an update. The function is called from the task-isolation code to see if we need to actually do some work to quiet vmstat. Acked-by: Christoph Lameter Signed-off-by: Chris Metcalf --- include/linux/vmstat.h | 2 ++ mm/vmstat.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index e0b504594593..80212a952448 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -265,6 +265,7 @@ extern void __dec_node_state(struct pglist_data *, enum node_stat_item); void quiet_vmstat(void); void quiet_vmstat_sync(void); +bool vmstat_idle(void); void cpu_vm_stats_fold(int cpu); void refresh_zone_stat_thresholds(void); @@ -368,6 +369,7 @@ static inline void refresh_zone_stat_thresholds(void) { } static inline void cpu_vm_stats_fold(int cpu) { } static inline void quiet_vmstat(void) { } static inline void quiet_vmstat_sync(void) { } +static inline bool vmstat_idle(void) { return true; } static inline void drain_zonestat(struct zone *zone, struct per_cpu_pageset *pset) { } diff --git a/mm/vmstat.c b/mm/vmstat.c index 8ad1b84ca9cf..8b13a6ca494c 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1846,6 +1846,16 @@ void quiet_vmstat_sync(void) } /* + * Report on whether vmstat processing is quiesced on the core currently: + * no vmstat worker running and no vmstat updates to perform. + */ +bool vmstat_idle(void) +{ + return !delayed_work_pending(this_cpu_ptr(&vmstat_work)) && + !need_update(smp_processor_id()); +} + +/* * Shepherd worker thread that checks the * differentials of processors that have their worker * threads for vm statistics updates disabled because of -- 2.1.2 From 1583055175112208329@xxx Fri Nov 03 14:24:21 +0000 2017 X-GM-THRID: 1583055175112208329 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread