Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1814033lql; Wed, 13 Mar 2024 08:51:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWO0UpbOWHACipMER7V3pa+rSkxwSN5YjrFh5WF3saLCGOeT/9xoNkZF72KhBlRMYT2G4oHSO95Fxys5H31eFvoWyURfgMJ8W35bsOl/g== X-Google-Smtp-Source: AGHT+IEPmeERPONoecSM6zC1rtT9tkgZzzhLEtXPa9ywnEK+NE8G73/p+GiXe1biDVjoLjCo529D X-Received: by 2002:a05:6870:1689:b0:220:be34:7ee2 with SMTP id j9-20020a056870168900b00220be347ee2mr14820844oae.26.1710345113102; Wed, 13 Mar 2024 08:51:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710345113; cv=pass; d=google.com; s=arc-20160816; b=T01H89HjiXLg8uiQ0FloVxOHly1ku5mhb4wnH1ZsfkIlAHs9Chdbce4LY3Uw/xVXF/ W2gLV+kDLNCIkqYgnH50LwRWj9SL5+1s2a1QAedI2VSsPiT5nBW8EcquMwB7Nt8kNnjL 6c1fvw/l66g+anDAcFayyLF+3E4SWDDvvqyWdJzy5Y+J9KlIC2TkoGDGdT8XygOfAaEI UwZyLxnQiWmfosBnISFUgIkcXk9JC0uJS24iFOYVjgX5WXzifCIrnFm/eIUnPoBN+2Mz RyfJiJ1WGcNzvxkNdrBXZmt+b1O9ffTLeYnDrZ+l7LvOabjbHXntgDfpqAWpdlBSWkW5 Ttiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=a4nXReqtfb09/cWyhxOpczgs5ST5sE+Kz+gQDBf30I0=; fh=qH8HHP27poflieQM0WRRuWmWEVWgsPUhs3EcUB5ZyFs=; b=T0m0HbvnXbXux2RcPKlu+5sI2xlcRsYW/LqGvSPe2hB0YGXyrIZC71ajCtT51BYUVB p11mU/mS6kxx5X+VvR8luCCrA1+ceNMjbnSZs0i8Zri6sAZ3zPyjyA3qnZp1GEgf3U3s j8FOUQj/6HHSQUJg5anq/lttDpiXfhLcTKhp5v5Hoiq5V0EQWO2bebfKa/h64SIGGGZu kjzaMsMwlh1U4GEi5HJEOxb0SVtKomJkzZ2FG6jvCEahHTlDdnCZcl6GQi1e5tE5WvYy 5Lfi9eB92iDFeOYoURsI0d7PZZlwV4WEFJ9PIQOdUaIIS6wPkKBuQJErj4QMQpHf9oKe Me9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IE1pXpb7; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-101700-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101700-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l26-20020a05620a211a00b00789c9a3d8cbsi1673678qkl.250.2024.03.13.08.51.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 08:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101700-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IE1pXpb7; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-101700-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101700-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D5701C20324 for ; Wed, 13 Mar 2024 15:51:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67FF547F64; Wed, 13 Mar 2024 15:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="IE1pXpb7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2596F45028 for ; Wed, 13 Mar 2024 15:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710345106; cv=none; b=qj1Y6f/AGhbewzWvVooG3TdEU74iPvZjkzEIi+DujHJOPCAyZDeB6zA5OGvJXfXonX+yYmlpcEa0QyI6gk0P7yzrAdYfTxuA9EC6ShwT62K46/2AbIOAThu9Rol6LhJdUSEq+wGPJ3byNnO4v2lUS/1J2Cq8U4ldZltkfwpgQVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710345106; c=relaxed/simple; bh=mI7fSNRhjdc1x/5jXUqFrblmXVZD1jsPOX+je1rOPJs=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=W2aPRrDqyNztlOA3r6YbHqvIHN6aEzAIuEOPzUGUVi80rmp0+3cdMu1z+pZ2m3GaqyseKxZHxUoAqz+4NVDrt8L1+daNyfUw40iPUyfKNqErpGwUnzOroHHwtkCpNNxwNpqWUzldO0gB5Lo8289U/q+t8qMqw84KP0jWaikcmwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=IE1pXpb7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14731C433C7; Wed, 13 Mar 2024 15:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1710345105; bh=mI7fSNRhjdc1x/5jXUqFrblmXVZD1jsPOX+je1rOPJs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IE1pXpb7tEtDPJb1XPIB8Qu0S2GzmepwH2QCl5imqd4uVrjQ6FOIaKUEilPkEvxvf 8xkpZBwuPD2joCO0YlGF61cyqD55UJYIV8W9ya1CD5oXdVR7zS/ZCbPF3+6GNnNTGc pey9QOPoFuxqaAqcT4v1qyyDZDa+7k3k4RllX9m0= Date: Wed, 13 Mar 2024 08:51:44 -0700 From: Andrew Morton To: "Huang, Ying" Cc: Donet Tom , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Aneesh Kumar , Michal Hocko , Dave Hansen , Mel Gorman , Feng Tang , Andrea Arcangeli , Peter Zijlstra , Ingo Molnar , Rik van Riel , Johannes Weiner , Matthew Wilcox , Vlastimil Babka , Dan Williams , Hugh Dickins , Kefeng Wang , Suren Baghdasaryan Subject: Re: [PATCH v2 2/2] mm/numa_balancing:Allow migrate on protnone reference with MPOL_PREFERRED_MANY policy Message-Id: <20240313085144.13b37a79c688b6126af0bd07@linux-foundation.org> In-Reply-To: <874jdd5z1b.fsf@yhuang6-desk2.ccr.corp.intel.com> References: <369d6a58758396335fd1176d97bbca4e7730d75a.1709909210.git.donettom@linux.ibm.com> <874jdd5z1b.fsf@yhuang6-desk2.ccr.corp.intel.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 11 Mar 2024 09:37:36 +0800 "Huang, Ying" wrote: > > @@ -2515,15 +2516,26 @@ int mpol_misplaced(struct folio *folio, struct vm_fault *vmf, > > break; > > > > case MPOL_BIND: > > - /* Optimize placement among multiple nodes via NUMA balancing */ > > + case MPOL_PREFERRED_MANY: > > + /* > > + * Even though MPOL_PREFERRED_MANY can allocate pages outside > > + * policy nodemask we don't allow numa migration to nodes > > + * outside policy nodemask for now. This is done so that if we > > + * want demotion to slow memory to happen, before allocating > > + * from some DRAM node say 'x', we will end up using a > > + * MPOL_PREFERRED_MANY mask excluding node 'x'. In such scenario > > + * we should not promote to node 'x' from slow memory node. > > + */ > > This is a little hard to digest for me. And, I don't think that we need > to put this policy choice in code comments. It's better to put it in > patch description. Where we can give more background, for example, to > avoid cross-socket traffic, etc. Oh. I like the comment. We could perhaps put additional detail in the changelog, but using changelogs to understand the code is so darned inconvenient.