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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 7001DC433DB for ; Sat, 30 Jan 2021 19:45:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1DB1864E11 for ; Sat, 30 Jan 2021 19:45:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DB1864E11 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=pm.me Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D2D86B0005; Sat, 30 Jan 2021 14:45:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 25BCC6B0006; Sat, 30 Jan 2021 14:45:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14AA06B006C; Sat, 30 Jan 2021 14:45:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id EF0DD6B0005 for ; Sat, 30 Jan 2021 14:45:40 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AC7998249980 for ; Sat, 30 Jan 2021 19:45:40 +0000 (UTC) X-FDA: 77763471240.11.mask97_3717eef275b3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 86404180F8B80 for ; Sat, 30 Jan 2021 19:45:40 +0000 (UTC) X-HE-Tag: mask97_3717eef275b3 X-Filterd-Recvd-Size: 4592 Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Sat, 30 Jan 2021 19:45:39 +0000 (UTC) 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-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: 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