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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 3DD67C433B4 for ; Tue, 6 Apr 2021 13:31:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9FCC613C3 for ; Tue, 6 Apr 2021 13:31:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344480AbhDFNbd (ORCPT ); Tue, 6 Apr 2021 09:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhDFNbc (ORCPT ); Tue, 6 Apr 2021 09:31:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1482EC06174A; Tue, 6 Apr 2021 06:31:25 -0700 (PDT) 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=wQuSgXvvayHccqDmkcsLOwlAkT4r6qTVRKvApKKeAHE=; b=QoXafGbjSMFSahCUJ4nxDTUD3P rFsvFlqB+0rSuJbWYoatudI9IGCUCB9MAdIO/kpAMmqcnvpQr0mYUYiOEP/wTPDrPE7pHDIzcijKh 3kg34KvSZmbaCUZYjqbBeczXm8UhnmUIKBhTFBlpcre7Gzr1s9xAdANZ4TTQSeVCALpEhwkgWbn4d UFvuGBOMQ2rgjw6ojpgZOnhr55YMGyM7ouZwTT0F6NhoTSE7xHu99EgFt7MkkDzAJvkeVEri1r3X4 TojqIhbKgIcV+3KX0z7dE7kh+iru41FOEK1yALk8j9cBpFFHjv1r7CZmNA0HPwqZkkai9627pM8ev +xXCHq5g==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lTln6-00CrXl-3O; Tue, 06 Apr 2021 13:30:53 +0000 Date: Tue, 6 Apr 2021 14:30:48 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org Subject: Re: [PATCH v6 05/27] mm: Add folio reference count functions Message-ID: <20210406133048.GD3062550@infradead.org> References: <20210331184728.1188084-1-willy@infradead.org> <20210331184728.1188084-6-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210331184728.1188084-6-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 07:47:06PM +0100, Matthew Wilcox (Oracle) wrote: > These functions mirror their page reference counterparts. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > Documentation/core-api/mm-api.rst | 1 + > include/linux/page_ref.h | 88 ++++++++++++++++++++++++++++++- > 2 files changed, 88 insertions(+), 1 deletion(-) > > diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst > index 34f46df91a8b..1ead2570b217 100644 > --- a/Documentation/core-api/mm-api.rst > +++ b/Documentation/core-api/mm-api.rst > @@ -97,3 +97,4 @@ More Memory Management Functions > :internal: > .. kernel-doc:: include/linux/mm.h > :internal: > +.. kernel-doc:: include/linux/page_ref.h > diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h > index f3318f34fc54..f27005e760fd 100644 > --- a/include/linux/page_ref.h > +++ b/include/linux/page_ref.h > @@ -69,7 +69,29 @@ static inline int page_ref_count(struct page *page) > > static inline int page_count(struct page *page) > { > - return atomic_read(&compound_head(page)->_refcount); > + return page_ref_count(compound_head(page)); > +} I don't think this change belongs in here. It seems useful though, so maybe split it into a standalone patch? Otherwise looks good: Reviewed-by: Christoph Hellwig