Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2672868pxt; Mon, 9 Aug 2021 06:21:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5XsIAUZ0tT10QLG2W0sVtUYl4eiVcgRS5DW0lBf43Aj6NkcnSrH28xNP0Zmt2NURsIIT+ X-Received: by 2002:a50:fe07:: with SMTP id f7mr29184798edt.334.1628515315392; Mon, 09 Aug 2021 06:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628515315; cv=none; d=google.com; s=arc-20160816; b=HlRWnbHX+XRlD3MOMWeVwpU8UVpkSN2+Aluol1wM9y6yL7/ZPJC5JG5nKgEatFZ8Qb 1gIMiaPGFuqjJsaZX2CO0doX3K5cDc79NdHFCQUA1UrpQAbDjQAmerU03+EO8gnnH6I2 xMFsRbZeW3/osACVAylmvgyfxvaXlIrehFzfCICcB4dLI13fJQ4d5Eag6+qyuk2KM3hz LI+k2KWiFddYUOIIpJEnAlReFiTgLhfKJIjtuCN6lHbGdblsV/cBfrgJYrRAqQObuqS7 7uhx3PKWcpJn7KLz3xrDgIH92h3UOv5x0LworrVeSFi7IQxKlvotwcBks4CRoqIf58rJ yJgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QX1f69WbRiWu5Eg3CL5L0jwPsMknl/HQ42nsUY/VTWg=; b=XZ8ndQauD0dOqJe79jx1WLxpR8vqTgh+cTSzNwGsTnPTS+qxzohVUOU8S99nS4qq0I WbZwETkeYZ7y0PX2Z/ooiVIs+PnhGIe4A5dBawPUfZiXXch3GLkxeBChBdFsnCdoR5ZC gf1F12sdqAY94j5Ky7QbMov0+RaPsHvYnK9m08WTZoxFNNSXBTa3S7+/c5B9OnsgrfuW QqBKe2C00F8baU0d6PEaGawUgShwzXJJMJ0RWQvzQjT0v5fC0wDLz9H+8/B9CsiS7KcS HkFl32shX0Z0VaQ3RZbdrD7w3gpMlFcNHlKaqPsrQslPRARbZfVbbZGkEgAZ2nTku3MD OU6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=GosZusxy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn5si16332896edb.117.2021.08.09.06.21.31; Mon, 09 Aug 2021 06:21:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=GosZusxy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235359AbhHINT4 (ORCPT + 99 others); Mon, 9 Aug 2021 09:19:56 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:54452 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235029AbhHINTz (ORCPT ); Mon, 9 Aug 2021 09:19:55 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 4A5AB21F4B; Mon, 9 Aug 2021 13:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1628515173; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QX1f69WbRiWu5Eg3CL5L0jwPsMknl/HQ42nsUY/VTWg=; b=GosZusxyRFNBNmD8DfIK8+2PEdI3WjLBBd311s7hV+O0VT9gz3Gq3AuPmyg5hW7qbUbbeF WLrVKNIb0/vqs/f8tgH7FDlZr8dM7AXcjvhKvj2fhV6G7c3Tg3IzBZDXp7LUIEeZuLihue 1FRI/+zqbTa7m8pHgf7x+ihdfZFxwcs= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 07737A3B81; Mon, 9 Aug 2021 13:19:32 +0000 (UTC) Date: Mon, 9 Aug 2021 15:19:32 +0200 From: Michal Hocko To: Feng Tang Cc: linux-mm@kvack.org, Andrew Morton , David Rientjes , Dave Hansen , Ben Widawsky , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Andrea Arcangeli , Mel Gorman , Mike Kravetz , Randy Dunlap , Vlastimil Babka , Andi Kleen , Dan Williams , ying.huang@intel.com Subject: Re: [PATCH v7 3/5] mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY Message-ID: References: <1627970362-61305-1-git-send-email-feng.tang@intel.com> <1627970362-61305-4-git-send-email-feng.tang@intel.com> <20210809024430.GA46432@shbuild999.sh.intel.com> <20210809123747.GB46432@shbuild999.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210809123747.GB46432@shbuild999.sh.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 09-08-21 20:37:47, Feng Tang wrote: > On Mon, Aug 09, 2021 at 10:41:40AM +0200, Michal Hocko wrote: > [snip] > > > >From fc30718c40f02ba5ea73456af49173e66b5032c1 Mon Sep 17 00:00:00 2001 > > > From: Ben Widawsky > > > Date: Thu, 5 Aug 2021 23:01:11 -0400 > > > Subject: [PATCH] mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY > > > > > > Implement the missing huge page allocation functionality while obeying the > > > preferred node semantics. This is similar to the implementation for > > > general page allocation, as it uses a fallback mechanism to try multiple > > > preferred nodes first, and then all other nodes. > > > > > > To avoid adding too many "#ifdef CONFIG_NUMA" check, add a helper function > > > in mempolicy.h to check whether a mempolicy is MPOL_PREFERRED_MANY. > > > > > > [akpm: fix compling issue when merging with other hugetlb patch] > > > [Thanks to 0day bot for catching the !CONFIG_NUMA compiling issue] > > > [Michal Hocko: suggest to remove the #ifdef CONFIG_NUMA check] > > > Link: https://lore.kernel.org/r/20200630212517.308045-12-ben.widawsky@intel.com > > > Link: https://lkml.kernel.org/r/1627970362-61305-4-git-send-email-feng.tang@intel.com > > > Suggested-by: Michal Hocko > > > Signed-off-by: Ben Widawsky > > > Co-developed-by: Feng Tang > > > Signed-off-by: Feng Tang > > > > Yeah. This looks much better. Thanks! > > Acked-by: Michal Hocko > > Thank you! > > > Do you think you can provide same helpers for other policies as well? > > Maybe we can get rid of some other ifdefery as well. > > Sure. I can make separate patch(es) for that. > > And you mean helper like mpol_is_bind/default/local/preferred? > > I just run 'git-grep MPOL', and for places using "mode == MPOL_XXX", > mostly they are in mempolicy.[ch], the only another place is in > shmem.c, do we need to create all the helpers for it and the > potential future users? I would just go with those instances which need to ifdef for NUMA. Thanks! -- Michal Hocko SUSE Labs