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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 83A3DC433B4 for ; Tue, 6 Apr 2021 13:38:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19F5F600EF for ; Tue, 6 Apr 2021 13:38:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19F5F600EF 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 A1BF26B007E; Tue, 6 Apr 2021 09:38:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F2AA6B0080; Tue, 6 Apr 2021 09:38:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E1CA6B0081; Tue, 6 Apr 2021 09:38:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 744A26B007E for ; Tue, 6 Apr 2021 09:38:01 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2A691441E for ; Tue, 6 Apr 2021 13:38:01 +0000 (UTC) X-FDA: 78002045562.24.0C627EE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id 3E63080192DD for ; Tue, 6 Apr 2021 13:38:00 +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=adZ0C3cJ4lKQ8eG5ef+dmxnQo6NCZF8rtMgKAkFVbGA=; b=su4rnebOFB0EX6o6PmYWp05R/8 AeHyBIFkxxLWf2bzlXH1bYtGWgyiz89SlKo3dieqkCuGtRbIfo6jFVtQMU6bKeqeHpT9QhlWUcNnz LGrNqnHzmLdr9LyPPTSKPIwBL3LHI6JVWWkI2uR/Ich8su5XtvON5yYWmmfMFQX7MTO7+h8qoI5Ru 1kuH+1UJSU4/rzGUW4vpCxT560GTybyMsMcQm7RSz+1PKCtuHlonUb9EiclUAvDgOa3Utqqu0Mqmk 3RxPjJVPePD8odi5kCAkM5OAtEqnTkVpVIXOJ8Sja/ESOJCrhBHXOYUQ3FYUF1jFUasqjN7yItfv/ FmSNlgyQ==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lTltd-00Cs71-Vz; Tue, 06 Apr 2021 13:37:40 +0000 Date: Tue, 6 Apr 2021 14:37:33 +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 09/27] mm: Handle per-folio private data Message-ID: <20210406133733.GH3062550@infradead.org> References: <20210331184728.1188084-1-willy@infradead.org> <20210331184728.1188084-10-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210331184728.1188084-10-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3E63080192DD X-Stat-Signature: 8tzoj9xq6wymcsu16s1fy6ckkzrait5w Received-SPF: none (casper.srs.infradead.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617716280-289212 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 Wed, Mar 31, 2021 at 07:47:10PM +0100, Matthew Wilcox (Oracle) wrote: > Add folio_private() and set_folio_private() which mirror page_private() > and set_page_private() -- ie folio private data is the same as page > private data. The only difference is that these return a void * > instead of an unsigned long, which matches the majority of users. > > Turn attach_page_private() into attach_folio_private() and reimplement > attach_page_private() as a wrapper. No filesystem which uses page private > data currently supports compound pages, so we're free to define the rules. > attach_page_private() may only be called on a head page; if you want > to add private data to a tail page, you can call set_page_private() > directly (and shouldn't increment the page refcount! That should be > done when adding private data to the head page / folio). > > This saves 597 bytes of text with the distro-derived config that I'm > testing due to removing the calls to compound_head() in get_page() > & put_page(). Except that this seems to be the first patch that uses a field in the non-struct page union leg in struct folio, which could be trivially avoided this looks good: Reviewed-by: Christoph Hellwig