Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp31274pxf; Wed, 17 Mar 2021 14:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9V3gW7jgIX0iXcqU0c733ySpUWd0aqrldnXj0lg2K63XrJSQ1qx97wHZm2tZFbKFVmucK X-Received: by 2002:a17:906:86c6:: with SMTP id j6mr36253088ejy.197.1616016559762; Wed, 17 Mar 2021 14:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616016559; cv=none; d=google.com; s=arc-20160816; b=GZjOpTU/Mgp4Cjer5jAQ3nxnKLnWojaUwK4Vp+MOxA9OQH14/vnk9fqnpcHXIa8CZm YJfGGhBLVraemaA8aaNqqS2xMX5LJTp6Fwj9qN66bFx4c7g0uf2hxVp5j6AwqOiLesAc J70nkCeMpXSCPJOng/gKYBDVUxRnYQ5xVbCscaMZyopnAuFqKTHgmpfLXf6WxHBEQJ9o GC/79b4SCBBj0VyRjH+UJz6vTvPj13Opw7cXomnvWybWZUOHGeHX2K1B5HZQ7fb7SJhm wv9uXysy03/GMoNPobWmFk1F4eaG8VMBi1UUiiF81i1AqMH4fdraLL3JTq2oTz72ZpQh aIhg== 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=aZBesko0L2dLYUae48wU74XHUup8GCRSf+aPZedgtJk=; b=LdPsH4CJySRyywxNsedMX90jfVSLuC/r8Jxz7GE784wL5nj4On3dx4MOs8diypk7T2 6uHTUqanLTF9/y1OHvqpgL8Wz1YG0JXFswzmUsIGEmZEXjAdnn7mHy+fOve9iG3/9Qyl bSWzWtVBqT3yvBxqVNofJXQrTmw3i1jRF/9v1luM89ob5XH3JR+DqS9Q8gPJeXwAbcNj 73OP5t/ri8Pi7nESyirHcybZ+gtRMsiCii0aJNnOQQib2ZPhrJibUVgJn5zkbS+C52A4 Sj+RBCOkajgtz2OWiIF/p2Ge4XPdBQLaAqnNMDWi4MbKnOAIxFRkFrXB61/2yGhW+eoN YQiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IZYkq1Td; 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 cf6si35357ejb.272.2021.03.17.14.28.57; Wed, 17 Mar 2021 14:29:19 -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=@infradead.org header.s=casper.20170209 header.b=IZYkq1Td; 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 S232412AbhCQRWB (ORCPT + 99 others); Wed, 17 Mar 2021 13:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232659AbhCQRVE (ORCPT ); Wed, 17 Mar 2021 13:21:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79337C06174A; Wed, 17 Mar 2021 10:21:04 -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=aZBesko0L2dLYUae48wU74XHUup8GCRSf+aPZedgtJk=; b=IZYkq1TdY42T5Bvl3xE61WR1SD GR/5U8EhQJTK9y20f3Nwg9B2QuYK7L0tcrs9PxoX4LcxNZz+fRJTIWLa4rcZsuUELYSDn259br6n+ CHJ1FKtSWoyS259HNed9Gb9n9UQ1oOiKl96pKmk7A7q9ra85oQp8KWSfwdaoo8DIHuytLYly70HOo 7FUxC/uxz/UIGb0EGvFEyZlrgDk08rZaQM0/D0b6s5uHIRxEeVuT4kV/tlNkpMC4VN+Owd94Etfqs kbtcWRqpe1kighYOS7UXtbnzh21ZW7EJKaX3ARH8sCJxYRtU0ys7WIIh5BuCa6Pj1tdSxY5/tQ9DD EPXDQkYQ==; Received: from [2001:4bb8:18c:bb3:e3eb:4a4b:ba2f:224b] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lMZqT-001u9b-2R; Wed, 17 Mar 2021 17:20:46 +0000 Date: Wed, 17 Mar 2021 18:20:32 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 08/25] mm: Handle per-folio private data Message-ID: References: <20210305041901.2396498-1-willy@infradead.org> <20210305041901.2396498-9-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210305041901.2396498-9-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 > +static inline void attach_page_private(struct page *page, void *data) > +{ > + attach_folio_private((struct folio *)page, data); > +} > + > +static inline void *detach_page_private(struct page *page) > +{ > + return detach_folio_private((struct folio *)page); > +} I hate these open code casts. Can't we have a single central page_to_folio helper, which could also grow a debug check (maybe under a new config option) to check that it really is called on a head page?