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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 D80D5C433E0 for ; Wed, 23 Dec 2020 01:19:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 54D2A222BB for ; Wed, 23 Dec 2020 01:19:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54D2A222BB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6D32E8D0002; Tue, 22 Dec 2020 20:19:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 65C868D0001; Tue, 22 Dec 2020 20:19:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5241D8D0002; Tue, 22 Dec 2020 20:19:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 37F198D0001 for ; Tue, 22 Dec 2020 20:19:52 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 021A63634 for ; Wed, 23 Dec 2020 01:19:52 +0000 (UTC) X-FDA: 77622790224.26.smile83_2115e2d27464 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id D5AAE1804B660 for ; Wed, 23 Dec 2020 01:19:51 +0000 (UTC) X-HE-Tag: smile83_2115e2d27464 X-Filterd-Recvd-Size: 3565 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Dec 2020 01:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MnZyNILS6l5MC6SCKKdknnUI+WIaEBFHFU2GBSzA3Es=; b=FBS3pJfWQF12z+EX3KHG8aoQVX R/fXYqdbxqe5si4/Npt0AXMjcusmScxnnoOJqcTBAFh2b0Utbjkv7lWq0MzWWwGNF9rpWpiRbgy8V lbx4Z6BG0o3V/9Rm77EC74VcEYiAcLVzYeMsnm1Jn2ejKt5N6d0vzKNd4T3OHx0dlqFk3XhTv4VER vclW3gZ4h87BH5o1n57yj3nZz/CgXxoNNosN6MC9otwjVwPH16WzU+kSu7nhJMv0FLlpEonG6sgoy VGF3IYzzEOK4ZMEkn25HWGfBo79ltj4KpSrvcPU71jzPIdEdh/RMX7XVe+ve+ix/OnT9KLpyZNv7W mhOyBLPQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1krsob-0004Xi-Um; Wed, 23 Dec 2020 01:19:46 +0000 Date: Wed, 23 Dec 2020 01:19:45 +0000 From: Matthew Wilcox To: Andrew Morton 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: <20201223011945.GO874@casper.infradead.org> References: <1608646792-29073-1-git-send-email-jrdr.linux@gmail.com> <20201222204000.GN874@casper.infradead.org> <20201222155345.e7086ad37967c9b7feae29e4@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201222155345.e7086ad37967c9b7feae29e4@linux-foundation.org> 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 Tue, Dec 22, 2020 at 03:53:45PM -0800, Andrew Morton wrote: > : 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. Yes, but it's wrong, because it's not architecture dependent. It depends on CONFIG_DEBUG_INFO_BTF > > > +/* > > > + * 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". ... and the same wrong information is present here. If there's going to be a comment here at least make it something informative like /* Must be visible for error injection */ > > > +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. ... but this is a new prototype. Prototype names don't have to match the function name (and often don't ...) > And I don't think we should be preparing large "rename offset to index" > patches, please. The value/noise ratio is too low. I'm only fixing them as I change those functions. I just object to introducing new wrong ones.