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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 1C1AFC433E0 for ; Sat, 30 Jan 2021 19:07:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 90A9660234 for ; Sat, 30 Jan 2021 19:07:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90A9660234 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 BE9FE6B0005; Sat, 30 Jan 2021 14:07:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B99D96B0006; Sat, 30 Jan 2021 14:07:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A61996B006C; Sat, 30 Jan 2021 14:07:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 8D6666B0006 for ; Sat, 30 Jan 2021 14:07:11 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5B0C2181AEF1F for ; Sat, 30 Jan 2021 19:07:11 +0000 (UTC) X-FDA: 77763374262.25.pipe95_010fcc2275b3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 3773D1804E3B4 for ; Sat, 30 Jan 2021 19:07:11 +0000 (UTC) X-HE-Tag: pipe95_010fcc2275b3 X-Filterd-Recvd-Size: 3829 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Sat, 30 Jan 2021 19:07:10 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DB3064E11; Sat, 30 Jan 2021 19:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612033629; bh=Fzdh9rDGCBTjOe6wgkL8Ejbzqqmt3AuErhjUnt6GaB4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FXcv7/nFC2W4/QcK5la7BT3W/pfJcY5sCGsMxVhMJ5ofFjavYdoxnkh7WgdYLMg/P Bw+3YQis90jZ8Gr1RfBojb2mY8Ba/yuDF/oJklJcFuD2UCFB9pWc0KyyLWeG5HEB3D gftGmLwwhh4oqoQm0zQxYg7pzL0lb2Os0VNZrgDWpb+5ekH1lTfvAvtkBtnZrO+g91 VMjzUCX5XsH1pAvau9oVXTt9C1UZuHW4cjHP53tcNK/FpouEYPYm04CmGMaV+ryo4A 21gNW6N50sxVx68cJmnY7Klqw2Rq4XcrJOS7R7LlqtunuAI3ffT/n0d0Rh5C9LBJW/ TLJlgdBjQUqfw== Date: Sat, 30 Jan 2021 11:07:07 -0800 From: Jakub Kicinski To: Alexander Lobakin Cc: "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 Subject: Re: [PATCH v2 net-next 3/4] net: introduce common dev_page_is_reserved() Message-ID: <20210130110707.3122a360@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210130154149.8107-1-alobakin@pm.me> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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 network 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. 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... 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.