Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2700859pxb; Sat, 30 Jan 2021 11:10:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDQBoKa5yEtw05zPH7q6nTybhW/dp34WTVbG+PBSe/prsQb/8b9xeJwyvnOqEEEmS1+4z4 X-Received: by 2002:a17:906:e42:: with SMTP id q2mr10421754eji.25.1612033809176; Sat, 30 Jan 2021 11:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612033809; cv=none; d=google.com; s=arc-20160816; b=OJQzjePs5hMOSyJ3Ah7Lrrjm/X4VYItOFVcbgIUCuUYKFzT6xKVwzJyE7R2RP9+Njv VlFXt/2rfu+r9qtc2mAXnwBvwVim+KNW/DqhH73RMIJ/gyuo/rsLESWVkcRx8bgY1v2V Ultq0f4lQ8F09ulHrnoUcUTbatCK22O6eQGvokjMzBt1sry2zUih2QMh3Nsxn1fZ0RI+ NVIJTsUjS3oR1Bcn5UFP0aqjomsfKHXs/xtqtcmb5HRrQFzTMYulOhM6ZaW96Ur5A9Kg HQrSnp84eelnt6aL+BolANhHbS4qxxsbfJEO7u+GT/ZL6LXJZRJdnyk7CIDFXdPuW5yz I8JA== 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:cc:to:from:date :dkim-signature; bh=KK4x5bbrJYSaO6x/Jb2I9xplR2bP0N1idgtqfhmaKC4=; b=FZCaLDjsdt+iXYoK5Qg5oEzDFHM5eU1N2j1Np8HcWU7tJvO/RfZrW8NTtHhlSlEoJt W12KHyHayfCWA4FeursPYEFQ5QSFst6NPXxChTmmgbl7HffeB2GZ/wlL1iHExbMzvf5f qt/w1vPUxypFKJf3+4/kBGHU7bV8GCIP3YLc6b7DpZhtOOJZ3AeW4Hi/Bd/9b/ilrwU/ IgbK+5YjjUaFgGR/llPMxfguT4gdAGoJXGYILxTUqyr/12mBKZqnmTdYLzlJM88UkbUJ zOCKVLeVJyWVjcaQKka64V8tudEhKlgiOzpTIl+7moAwP4ViVmuT8WieN+kVFdeO2Gpn +jdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FXcv7/nF"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si6984488ejt.459.2021.01.30.11.09.45; Sat, 30 Jan 2021 11:10:09 -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=@kernel.org header.s=k20201202 header.b="FXcv7/nF"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbhA3THz (ORCPT + 99 others); Sat, 30 Jan 2021 14:07:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:36770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbhA3THu (ORCPT ); Sat, 30 Jan 2021 14:07:50 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.