Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp440985rwb; Wed, 16 Nov 2022 03:00:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Mkk0CSJFT/mxLAoooPIXFp9/NjYCISV/4u4ql1fHdxDcwMqJgLKwMNEfHjG2XhMmkQGDW X-Received: by 2002:a17:906:2852:b0:7ad:9f03:fd44 with SMTP id s18-20020a170906285200b007ad9f03fd44mr17190206ejc.73.1668596437697; Wed, 16 Nov 2022 03:00:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668596437; cv=none; d=google.com; s=arc-20160816; b=oMAjOws9gmTfXXHof4f/XpkdzAuh/dA4FxfKhZqHf8n2CbVAuHaX9yFeh9x1pJ9dhx iXGD9ICszbL2N4q4fInmbQZEOimOs8K2vZCs2pcx4xGxYoyfUqn/dPVggfios8BwbHhD 8l7Sn3u9iayxdrxKFD0pg7jttzoQWD23QMJ4aECcJG/PWMUgcy2yvurxdReU2PyHrwnE 2iLHqh8Li7epyfoHpSXHMqTnDOtdja+LiUyQGqp2VycXHIfFNP4Vlck9rbNcp5l3VrUU c4/K0s5KwZ8LkhMGL3Xayuqv4DhrfefMZKzsfLxo4C5A+sRY3E3kYp8vi2g0pN6xgl1Y R8EA== 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=bd1ed+hXkn5V0KAbqZOvNVfy2rS7WvVz5GEqvktKWWY=; b=m00hxsj1Hxi/rvlQJRGyyOJVbL46VHxzDVayuWC++qGc9kuoJSws8CernCvN/HJN6J 4JBVa3yFhLNW0nU/I7S2FxvmnK48ok5LfB62fBPLMvb5e4VbW5dcC/EdtGwBQtexP4RB QAU/2FQgn+al4Xz5xlomiLo7VW/DnyUpEH2rBR4i9kZpqoZElZ576kSzAgLru3y9zOZ7 zY/szv/wUd2xXfkPdiLOOXECa6U6r3QyOiEzHIqCwB51QTe3NOp85xgH4L0TgzdEOCdV wYjEbU4kAQwehQkA+dDkLLUsLxFDGhhp5xzDqOWdL0WBgeKIhhABP89nBzge9nh5Hj6M Nl8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=X7MK3qso; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a056402171000b00461c41bd7b6si12554088edu.209.2022.11.16.03.00.14; Wed, 16 Nov 2022 03:00:37 -0800 (PST) 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=@suse.com header.s=susede1 header.b=X7MK3qso; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231688AbiKPJoT (ORCPT + 91 others); Wed, 16 Nov 2022 04:44:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbiKPJoR (ORCPT ); Wed, 16 Nov 2022 04:44:17 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D8DC35; Wed, 16 Nov 2022 01:44:17 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id CB0651F917; Wed, 16 Nov 2022 09:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1668591855; 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=bd1ed+hXkn5V0KAbqZOvNVfy2rS7WvVz5GEqvktKWWY=; b=X7MK3qsoKxTEpjWbFjE9xW0c2iyyPdjK7wws/FefVvJvW9CRT/hoRursX3YRl3h4gO/gln iWUy8RzwaPACPNE7Ka4m9J+lAieH4Z+Neuln6AnJPVivUFAoDvbEiBDBEAyHDtuKPtStIR VyMepZxN93/ysm6GILFefm67khV6+mU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AAFE3134CE; Wed, 16 Nov 2022 09:44:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id V5FhJ++wdGNKPQAAMHmgww (envelope-from ); Wed, 16 Nov 2022 09:44:15 +0000 Date: Wed, 16 Nov 2022 10:44:15 +0100 From: Michal Hocko To: Zhongkun He Cc: "Huang, Ying" , corbet@lwn.net, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [External] Re: [PATCH v2] mm: add new syscall pidfd_set_mempolicy(). Message-ID: References: <20221111084051.2121029-1-hezhongkun.hzk@bytedance.com> <87zgcrwfac.fsf@yhuang6-desk2.ccr.corp.intel.com> <0445de39-15a4-f645-b380-39f20abb6524@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0445de39-15a4-f645-b380-39f20abb6524@bytedance.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Wed 16-11-22 17:38:09, Zhongkun He wrote: > Hi Ying, thanks for your replay and suggestions. > > > > > I suggest to move the flags in "mode" parameter (MPOL_F_STATIC_NODES, > > MPOL_F_RELATIVE_NODES, MPOL_F_NUMA_BALANCING, etc.) to "flags" > > parameter, otherwise, why add it? > > The "flags" is used for future extension if any, just like > process_madvise() and set_mempolicy_home_node(). > Maybe it should be removed. No, please! Even if there is no use for the flags now we are usually terrible at predicting future and potential extensions. MPOL_F* is kinda flags but for historical reasons it is a separate mode and we shouldn't create a new confusion when this is treated differently for pidfd based APIs. > > And, how about add a "home_node" parameter? I don't think that it's a > > good idea to add another new syscall for pidfd_set_mempolicy_home_node() > > in the future. Why would this be a bad idea? > Good idea, but "home_node" is used for vma policy, not task policy. > It is possible to use it in pidfd_mbind() in the future. I woould go with pidfd_set_mempolicy_home_node to counterpart an existing syscall. -- Michal Hocko SUSE Labs