From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FE8AC25B06 for ; Thu, 4 Aug 2022 22:37:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C34C18E0002; Thu, 4 Aug 2022 18:37:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE37E8E0001; Thu, 4 Aug 2022 18:37:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAA668E0002; Thu, 4 Aug 2022 18:37:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 97D3E8E0001 for ; Thu, 4 Aug 2022 18:37:22 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 548B816021C for ; Thu, 4 Aug 2022 22:37:22 +0000 (UTC) X-FDA: 79763372724.27.A9D0D08 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf05.hostedemail.com (Postfix) with ESMTP id BF9B5100136 for ; Thu, 4 Aug 2022 22:37:21 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C4B7EB82770; Thu, 4 Aug 2022 22:37:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27A60C433D7; Thu, 4 Aug 2022 22:37:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1659652638; bh=IiLFKcasXXCr0CUdK9gkYeioVvsa5PwqF04icaA/D+8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=viG5SIdZHiNQGekOfLicfrZM/1C2/h5PaH2CKzkJNsnXyDUseGxBL48u/vDZ7eKLb FZ41llPmOt67YM9qDPY5Ucl5DV8CGoCenqs9sm8ejNwE2714hCBbCiTajfkE70THzq iegMsUFfbvJfVhFDKC8fZWvYtTjNbIFCakWVcpgM= Date: Thu, 4 Aug 2022 15:37:17 -0700 From: Andrew Morton To: Michal Hocko Cc: Feng Tang , Muchun Song , Mike Kravetz , Dave Hansen , Ben Widawsky , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/hugetlb: add dedicated func to get 'allowed' nodemask for current process Message-Id: <20220804153717.eea592a171accd245a0cc7d8@linux-foundation.org> In-Reply-To: References: <20220804130342.63355-1-feng.tang@intel.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659652642; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YaxiZu/c9xpBIJkdnEZxBag0aTs9Euz54aOoZnKNy/Q=; b=Zy+7pXpsXtDYsCcmonvQaJic513U3oVGwYMHs3ISpg2w2aCJBUSk/dAckcToii2Ok1IWHo q6jkzYn2ZgrDOeH+9qghBze6sSn07J2t+HGqJEDe4kVcBwbnJKQ2Irx10kqBTF9JtQ8AfY PUp0qf+GAZzGHueXfpXfX3/DIUnyw8g= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=viG5SIdZ; spf=pass (imf05.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659652642; a=rsa-sha256; cv=none; b=7RxAjcsap6qvHdnIaimeXFMSJ3s9v0FS0dcAjKKut7rc3I6JV9mjCuvctNwWdEEKBllcUO Yd/g8GaXhmD2QAILTlx5qc/sv+bVVecyivdI3WPhH4AIIgA4lPhexORlWZE9YVNtXeBktM gTbagOcPiH3jUnej8MP2BNBonwOppgU= X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=viG5SIdZ; spf=pass (imf05.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BF9B5100136 X-Stat-Signature: f1n76zi76n58s7ahhmbbypxgcuxcnut4 X-HE-Tag: 1659652641-834888 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 4 Aug 2022 15:36:48 +0200 Michal Hocko wrote: > On Thu 04-08-22 21:03:42, Feng Tang wrote: > > Muchun Song found that after MPOL_PREFERRED_MANY policy was introduced > > in commit b27abaccf8e8 ("mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes") > > [1], the policy_nodemask_current()'s semantics for this new policy > > has been changed, which returns 'preferred' nodes instead of 'allowed' > > nodes, and could hurt the usage of its caller in hugetlb: > > allowed_mems_nr(). > > The acutal user visible effect description is missing here. AFAIU it > would be this. > > With the changed semantic of policy_nodemask_current a taks with > MPOL_PREFERRED_MANY policy could fail to get its reservation even though > it can fall back to other nodes (either defined by cpusets or all online > nodes) for that reservation failing mmap calles unnecessarily early. > > The fix is to not consider MPOL_PREFERRED_MANY for reservations at all > because they, unlike MPOL_MBIND, do not pose any actual hard constrain. And is this Fixes: b27abaccf8e8 ("mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes")?