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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9A3BC433E0 for ; Wed, 24 Jun 2020 07:56:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 80C582085B for ; Wed, 24 Jun 2020 07:56:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80C582085B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0F7CF6B0002; Wed, 24 Jun 2020 03:56:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A9446B0003; Wed, 24 Jun 2020 03:56:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F008A6B0005; Wed, 24 Jun 2020 03:56:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id D98E46B0002 for ; Wed, 24 Jun 2020 03:56:01 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9916F181AD000 for ; Wed, 24 Jun 2020 07:56:01 +0000 (UTC) X-FDA: 76963346922.16.song90_090bbae26e42 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 6B14B100E690C for ; Wed, 24 Jun 2020 07:56:01 +0000 (UTC) X-HE-Tag: song90_090bbae26e42 X-Filterd-Recvd-Size: 3974 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 07:56:00 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id n24so1526206ejd.0 for ; Wed, 24 Jun 2020 00:56:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bMQXJ5DWPPE5i6ChyYiXXobY+C8z3CFKmXqFcbRk8hk=; b=j5/tiEfTBxP6Abbn7tu9M8JHk3QaZDT9Aluffxj8WMpvmCtoZL/YJl76MivPvxRfnp c9mGFn1JFU6WPaHfiCeFeC8RQ/84GLJiZGGuz7VfUj42XZJMBCxDY/o2e8VUOh5Qo82a KlYguk/SQv2Hya4rqH/b/5g3UzKx7zeLmwqEEJSPgHWxuMdFXKVz+9DrBa2h+UaMJ8VT 2zsRhmMEyq/ght6H3qsRW0u8/77TzsLeUOz3ZxO8T94HBNCI9dSehcK1ZjbPhhxtedXD UABRu84bdNIUnKgr77BkTf+RHl51kHEz9byeDEt/DKpsxrOME/ZjpeRoMR2ySpwxqfMo adyg== X-Gm-Message-State: AOAM530AmkZREr1wesPdipwo5icyTRsDwf+R8NG8R0dNlp5suHkpwCoG ws82SorcGUsg+ius9x0IrAk= X-Google-Smtp-Source: ABdhPJyJ5tirN9tlVIQkmzdUltFnpjPaBVhd0Vlhl8MplHj2kfE1Ht0T50Oi6zuW7eV6JUb8hQVyEw== X-Received: by 2002:a17:906:6d4b:: with SMTP id a11mr24909379ejt.108.1592985359755; Wed, 24 Jun 2020 00:55:59 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id i32sm21745edi.25.2020.06.24.00.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 00:55:59 -0700 (PDT) Date: Wed, 24 Jun 2020 09:55:57 +0200 From: Michal Hocko To: Ben Widawsky Cc: linux-mm , Christoph Lameter , Andrew Morton , David Rientjes Subject: Re: [PATCH 01/18] mm/mempolicy: Add comment for missing LOCAL Message-ID: <20200624075557.GD1320@dhcp22.suse.cz> References: <20200619162425.1052382-1-ben.widawsky@intel.com> <20200619162425.1052382-2-ben.widawsky@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200619162425.1052382-2-ben.widawsky@intel.com> X-Rspamd-Queue-Id: 6B14B100E690C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 Fri 19-06-20 09:24:08, Ben Widawsky wrote: > MPOL_LOCAL is a bit weird because it is simply a different name for an > existing behavior (preferred policy with no node mask). It has been this > way since it was added here: > commit 479e2802d09f ("mm: mempolicy: Make MPOL_LOCAL a real policy") > > It is so similar to MPOL_PREFERRED in fact that when the policy is > created in mpol_new, the mode is set as PREFERRED, and an internal state > representing LOCAL doesn't exist. > > To prevent future explorers from scratching their head as to why > MPOL_LOCAL isn't defined in the mpol_ops table, add a small comment > explaining the situations. Agreed. MPOL_LOCAL can be really confusing for whoever looks at the code the first time. > Cc: Christoph Lameter > Cc: Andrew Morton > Cc: David Rientjes > Signed-off-by: Ben Widawsky Acked-by: Michal Hocko > --- > mm/mempolicy.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/mempolicy.c b/mm/mempolicy.c > index 381320671677..36ee3267c25f 100644 > --- a/mm/mempolicy.c > +++ b/mm/mempolicy.c > @@ -427,6 +427,7 @@ static const struct mempolicy_operations mpol_ops[MPOL_MAX] = { > .create = mpol_new_bind, > .rebind = mpol_rebind_nodemask, > }, > + /* MPOL_LOCAL is converted to MPOL_PREFERRED on policy creation */ I would just add. See mpol_new() > }; > > static int migrate_page_add(struct page *page, struct list_head *pagelist, > -- > 2.27.0 > -- Michal Hocko SUSE Labs