Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5379598pxu; Tue, 22 Dec 2020 15:56:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkdnq8c0DMQdMVKmiJ3H7FZwDA/k9FcWrnFpG8QIVyPPIp19jHkyFhDTOqmrA9Bg7tFvAC X-Received: by 2002:a17:906:3b8b:: with SMTP id u11mr21516334ejf.489.1608681392573; Tue, 22 Dec 2020 15:56:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608681392; cv=none; d=google.com; s=arc-20160816; b=G3lZayUmCkGAXK2JdQTj653vF8ccX1MFjaj6EnOP++dSgam85kzJnn9LzS36eJz9LA id6h/LfZ1eH3zxV41h1Y+cIKy7SKJ2KLTyFXWcNCGGn4AD1lMjvvRNNiJaAuwUptb1+2 LSK1tXxKlgbAB7XLoVUoV0RhpxSkVrzLb9eK0N2R6Zb+fQCie/PvMMKiLEb5hShyGtIV ZOqeCv+Hh2Gqgu3fhMxlWDgFXOJ5x1VUDtw7QJ4cNbwmjvL7EZIJ/ZBRT3RyPSVhU91/ cdrbRYNUshzVn7ZRmFR+GIl/MY8cbDs7IqfHXfO2cpyxOkZlm2QhADAYreavMquVqE4k Tzqg== 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=C5KgZ5iE/amgsHkT91b20tLkoKTiok3alRZtD11Ab3Q=; b=NxFnJfKP2KlFxWId2A9rcQrvVHYF+lY45zOUit8rQ1KR8/rI8QiNDSYZEb6WFRAXld +0sEgDWMXKMgrP5/3ssgGXAixJGmOS2iF34DxPlIbBADEjsX6WdLZAFJgPSuK6Rk24Pp Ir0aKkAjAcS45ns6/n3cJgyzcb77+571QFVPH2qgPtcgIxQ0QveUcjhHVlpkpvi3TxX6 ZoSgQYiNL2mpU3qCI4tYOhgvx80MNzfUhb3+5cd5pQNfft79IUWqIdA3JBWF3B/TGrBr Ki84Wc5B86L55QHUkCIXidyKTjErjcQvLc6h5nroHV6WqsY/FL+nktC/fWfTHvhDIE+W gnVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=synwhqm8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se15si11239641ejb.270.2020.12.22.15.56.10; Tue, 22 Dec 2020 15:56:32 -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=@linux-foundation.org header.s=korg header.b=synwhqm8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbgLVXy0 (ORCPT + 99 others); Tue, 22 Dec 2020 18:54:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:42174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbgLVXy0 (ORCPT ); Tue, 22 Dec 2020 18:54:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A40BC22B2D; Tue, 22 Dec 2020 23:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608681225; bh=HWarrS6CziBbBzyDxCxnKusJ4RarklBqybLYalWUSa0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=synwhqm8/c7DFJaUZ7GKtJYIvYhcTKnqKRHDBtRLB1p4TFBL6s4LazB7x/xfX7i0E gPxTbPvfwlqkkoReusb8wwGRDsHi99Y/eq+Pg2Tr4o/R7j2hq7WClyv5+yR6lbcPRW cI2XxuOUJKI8LQgJFFo7RWPuSF9JP9Lf712ksIXg= Date: Tue, 22 Dec 2020 15:53:45 -0800 From: Andrew Morton To: Matthew Wilcox Cc: Souptick Joarder , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alex Shi Subject: Re: [PATCH] mm: add prototype for __add_to_page_cache_locked() Message-Id: <20201222155345.e7086ad37967c9b7feae29e4@linux-foundation.org> In-Reply-To: <20201222204000.GN874@casper.infradead.org> References: <1608646792-29073-1-git-send-email-jrdr.linux@gmail.com> <20201222204000.GN874@casper.infradead.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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 Tue, 22 Dec 2020 20:40:00 +0000 Matthew Wilcox wrote: > On Tue, Dec 22, 2020 at 07:49:52PM +0530, Souptick Joarder wrote: > > Otherwise it cause gcc warning: > > ^~~~~~~~~~~~~~~ > > That line is just confusing. I cleaned up the changelog. It is presently : Subject: include/linux/mm.h: add prototype for __add_to_page_cache_locked() : : Otherwise it causes a gcc warning: : : ../mm/filemap.c:830:14: warning: no previous prototype for : `__add_to_page_cache_locked' [-Wmissing-prototypes] : : A previous attempt to make this function static led to compilation : errors for a few architectures, because __add_to_page_cache_locked() is : referred to by BPF code. : : Adding a prototype will silence the warning. > > --- a/include/linux/mm.h > > +++ b/include/linux/mm.h > > @@ -216,6 +216,12 @@ int overcommit_kbytes_handler(struct ctl_table *, int, void *, size_t *, > > loff_t *); > > int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *, > > loff_t *); > > +/* > > + * Any attempt to mark this function as static leads to build failure > > + * for few architectures. Adding a prototype to silence gcc warning. > > + */ > > We don't need a comment here for this. The commit log is enough. I think it's OK - people do send patches which remove a prototype and also make the function static. A tree-wide grep would catch the bpf reference but I suspect people tend to grep for "foo(" rather then "foo". > > +int __add_to_page_cache_locked(struct page *page, struct address_space *mapping, > > + pgoff_t offset, gfp_t gfp, void **shadowp); > > Please name that 'index', not 'offset'. I too prefer index over offset. X1:/usr/src/linux-5.10> grep -r "pgoff_t offset" . | wc -l 52 X1:/usr/src/linux-5.10> grep -r "pgoff_t index" . | wc -l 250 But renaming this arg should be a separate patch. And I don't think we should be preparing large "rename offset to index" patches, please. The value/noise ratio is too low.