Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4437547pxv; Tue, 20 Jul 2021 03:53:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvm2jIDB1eAcarmFGv/2UafK4+sYgyQ7KdrP/aPPNw0N8YuMLgylI7j4bKN/MH7y1cCfKS X-Received: by 2002:a02:818c:: with SMTP id n12mr25919847jag.2.1626778428687; Tue, 20 Jul 2021 03:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626778428; cv=none; d=google.com; s=arc-20160816; b=T2cWsGWWhzI1W95VMhzh3MnWvkxODOlkMGMGCZbQsqeXGdD34B+1v8PfSq+AV2CxPo TuYI7wnLwMrwgf54fYR/sA6qs7U7LWE8t2uYQz3Q/QdQkRcDmx6y/CobtZFHEv6n2IaT GpC/MpdzqHXJlW7amCe8MFeZh3ClNxkk2wB23PxKi3mAhWCe+vAzRdbLRgfTgfTuFjZo 0UZXymYia597yVOrouVPF61mmhxmOTJq4a97p+9b8Gdq6CxPiUTu0ipuXd2eiwEfJGoo 8PLdkJrtu+hYSLeu7grLCqGfXskfWc7x1y9xLPrYIdR/lyaKT/nGr9Vbjepovm6MB3ww l9ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d2gKRcBMUM81bIAbgdEq/QXokoM91lU1JMJYPbJWcDE=; b=unuts1eSEyYmnkAmEAGSHP3/39mFPWmZUcfW6PQ6b68bLpHUsptjJkhNvVo0JLiWa9 gC+pn+5jHsY7D4JwtdmURgdmwVcU9WfRF6hgEti3NiXnZWTgMXZ0ssybIpNAgVZTQC2z w9plu2S7bmtGiP+WDNoHD39TpxVSWORgTDbAz4DxNLT28mQ5slcZ4wFo6mfpFEBbak5A g4/46HE6cbomGt2idHLI8ULFLYAtH2XOay7EY5F7T2xbCITtQY/PkdqQvID7kl7OGkeK BUYKVbPu0CWnrnR5Kkg0QozImKhVJdbhDlTRvNoJNy7yXs5g9oioloDhM4tLxbPUlBLm rb4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IgyUhlAp; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si12408608ilu.3.2021.07.20.03.53.35; Tue, 20 Jul 2021 03:53:48 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=IgyUhlAp; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237147AbhGTKIH (ORCPT + 99 others); Tue, 20 Jul 2021 06:08:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:34482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237373AbhGTKC0 (ORCPT ); Tue, 20 Jul 2021 06:02:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CAD8761209; Tue, 20 Jul 2021 10:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626777784; bh=TElIdA7TU13XWaYftU7W5tzTBGWxkzWuDXvv2eTmwow=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IgyUhlApKRNgfbycKofJc/KXwvMSWX3ifHhWeQUxKatrrWIR+CX25gE6Po5ke6Gmg YlqJ9dxsKPZv/fntA57t9CP3wrTxfyGan4TCcTUGoP/4/XUCoo62orPoLYunp37dbG H34Py5c9JmWl/lhncJMe5fNRZfzemUEu2mCON88K0lYvV18HKaatvbiEn3TPkd2RY6 vptTJZJL5+YdUkIZYnov6kjAUIJpQI6kwr9A+PU9tA3zTnxNyusg6Exsvl9PSHoffX aP0RaOZZiKqXnWG5KngWbYQkzXQz2FTEFPnZOdhedi+cMhf/Lh6ZiqUjZwHDxsIIYU L5LmmXmaXHHAQ== Date: Tue, 20 Jul 2021 13:42:57 +0300 From: Mike Rapoport To: "Matthew Wilcox (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Jeff Layton , "Kirill A . Shutemov" , Vlastimil Babka , William Kucharski , David Howells Subject: Re: [PATCH v14 012/138] mm: Handle per-folio private data Message-ID: References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-13-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-13-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 04:34:58AM +0100, Matthew Wilcox (Oracle) wrote: > Add folio_get_private() which mirrors 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 folio_attach_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 813 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(). > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: Christoph Hellwig > Acked-by: Jeff Layton > Acked-by: Kirill A. Shutemov > Acked-by: Vlastimil Babka > Reviewed-by: William Kucharski > Reviewed-by: David Howells > --- > include/linux/mm_types.h | 11 +++++++++ > include/linux/pagemap.h | 48 ++++++++++++++++++++++++---------------- > 2 files changed, 40 insertions(+), 19 deletions(-) Acked-by: Mike Rapoport