Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2716145pxb; Sat, 30 Jan 2021 11:47:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFzxojZ4p078/aA/WHoQrPFQSod2CPPvU4I4Qo6HsMQ8Na61G8YOF9lUUpIi39BOvYLi7c X-Received: by 2002:a17:906:bce3:: with SMTP id op3mr10394196ejb.485.1612036040636; Sat, 30 Jan 2021 11:47:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612036040; cv=none; d=google.com; s=arc-20160816; b=UuhqyRM+kdS6CN4tgF2cZ5u8vhdK6ujIJDecCRnqJxEcrIN/1nmMzL0ImNVIwkM0ch OOahZM4IREvKO+dtT7/NoLTwUjWNDkVA+cK/Zv6k5L4z/xbRD6UmgCul3Q/PW9R+2z8p at0YHhABo8MkvlDNmNPJ5niZtd88I5Sguw5duEJySQSSYPury6ovcPsNbDu6YN7Y1lm0 mzWcX3QPOVVYxt3vqnegVqO9MJix12j4wGlJOUOr1rI4O2ALR2BuCQBiA2YER1/knK+k hzZYD9QuhZcNbltZrKuk+yMyyAJwqKN06A1uURVbIZvC/Lw3ERxTDcjEFJVP6hgC1sXo gBxg== 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:reply-to:cc:from:to :dkim-signature:date; bh=KSS1WvHH+UXhfQLYUW4Daeb2Nv6yueVQ+VvjzEee/oA=; b=c1BFVooI1WhfwUoPFh6RgwYcTJ9/tmv86ZMWZjdBn/E+/KOGN406Pp140ffY05/Sux Z5abl/RK3pc9RncVzSZ+fcGn3i6gK86117a+tNkY1/b+YPzY+Q+6KYvIoGbhUjkNj1El 9VhQP2Q8elFf5Eveb3PEWKIPhOqbutuXbCc6EBHiRFwF3FM3x1XmAclWfvZZZIvIR+6q ZJKkh1F0rpcvL4wIWPI01NGfPH/aQUToDFrW1aGa3QQlxqOKBeG+OdIb+Xe/9+LrLoDi OXtrmwM9E6V2WyI+U0ji1JWpVjJAwGCDhf6blwdeYp2PakE8kZ1rrgJ6ybIsiDrmbifT H/bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=GyORbfU+; 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=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si7235877ejg.404.2021.01.30.11.46.54; Sat, 30 Jan 2021 11:47:20 -0800 (PST) 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=@pm.me header.s=protonmail header.b=GyORbfU+; 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=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbhA3TqX (ORCPT + 99 others); Sat, 30 Jan 2021 14:46:23 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:24169 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbhA3TqV (ORCPT ); Sat, 30 Jan 2021 14:46:21 -0500 Date: Sat, 30 Jan 2021 19:45:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1612035938; bh=KSS1WvHH+UXhfQLYUW4Daeb2Nv6yueVQ+VvjzEee/oA=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=GyORbfU+/iCXjaGF+dybJTXC9VvnAg4Yv47+oBL5y2ZsjMfuSNNu9ada072bWwz3G GJ1CogfM/BwCFIyL+YpjA0G7iY/z8dYQDD7uIQLCfNbYz2RLUS4TcyG55EFfJjlCBF DdaXtFEVU4OtuU0zNge83VNKL/NAg/cRtX8RrOz++4yhtNMD7kNU3GCt0xBl1IeP7i l5mPl/Zzcq0KSA7yhR9i6z+tO8uWgKGN0xWm07zlODJ3HEjhQK7IWuQV7iBTJic8oy U1VOjsuEKkRpcZl7/B5FuDSI2Jhbo7R91ouAZTWeUrEpFhPtlpvM8Gi4SFC3KQFCoK cOI3C6b1kSKFA== To: Jakub Kicinski From: Alexander Lobakin Cc: Alexander Lobakin , "David S. Miller" , David Rientjes , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Saeed Mahameed , Leon Romanovsky , Andrew Morton , Jesper Dangaard Brouer , Ilias Apalodimas , Jonathan Lemon , Willem de Bruijn , Randy Dunlap , Pablo Neira Ayuso , Dexuan Cui , Jakub Sitnicki , Marco Elver , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org Reply-To: Alexander Lobakin Subject: Re: [PATCH v2 net-next 3/4] net: introduce common dev_page_is_reserved() Message-ID: <20210130194459.37837-1-alobakin@pm.me> In-Reply-To: <20210130110707.3122a360@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20210127201031.98544-1-alobakin@pm.me> <20210127201031.98544-4-alobakin@pm.me> <20210129183907.2ae5ca3d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210130154149.8107-1-alobakin@pm.me> <20210130110707.3122a360@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Kicinski Date: Sat, 30 Jan 2021 11:07:07 -0800 > On Sat, 30 Jan 2021 15:42:29 +0000 Alexander Lobakin wrote: > > > On Wed, 27 Jan 2021 20:11:23 +0000 Alexander Lobakin wrote: > > > > + * dev_page_is_reserved - check whether a page can be reused for n= etwork Rx > > > > + * @page: the page to test > > > > + * > > > > + * A page shouldn't be considered for reusing/recycling if it was = allocated > > > > + * under memory pressure or at a distant memory node. > > > > + * > > > > + * Returns true if this page should be returned to page allocator,= false > > > > + * otherwise. > > > > + */ > > > > +static inline bool dev_page_is_reserved(const struct page *page) > > > > > > Am I the only one who feels like "reusable" is a better term than > > > "reserved". > > > > I thought about it, but this will need to inverse the conditions in > > most of the drivers. I decided to keep it as it is. > > I can redo if "reusable" is preferred. >=20 > Naming is hard. As long as the condition is not a double negative it > reads fine to me, but that's probably personal preference. > The thing that doesn't sit well is the fact that there is nothing > "reserved" about a page from another NUMA node.. But again, if nobody > +1s this it's whatever... Agree on NUMA and naming. I'm a bit surprised that 95% of drivers have this helper called "reserved" (one of the reasons why I finished with this variant). Let's say, if anybody else will vote for "reusable", I'll pick it for v3. > That said can we move the likely()/unlikely() into the helper itself? > People on the internet may say otherwise but according to my tests > using __builtin_expect() on a return value of a static inline helper > works just fine. Sounds fine, this will make code more elegant. Will publish v3 soon. Thanks, Al