From patchwork Wed Jan 11 14:29:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13096773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40AFAC54EBC for ; Wed, 11 Jan 2023 14:29:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E17190000D; Wed, 11 Jan 2023 09:29:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 425B490000B; Wed, 11 Jan 2023 09:29:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8435F940009; Wed, 11 Jan 2023 09:29:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0DA0990000B for ; Wed, 11 Jan 2023 09:29:11 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CCAC2AB31E for ; Wed, 11 Jan 2023 14:29:10 +0000 (UTC) X-FDA: 80342750460.11.1826AE2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 301D12000F for ; Wed, 11 Jan 2023 14:29:08 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FI5tQYBA; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673447349; a=rsa-sha256; cv=none; b=aoSEIwL0+eGcbC34jfx/tdf2fuck0ns+yTJ6TR49YO646UUlIFJVofT/IdyY3wtLYMgKCF HRptprS90KiCkLFtJm+9RowRjYEzhZaMgvY0KuZp+7SDjDbx7o8qFNjflCIr7/dFFDp1bA EzOCzyep0NM3Z0xdLrvuj0HPL8dgTYY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FI5tQYBA; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673447349; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GoCqV7MoGixzU//QTHO85uusqFb3KGVK6jprnb5YbpM=; b=HcPLwCu1aW/B0cKLRcX4YedBY5/efWsNoMQ5KM5dCPQATUlr8+CSUHfLTVjcpGJ76M+biU Rcs1Ql11OrLImQdjbM5M1oyUg4TMgQUqyLgnGPU+XL6aa9VBAKjui26SovTbRvL1ZVQGJI kqOs9R6LF4qdmGqIJ0oqkBeYxGKQrVY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=GoCqV7MoGixzU//QTHO85uusqFb3KGVK6jprnb5YbpM=; b=FI5tQYBADyTXIX4FF+uS3ooESH fMDFopapyTDJ1/EK1ndUay2aHpvA7H1u38h3dv+B+4AMgcjoWL8F25kOAquIxhxmpOyuEKkZPrRlI wpYqfOFMbbY+ukk/9+Yjt4D7fFNTYGBfyonGmMLch/VomnWdDpbmiA1J7C/I3Fs+3hz67uGuf39KL 7X6zS9tqp974xpGGcvfZ5fD2phaJzCSTaEEGNkfWjOjvIR+qIwtt0qNBwBIiD58H7EJJPMioDNnHa ZWDUzHKG5bM575V3AtbeaFNCO4DA6zr3jQCr9hgGz8wZdhHP/7qUJpSuFLvo1IEdQ/bUouuPkvU0k OX7XfGgA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFc6R-004CZg-1r; Wed, 11 Jan 2023 14:29:19 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Hugh Dickins Subject: [PATCH 18/28] mm: Convert set_compound_page_dtor() and set_compound_order() to folios Date: Wed, 11 Jan 2023 14:29:04 +0000 Message-Id: <20230111142915.1001531-19-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230111142915.1001531-1-willy@infradead.org> References: <20230111142915.1001531-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 301D12000F X-Rspamd-Server: rspam01 X-Stat-Signature: gz9ygdfnyju7jq684ieko8uo6uds6m3n X-HE-Tag: 1673447348-165119 X-HE-Meta: U2FsdGVkX18FB+uNIhDQGQnSxL+WmLMGLkhyAStTkCZDGSGBuc0qVz987YU5H2Y0X0BDI0xxPMBqD2EPMLsJS5ygiqQ4689mFVygJlz3XwDe1SeRXrmtX9E8SMKlju9LaGLL1XJkcP4LgJzwh5OwqNjTd+oVezZM3XmNQVy9RotqbVUcfcAG55PRtCIyRJ7B0a2cdUkfRSECYnTIoHuPV+7wWfvla2SeuMTNvaoo95Qe8jDdzk6OFVPqVVUXvPa2al5pPHPKr1mLsNdfvrPM/E4luNdLkt/Ev8vbYwrMY3U/xknO1huWbSOsi0lsUsDnYHQikURjfzc9Cdmea6SYT1CNegwnYtmZKBjsramLfYSh93zcx4cjmSmdYvtG+cWBiG6m0Lh9THRoF4/m23+qLx/YUreDuVyyfQPwSksTKE5DBrNC8ADGue80uJ1jN8vEXSOQW1FZFD+HxugkwaSbLwVwjnsOcwb21CKsCacgjOXsEfgSfaI2felCTz2za8fYn0ylRQcED4rKdzf7cIT7r/ZiokzkZULzN8xw2N5Vjk0IwPOhDsd0p6M2qSLRdOQFiXI6l1u5MHNcoCdb/Fgg5imrvpQBmCipTfBYOiWo5ViJ+k0pgBzgsuU3p+EJ/KCyVnMuETSzeTQSo8/avOYYcgkjr1Midkb4vbFWRZNL3qC7XFX+pDldClvZ1Wf8sVDztkka8wZWMXKR5MBlEQlyzlFixFcIBiftkoIWn7RZXNv1KckWm+Qy9dYtgAMWQBxZX97rN/ASi5EopFX2DSuhLqM81nJa95xKLUXHV0Sv4biIKWgPd5I9UmvTkT9WvLwaq8Vcsd8XE629oxbcDSzYDU0ISI2EvwQit9kEjdnLxBjQNu5TnEDohXR+aiQhpG4nfcUVoUnCeDnTWKNMMFeHaMXoTnnWdIGD/jc2Fmi57pWkMSftHmeFyA== 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: Replace uses of compound_dtor, compound_order and compound_nr by their folio equivalents. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0b1cdaf0fa90..57d702fc8677 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -984,8 +984,11 @@ extern compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS]; static inline void set_compound_page_dtor(struct page *page, enum compound_dtor_id compound_dtor) { + struct folio *folio = (struct folio *)page; + VM_BUG_ON_PAGE(compound_dtor >= NR_COMPOUND_DTORS, page); - page[1].compound_dtor = compound_dtor; + VM_BUG_ON_PAGE(!PageHead(page), page); + folio->_folio_dtor = compound_dtor; } static inline void folio_set_compound_dtor(struct folio *folio, @@ -999,9 +1002,11 @@ void destroy_large_folio(struct folio *folio); static inline void set_compound_order(struct page *page, unsigned int order) { - page[1].compound_order = order; + struct folio *folio = (struct folio *)page; + + folio->_folio_order = order; #ifdef CONFIG_64BIT - page[1].compound_nr = 1U << order; + folio->_folio_nr_pages = 1U << order; #endif }