Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2394896rbb; Tue, 27 Feb 2024 23:40:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQeY5yzi5vuQKR539OxdCa9Z2471U/PIiu6/1LM7FtMxJTDq/e2amc/uWbY+Qpkk6OU0KwoT/DdmjyU+CYLKW3/ydOWc653/VAVOPQ6w== X-Google-Smtp-Source: AGHT+IHtCminlXOjPnGUhuM5MEMvCu3Ycay9W6LgukpRNctOv6acsFp7lXUnOebCZwVkbAg/aVn9 X-Received: by 2002:ad4:4eaa:0:b0:68f:e6db:85c with SMTP id ed10-20020ad44eaa000000b0068fe6db085cmr6334053qvb.23.1709106045865; Tue, 27 Feb 2024 23:40:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709106045; cv=pass; d=google.com; s=arc-20160816; b=ebCFYzkDlLGyZfqXpIgxcNg8v5ygvVm6cS1xHFKx1uVx3vcp9OSW3kstLow5M1FlGp c0fAgI6G/Yf7t/a/xDN2VhQgdYIEX2ZxlGeizQ8KIJhvZb/W7QTOnHs1oecEbK6tMbfn ny7MASgFNKcGhBeogEPFXd9ygu8exxiG63CFDUIUq12J/Te7lW+dXZsQf/2Tk8FzIakO EqKSktWPo9TTnDBNUY03dPfQJnqTJ9nEOrMF296g7TB0Ns4a+mRrM6AySV6DQYTktgFS E5eTHm2FIAVgD4v2bK9o4RNriHy5Asl8c//WiPJNDvWNpDRZikSZ3e1os5ZOwFSmxpU/ 2+VA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=NVlJ77mhRzQ/mcmS2t+ED1kMM0vLY+HiiLyI/tdXrLI=; fh=YPTNcFsvZ+O9XI4A4iW7fK5wftZqh1P5JrCFNuJgSaA=; b=0lJD7wAB3Gy7pE4romT2epsFK8KVS+IFDUe9nZRjdd1jYfV9JbhBz03wruHKFR1xo0 Vc99fVro7ocxg+CZ/uwMHKfAI9kWvunlTOKGjvCs4V7qunkcLzUdAGAa6F+88C5LKv1e 8FqlbHFIgbzn5o6TzxVeSGhoqF8hjCgVUYFxF90bSL0+x4e+wUay64Yhmx+yLfJ6C1Qc eV8uydBpOGcFQfY3dmUnapc2ZtZ6jI5RSAvbmnTTjOuwbfaxMVkeIIhK2BmhNojWaid4 MQGfLu0czoxJ0DFDIt/o+tt5OjxKr8Moi9LL87tGaaqh8uvmZE4Mk8gN2H53oe3FzvA6 ZZMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=sToOitBS; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-84619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84619-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ed10-20020ad44eaa000000b00690353442f5si681406qvb.115.2024.02.27.23.40.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 23:40:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=sToOitBS; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-84619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84619-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 51F351C22944 for ; Wed, 28 Feb 2024 07:40:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1867250F6; Wed, 28 Feb 2024 07:40:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="sToOitBS" Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 B4DEA24B2C for ; Wed, 28 Feb 2024 07:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709106015; cv=none; b=H3VdN0PFQq2iaShmC+pZ27jC/T+zIjsiSWLfl0blBci/7f9c4FF2umD9N8xGGmCCeXkZ5xmNN1045jFZZp06in3P0CNeUjqrzZATx+KjnoK1Po3UwZJTZDJorkTEZsniHX7EiC4t6I+zZe+rzwT80TjVgpiBV0y+Y6GzmmPmgck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709106015; c=relaxed/simple; bh=/ZcikVKrKa47NsNBkq0WwBavuImevglQcR7J8WjNGnU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K+XOrj4vLUYXyxzbsCSIfvy7Apd1jyKMUjIs78W0By0IqZEpUt0dh3sfq23fz1vVmsD8AZ6E38w6TVRwuDQ+PgHuzXTHWQOqeaV2uvjqkCfVme1XYiYXfxVPg8LpgvBHTF8Jm+MkkSOgStonScPCryRjSA4BJyOINCFoy2sobaQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=sToOitBS; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1709106010; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=NVlJ77mhRzQ/mcmS2t+ED1kMM0vLY+HiiLyI/tdXrLI=; b=sToOitBS4JvBIbA+OMvG1iicswb2Eyd/Opy6ozhgZyOzvqi7PfKOKpj7OqB6PYyRdIaP34lXm2kKsaRN3ryl5X5r2NX2pg++m7GHKnqCBsYBJQFnJARs3eVwu4OqBnWe8YltnMdLvrx6EJcYYBDSIDq1yAb+go5gxarHzMIfULg= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0W1P0G-v_1709106008; Received: from 30.97.56.58(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W1P0G-v_1709106008) by smtp.aliyun-inc.com; Wed, 28 Feb 2024 15:40:09 +0800 Message-ID: <8d35b8ae-b8d8-4237-bfcf-ed63c0bb4223@linux.alibaba.com> Date: Wed, 28 Feb 2024 15:40:08 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] mm: hugetlb: make the hugetlb migration strategy consistent To: Oscar Salvador Cc: akpm@linux-foundation.org, muchun.song@linux.dev, david@redhat.com, linmiaohe@huawei.com, naoya.horiguchi@nec.com, mhocko@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/2/27 23:17, Oscar Salvador wrote: > On Tue, Feb 27, 2024 at 09:52:26PM +0800, Baolin Wang wrote: > >> --- a/mm/hugetlb.c >> +++ b/mm/hugetlb.c >> @@ -2567,13 +2567,38 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, >> } >> >> static struct folio *alloc_migrate_hugetlb_folio(struct hstate *h, gfp_t gfp_mask, >> - int nid, nodemask_t *nmask) >> + int nid, nodemask_t *nmask, int reason) > > I still dislike taking the reason argument this far, and I'd rather have > this as a boolean specifing whether we allow fallback on other nodes. > That would mean parsing the reason in alloc_migration_target(). > If we don't add a new helper e.g: gfp_allow_fallback(), we can just do > it right there an opencode it with a e.g: macro etc. > > Although doing it in an inline helper might help hiding these details. > > That's my take on this, but let's see what others have to say. Sure. I also expressed my preference for hiding these details within the hugetlb core as much as possible. Muchun, what do you think? Thanks.