Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp638447ybi; Wed, 3 Jul 2019 02:18:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4K/21xdOXDzX5u3HxtlJ/UnJnmzc04hVO4Jf3RA2wLG+CuYEEw6phosBOZ8LxQBhUjOTT X-Received: by 2002:a17:902:ac85:: with SMTP id h5mr41675675plr.198.1562145515366; Wed, 03 Jul 2019 02:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562145515; cv=none; d=google.com; s=arc-20160816; b=Uxm3KoNH9Jj4H82tHqwiFOB5IkmNfe5aZ3wH1Vr1pjWI5ZVJrTsKkmYozcnd4BVgyU PGWQs+pkPXQ3RlUWu5Dv2xLhnaSgccjqiy2efZgXQmw1av2+N2QMoJIeVuzttDdinWi/ 8Uaz4ICQ4q4/RNjtVILcUjsGU8sF8NvFgUl0QbYR6oc3epLR06BYlSMeA7VL/RJXLD8o qT9Q5uVijUruEMnXvJgblna0U/7L01mCrcvK9/ZRXov5/aco/kQEDohpofLPC0na979g OmA+Fzt2u9sO7qYvgG3OBVzNpVkBj9c6sIlsYE7lfkTJMBU7XSIJF67baSgdRTZb8jg9 jwHg== 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=zFn0R1BIJkVs6C6l25PMXXvjISDd7tz6HAFht8/fEZo=; b=jz6e5n+UNTlb79J6qewFWY9OF+/YlxtdCi5EiJJyHUxjAlDTU+1DKLi51LpV/tzoPT 6Z2DI86Ec+IGsnkfDG4jsQoyNatNTuZToxzaa4ZpzIuwHjb8OFIZzIR/IfU7LsPLB9KU OaMr+ldBtSrTqLUNuNyxaWL9bwUAGvz/MRWQD4TOKSbXcAvGDiI74RUo/Y1cotanq9Si D7XMrZVi1rJ4oMotTfoY09MfWu7tnHMQXYje1Wvq5e0iW+krjBwKFd9D5lP9iyXAohq+ dsqbAbTb1moiVDYZ3Nc0sJdFQF94LaiBvU5LZpcOuIVhLX14C5XzQGh456LJP+U0vYyk aQDA== 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 65si2067049pff.220.2019.07.03.02.18.20; Wed, 03 Jul 2019 02:18:35 -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 S1727198AbfGCJRu (ORCPT + 99 others); Wed, 3 Jul 2019 05:17:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:52728 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725820AbfGCJRu (ORCPT ); Wed, 3 Jul 2019 05:17:50 -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 465AAAF70; Wed, 3 Jul 2019 09:17:49 +0000 (UTC) Date: Wed, 3 Jul 2019 10:17:47 +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: <20190703091747.GA13484@suse.de> References: <20190624025604.30896-1-ying.huang@intel.com> <20190624140950.GF2947@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: 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 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. -- Mel Gorman SUSE Labs