From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751676AbcGFAOx (ORCPT ); Tue, 5 Jul 2016 20:14:53 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:44046 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbcGFAOv (ORCPT ); Tue, 5 Jul 2016 20:14:51 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.203 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Wed, 6 Jul 2016 09:15:40 +0900 From: Minchan Kim To: Mel Gorman CC: Andrew Morton , Linux-MM , Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML Subject: Re: [PATCH 01/31] mm, vmstat: add infrastructure for per-node vmstats Message-ID: <20160706001540.GB12570@bbox> References: <1467403299-25786-1-git-send-email-mgorman@techsingularity.net> <1467403299-25786-2-git-send-email-mgorman@techsingularity.net> <20160704235018.GA26749@bbox> <20160705081405.GE11498@techsingularity.net> MIME-Version: 1.0 In-Reply-To: <20160705081405.GE11498@techsingularity.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/07/06 09:14:48, Serialize by Router on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/07/06 09:14:48, Serialize complete at 2016/07/06 09:14:48 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 05, 2016 at 09:14:05AM +0100, Mel Gorman wrote: > On Tue, Jul 05, 2016 at 08:50:18AM +0900, Minchan Kim wrote: > > > @@ -172,13 +174,17 @@ void refresh_zone_stat_thresholds(void) > > > int threshold; > > > > > > for_each_populated_zone(zone) { > > > + struct pglist_data *pgdat = zone->zone_pgdat; > > > unsigned long max_drift, tolerate_drift; > > > > > > threshold = calculate_normal_threshold(zone); > > > > > > - for_each_online_cpu(cpu) > > > + for_each_online_cpu(cpu) { > > > per_cpu_ptr(zone->pageset, cpu)->stat_threshold > > > = threshold; > > > + per_cpu_ptr(pgdat->per_cpu_nodestats, cpu)->stat_threshold > > > + = threshold; > > > + } > > > > I didn't see other patches yet so it might fix it then. > > > > per_cpu_nodestats is per node not zone but it use per-zone threshold > > and even overwritten by next zones. I don't think it's not intended. > > It was intended that the threshold from one zone would be used but now > that you point it out, it would use the threshold for the smallest zone > in the node which is sub-optimal. I applied the patch below on top to > use the threshold from the largest zone. I considered using the sum of > all thresholds but feared it might allow too much per-cpu drift. It can > be switched to the sum if we find a case where vmstat updates are too > high. Fair enough.