Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3238707pxb; Mon, 25 Jan 2021 10:23:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJze9XLe2+El5mXEKPpAJDDeLhZy+fliAw2FWA3gZ+mNLE/+1NtOvNhoXRo8XUKgVk7g7A6Y X-Received: by 2002:a17:907:9622:: with SMTP id gb34mr1158764ejc.30.1611598980265; Mon, 25 Jan 2021 10:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611598980; cv=none; d=google.com; s=arc-20160816; b=QreM1e4QUrZWdY6eBCOw+eYfURMCsId+IER2l6rhWIsj59TzFckXuMT0PJGVrusIrH qxVLfR+XDgK+yadr//MIHRYjtQ4x/NBB4D+9k9JHS0CTS5uBWbPduXuv+4QKjU9KZ4xr e1oyVbAyVMTPrH6kdOjyudq4v+FvzDm7KBIwh1tDCY6460ThebjFhkjbMCvwG8Zgqvnt FmucqwETydSJgevETo9P0aPA4OpHbpvKd9V71pdfo53oEIggKMPeCgw0TBk9b7Mn7D2D Rw39ePSpIvMWGbjTsNLrc6KPKbp1CAvwrFcP+wDLT/7CDpyBNcfiyHlhb5cc3dtF89Oi GffA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=0c4KjDt9RqUgbcxyXAyGUkPhwWC8rpyfeee6wZQAFco=; b=w76lilk74KrNHYXnbuwB5c00ISTpSx++dSoAxoD51J4a1D8wylSeKCuwzhe98Df1jL vkmxspZGZMmp60/AkHskHRsVNNM9aaKBVdBSCOtserhq3esQFY1AYOJ8YwUJf2d0oGFQ vO8LqtqOoc/ipDlJsyvi+9vdjSItmWmXOwKQm24OMg78NiIxSr6Dxrdmfe1oLAn8CtxG uDDr7AWw5VWH+X13t30P4m+RCzSDg1CfcSBBIGxYhII9VFs3gtF1bSQyq5jBWRewPtSn W0916aCu0hTazF42vbYxeNG/U9z/5Xjsz/3EesdAe3KS3LWetSqSDlSL3qrJCpLooGTQ 8qRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AqNbyr+0; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs42si6098285ejc.136.2021.01.25.10.22.35; Mon, 25 Jan 2021 10:23:00 -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=@google.com header.s=20161025 header.b=AqNbyr+0; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726677AbhAYSVL (ORCPT + 99 others); Mon, 25 Jan 2021 13:21:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbhAYSUw (ORCPT ); Mon, 25 Jan 2021 13:20:52 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41103C06178A for ; Mon, 25 Jan 2021 10:19:51 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id e9so130503pjj.0 for ; Mon, 25 Jan 2021 10:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=0c4KjDt9RqUgbcxyXAyGUkPhwWC8rpyfeee6wZQAFco=; b=AqNbyr+0wl4qPhxc3CH+99Y1/W6aQeouqpdR58sNIYDkGf5WmwV5MgeLJBM+IJ1Pvc dioGNRhcggbnIEy9SigRQFGl8trx8Oxl81+dLdOAiLTHheihfnqS0qNI5qKQ51G6PrWi AjxiMB4vDodzkwLRjltgGxDQrHLTXzNrsIXnVtWs2KYQTZTQ3pIGDts5Yr21ui0aaIQi 4bSnWwkHoSrHG0JHeaBj3YOZKvkMqu3AnHvqU6KZCxOoYOENDNIxXW9TJT6Fpy/alZj4 lOQ5W05p4mQz8efM/bPfTOaLOcBGbqYkFi5TwVKa1jIVc91DXYFZhhGlS/2/K5IOi6+O Zr0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=0c4KjDt9RqUgbcxyXAyGUkPhwWC8rpyfeee6wZQAFco=; b=fV1OBvn/bSEWed2XbTgY90Gn9Om7lJd+L0IwODje2vOxOAapmWQJKO/inFEtLxbEXv gFCNhC2kqB74IQMeYF9fwpx1JfCooMTDXee+WLlfrZPYbt/VVGvyFDQYaQX2sL/bmZCO xRO87PnyFtdrKXXO2VRxvceOVIEN9uLCOIjxUfr6g5gL5mebpi6oVb42bCeHV+OUJWxo WoSrQ9v9Z4s+kCzD+iNtBvTihqDzesjLvgX15ji4wMmmGIEXuzRo/JkTs7D5/AgAlZ2m XVz9t4esfMKkbonij/z18eRXZTTa/CiILke49cLhcYJ5Cdy7O7/EQe3rQYj+4184vLVY 1oKw== X-Gm-Message-State: AOAM531qTuXZGSFEx3neFBkjE1EqYFC/f7k4+cIZOrJr+tSuWLhO88+K k8VS6AaXnVqPH/cBXTZVB2kIpQ== X-Received: by 2002:a17:902:f54e:b029:de:19f9:c45f with SMTP id h14-20020a170902f54eb02900de19f9c45fmr1958100plf.48.1611598790601; Mon, 25 Jan 2021 10:19:50 -0800 (PST) Received: from [2620:15c:17:3:4a0f:cfff:fe51:6667] ([2620:15c:17:3:4a0f:cfff:fe51:6667]) by smtp.gmail.com with ESMTPSA id w21sm16351255pff.220.2021.01.25.10.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 10:19:49 -0800 (PST) Date: Mon, 25 Jan 2021 10:19:48 -0800 (PST) From: David Rientjes To: Alexander Lobakin cc: "David S. Miller" , Jakub Kicinski , 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 , Aleksandr Nogikh , 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 net-next 2/3] net: constify page_is_pfmemalloc() argument at call sites In-Reply-To: <20210125164612.243838-3-alobakin@pm.me> Message-ID: <85978330-9753-f7a-f263-7a1cfd95b851@google.com> References: <20210125164612.243838-1-alobakin@pm.me> <20210125164612.243838-3-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jan 2021, Alexander Lobakin wrote: > Constify "page" argument for page_is_pfmemalloc() users where applicable. > > Signed-off-by: Alexander Lobakin > --- > drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- > drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +- > drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- > drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +- > drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- > drivers/net/ethernet/intel/igb/igb_main.c | 2 +- > drivers/net/ethernet/intel/igc/igc_main.c | 2 +- > drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- > drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- > drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- > include/linux/skbuff.h | 4 ++-- > 11 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c > index 512080640cbc..0f8e962b5010 100644 > --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c > @@ -2800,7 +2800,7 @@ static void hns3_nic_alloc_rx_buffers(struct hns3_enet_ring *ring, > writel(i, ring->tqp->io_base + HNS3_RING_RX_RING_HEAD_REG); > } > > -static bool hns3_page_is_reusable(struct page *page) > +static bool hns3_page_is_reusable(const struct page *page) > { > return page_to_nid(page) == numa_mem_id() && > !page_is_pfmemalloc(page); Hi Alexander, All of these functions appear to be doing the same thing, would it make sense to simply add this to a header file and remove all the code duplication as well?