Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp597472ybi; Fri, 12 Jul 2019 01:28:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjOw4ujFR0q5TckOfnRdM228WJSo663lBFyncfyF0ItUqEjtssa1Sf5/D3CJCUbg5R3543 X-Received: by 2002:a65:454c:: with SMTP id x12mr9366626pgr.354.1562920084735; Fri, 12 Jul 2019 01:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562920084; cv=none; d=google.com; s=arc-20160816; b=H2jaSvofnNHKyrOzr3AZpHyvg+6a0Rg2flUTttG2qQ2H6nw/jhnW2rUtFs4M6yF2Jy FBRctteVd+rEsWuovZvQFzDY93ntfl/yHdwSMYa+FdV6v+DUhcESmLpRo+LtZ9Fb1TAg ZfcbC1HK4ZJUkfXJ6na+BApdRYVXqqmsptrYDDROBf5nhLa0aI/bq0FPKRoj2uQA2stV ZryNHnShR36neCkPeBwTBbWhIW00A9cjqGnIJLlcVBZovX3s/2Yh/q7ptT/QQcR8czPs LqtRXi+TZefdB/tHHnwZNMJWb3B7ZhGv+qFkyHJR4tTGWqHF4lZTBbxDY5VN4nudDFM5 t1ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jIocLEX3k1ojubRfum2a6qGFB3hHKtugO8wPHqWDXY8=; b=PJ3PVVthqrjSaZvw3iV3jvGtvZJrFNXNLedZijcO+K3HeDIz4W0f8JMHDI4v/iinw5 ogBtv62trvawkXpNxne3nQjOjieZ+n2v2R6vhngM+lY3ti/j2rGpZNkwaxuPzDrUP9i9 0GwkSl0OHF1uET9dSutQ1Dv015wv2OtJozrkrjSVRtJxo4icMdsSZfIazJ6gQHJ2C+Ox bXqXsMxsRF0NN3ZmktsihZwVqhbSvGlC2RpHyS+r+wprRsEOKAx/wpsJboalyMRAZKHA y61HZ3labwHsouag9S4H+LeSUdmeWO/5GyJcMEJn2BuMI8rotC8JClcu/Dj6t4mTDofZ QjRw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si7190123pla.432.2019.07.12.01.27.48; Fri, 12 Jul 2019 01:28:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbfGLI1Q (ORCPT + 99 others); Fri, 12 Jul 2019 04:27:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:44392 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726057AbfGLI1P (ORCPT ); Fri, 12 Jul 2019 04:27:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DAC5BAC4C; Fri, 12 Jul 2019 08:27:12 +0000 (UTC) Date: Fri, 12 Jul 2019 09:27:10 +0100 From: Mel Gorman To: "Huang, Ying" Cc: huang ying , Andrew Morton , linux-mm@kvack.org, LKML , Rik van Riel , Peter Zijlstra , jhladky@redhat.com, lvenanci@redhat.com, Ingo Molnar Subject: Re: [PATCH -mm] autonuma: Fix scan period updating Message-ID: <20190712082710.GH13484@suse.de> References: <20190624025604.30896-1-ying.huang@intel.com> <20190624140950.GF2947@suse.de> <20190703091747.GA13484@suse.de> <87ef3663nd.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <87ef3663nd.fsf@yhuang-dev.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 04, 2019 at 08:32:06AM +0800, Huang, Ying wrote: > Mel Gorman writes: > > > On Tue, Jun 25, 2019 at 09:23:22PM +0800, huang ying wrote: > >> On Mon, Jun 24, 2019 at 10:25 PM Mel Gorman wrote: > >> > > >> > On Mon, Jun 24, 2019 at 10:56:04AM +0800, Huang Ying wrote: > >> > > The autonuma scan period should be increased (scanning is slowed down) > >> > > if the majority of the page accesses are shared with other processes. > >> > > But in current code, the scan period will be decreased (scanning is > >> > > speeded up) in that situation. > >> > > > >> > > This patch fixes the code. And this has been tested via tracing the > >> > > scan period changing and /proc/vmstat numa_pte_updates counter when > >> > > running a multi-threaded memory accessing program (most memory > >> > > areas are accessed by multiple threads). > >> > > > >> > > >> > The patch somewhat flips the logic on whether shared or private is > >> > considered and it's not immediately obvious why that was required. That > >> > aside, other than the impact on numa_pte_updates, what actual > >> > performance difference was measured and on on what workloads? > >> > >> The original scanning period updating logic doesn't match the original > >> patch description and comments. I think the original patch > >> description and comments make more sense. So I fix the code logic to > >> make it match the original patch description and comments. > >> > >> If my understanding to the original code logic and the original patch > >> description and comments were correct, do you think the original patch > >> description and comments are wrong so we need to fix the comments > >> instead? Or you think we should prove whether the original patch > >> description and comments are correct? > >> > > > > I'm about to get knocked offline so cannot answer properly. The code may > > indeed be wrong and I have observed higher than expected NUMA scanning > > behaviour than expected although not enough to cause problems. A comment > > fix is fine but if you're changing the scanning behaviour, it should be > > backed up with data justifying that the change both reduces the observed > > scanning and that it has no adverse performance implications. > > Got it! Thanks for comments! As for performance testing, do you have > some candidate workloads? > Ordinarily I would hope that the patch was motivated by observed behaviour so you have a metric for goodness. However, for NUMA balancing I would typically run basic workloads first -- dbench, tbench, netperf, hackbench and pipetest. The objective would be to measure the degree automatic NUMA balancing is interfering with a basic workload to see if they patch reduces the number of minor faults incurred even though there is no NUMA balancing to be worried about. This measures the general overhead of a patch. If your reasoning is correct, you'd expect lower overhead. For balancing itself, I usually look at Andrea's original autonuma benchmark, NAS Parallel Benchmark (D class usually although C class for much older or smaller machines) and spec JBB 2005 and 2015. Of the JBB benchmarks, 2005 is usually more reasonable for evaluating NUMA balancing than 2015 is (which can be unstable for a variety of reasons). In this case, I would be looking at whether the overhead is reduced, whether the ratio of local hits is the same or improved and the primary metric of each (time to completion for Andrea's and NAS, throughput for JBB). Even if there is no change to locality and the primary metric but there is less scanning and overhead overall, it would still be an improvement. If you have trouble doing such an evaluation, I'll queue tests if they are based on a patch that addresses the specific point of concern (scan period not updated) as it's still not obvious why flipping the logic of whether shared or private is considered was necessary. -- Mel Gorman SUSE Labs