Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1025159rwb; Thu, 4 Aug 2022 15:53:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR7AwOnEKyl7StJdoNxekPe4T62rYXGIbU4x8kLXCo/lv5kTou0H8Ax+vVk8n0l9LBBO7r8H X-Received: by 2002:a05:6402:5415:b0:43b:a888:fefe with SMTP id ev21-20020a056402541500b0043ba888fefemr4045089edb.302.1659653610474; Thu, 04 Aug 2022 15:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659653610; cv=none; d=google.com; s=arc-20160816; b=NP58Gbm1Rpy2E4JNQi+kZEBjQiHtPHqrRIKBHH48hvdA8Ywnz5gbyXjV7+kSDfR1Lc vWPRH2/aNq+MnvOHTUTaMJZ718FUybGHEHbFfh8G2/aiBRxnc8ML9LFKqFVb15fE6lX2 zSVQi995m1TS7mXjybDJIj8ImtDCbNiWPEJb1DfGis2ZIpeG0cHWJuUrGNkE9bb8tOoC G1ePU/JB5siUr5gjFy7M+v9NkoiYsA4NtFITknCjBbsfXx3hOSpSO0oFx4PYgyYsXwY4 SGbtLVtwlKOnc5WsnvLJ7b6M754uw8UHxgczMCtMjllijVZRCM5RgOkTxcHhicm1tXf+ Ek/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YaxiZu/c9xpBIJkdnEZxBag0aTs9Euz54aOoZnKNy/Q=; b=Laz3eS2ZRpgTSSNytPq7x4aMhiiuvXq5QTllPAxMeehPZgzUEkDw8Dfk342vQyWFDD 9SpkpSQv77VrTu4flcyKgardVhl89xSZr3UKxp9H/g59VpPWG8cNiMpUo5h0hI8D381o pAp8CUiouz00ZOF6FbHnD7V2EGcZNitYIGFpOgqCfSMLnhn40u5B4G+YVp0ek59yU4am ssojgqvndYWP5Q0gdniXFhu5ukdcDKplDduv3efokhQHOgSLTSRlu4KZRw2rW8LP+aCn xM5EyXsmF11pXg2k7WhIHdS3TTxjzzgitxnL0cH9zDCw1hsWQ/GL1s5kK8s5kWmvVAGh 9jWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=viG5SIdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz15-20020a1709077d8f00b00730bae00e15si2120444ejc.140.2022.08.04.15.53.05; Thu, 04 Aug 2022 15:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=viG5SIdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240066AbiHDWhW (ORCPT + 99 others); Thu, 4 Aug 2022 18:37:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240047AbiHDWhU (ORCPT ); Thu, 4 Aug 2022 18:37:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F45A25C64 for ; Thu, 4 Aug 2022 15:37:19 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 1F0F1614DA for ; 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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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")?