Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp839640pxj; Fri, 14 May 2021 18:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmOLnvUnGqIt4SbuF8XGURossbd7pQCs6MMY9fQbh7C58EMsyPMGtsxG+X3QgZs8aCYT6q X-Received: by 2002:a17:906:d7a2:: with SMTP id pk2mr51560263ejb.551.1621040869982; Fri, 14 May 2021 18:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621040869; cv=none; d=google.com; s=arc-20160816; b=iZ+YgTuWd8gFlDkc7Zo0pvtA83zRokq5e3B6MOj78Sj+ab+387liI2+u174yNaLphk V2Wm//slQ5ea48Yuwt+YGadI41LQsTMaA/E6nOVd1VIIm7JNmGja3Kemp0cJXrKNE/aV IOEQNa7elEcMe+1aLXrwFgS4UIAUAAP36UdnPpBt3gaJjqCVHWMgqCzRir3rHeuDsWxW DqZVOK3T/aGcxzOnEFROhD5cM4oC2kP2nhOvJL0/l3zsdDOYKIo4w04GpBzou2KlILNq 0ow6xq1bPQonCNRoR4KWlu9TUVmv9j0Eprze0nGuNmm0Nninhk2DpM+aUIQVeBoGIxcN ml3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=teigBXzxaSH8GWimHeTqKZFxu0XkPcOjPtLxwte4ggg=; b=YxU5w4RTEcBKqfZN6ylvYl1Q0AB6Li5YU5D7bzHv5AheYWhAhMrMNq1ydmYbQsRRiz iyqEzgNqGvkQVK9dMSrdOoLjg/EHSJmgIpuFwSLTDLP9zrwsn9cz5dU39FyMwj64jNjn sbxo2PJz1JXsNDnLiyxP+u/m59z1OkBOS7PJSF2ZWhR0HSBml6HY1E++NPjD2MGTYptB E5qgCiG7v5DHdNjylN06KodL8qFwhJejT597RA4UMNrH+TrqO17vIdm78v60W5uak06/ 67QBrk9AVl4dazfPCe8qpD2eiyylyTK2g76JsUONZ1kd+Q53RprWebSf8wom/B1veIcC HXpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 l3si8736688ejd.313.2021.05.14.18.07.26; Fri, 14 May 2021 18:07:49 -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; 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 S234967AbhENPml (ORCPT + 99 others); Fri, 14 May 2021 11:42:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:51466 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbhENPmk (ORCPT ); Fri, 14 May 2021 11:42:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 67574B05C; Fri, 14 May 2021 15:41:28 +0000 (UTC) Subject: Re: [PATCH v10 11/33] mm: Handle per-folio private data To: "Matthew Wilcox (Oracle)" , akpm@linux-foundation.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Jeff Layton References: <20210511214735.1836149-1-willy@infradead.org> <20210511214735.1836149-12-willy@infradead.org> From: Vlastimil Babka Message-ID: <9a748624-5f07-acf2-667a-39fc271f830d@suse.cz> Date: Fri, 14 May 2021 17:41:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210511214735.1836149-12-willy@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/11/21 11:47 PM, 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 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(). > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: Christoph Hellwig > Acked-by: Jeff Layton Acked-by: Vlastimil Babka