Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp732666ybi; Fri, 12 Jul 2019 03:49:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeGgppOIZzn3sm6x+eX6wAKH5Puvk17XkUT0d4kg9NIQWSKo3u6MvCCI5OOJmaIyB49cCW X-Received: by 2002:a17:902:a03:: with SMTP id 3mr10496178plo.302.1562928560033; Fri, 12 Jul 2019 03:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562928560; cv=none; d=google.com; s=arc-20160816; b=wsjfM4rwUfZxqJm7xCCuGB9tMF0+6IiuDoDR0OtQIE9ylm6sczXCv9cSjOD8TaRB3j SADPXY+MvpxOiwPlrTQU2PATC4flaMERYaXWv3tJXvQ+qyJEJKPKdHpD1mVsxxoaaqXr fPInYuDHA2NLkaN71DAicLCKoz9XdpCwUu1MO8wm2avBy+41rN/ZAgK68lz2+2dij5YJ tHk7rmo3hQW4r9GNUBWcRsUWbwBYgmtZLDV1hPPCY/WEOOyPMycQr61gXlaIwwCSx9sm zsBU72G6mjJf/T5wSfBsvDBtyMcgNwj3Rc28EU8JMRj/7mX5hi4+Zw9y4ECrF3BDFGfJ 9plA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=Ub/f+9PbS0Ef1IevZSrePbxMAyMtEPOLg3vMNYOOQ8o=; b=G+2W4A7/4LQuCFtEHlkDs1tG5TfUP8lfL6muYkIM7NhOkY1eNIcXToPbPkDT6+pQSu IeSWrc8wbcbaMdT0ObjZQR5EC19mP89DxY0U6E+DzwAaAr84P4W/7x3e6A//0Iegwl1k 6cxe2ctCDnvSSrwGz2inuJn/SuiSHMl1eBF7tukEvo4K2H5i5T6Heskcbi/N5VrSKPdX qpBL6k+z1HL/UBR5GET5l1wExFyp8R3MEeARgXI909IwI/mREDbGabZKTwpdM9pXrMQV mBshSsL6bBm037Ntr6SM1ue080YVKievovFxm7/QAsooKP7UHLfj5WqUACyW279errfO 8B6Q== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si2272587pld.32.2019.07.12.03.49.04; Fri, 12 Jul 2019 03:49:20 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbfGLKsJ (ORCPT + 99 others); Fri, 12 Jul 2019 06:48:09 -0400 Received: from mga03.intel.com ([134.134.136.65]:43695 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbfGLKsJ (ORCPT ); Fri, 12 Jul 2019 06:48:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2019 03:48:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,482,1557212400"; d="scan'208";a="177468984" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.29]) by orsmga002.jf.intel.com with ESMTP; 12 Jul 2019 03:48:06 -0700 From: "Huang\, Ying" To: Mel Gorman Cc: huang ying , Andrew Morton , , LKML , Rik van Riel , "Peter Zijlstra" , , , Ingo Molnar Subject: Re: [PATCH -mm] autonuma: Fix scan period updating References: <20190624025604.30896-1-ying.huang@intel.com> <20190624140950.GF2947@suse.de> <20190703091747.GA13484@suse.de> <87ef3663nd.fsf@yhuang-dev.intel.com> <20190712082710.GH13484@suse.de> Date: Fri, 12 Jul 2019 18:48:05 +0800 In-Reply-To: <20190712082710.GH13484@suse.de> (Mel Gorman's message of "Fri, 12 Jul 2019 09:27:10 +0100") Message-ID: <87d0ifwmu2.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mel Gorman writes: > 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. Thanks a lot for your detailed guidance. > 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. I can do the evaluation, but it will take quite some time for me to setup and run all these benchmarks. So if these benchmarks have already been setup in your environment, so that your extra effort is minimal, it will be great if you can queue tests for the patch. Feel free to reject me for any inconvenience. Best Regards, Huang, Ying