From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D35EC606A320 for ; Thu, 19 Nov 2026 08:00:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VzGWi9uR Received: by kanga.kvack.org (Postfix) id E31F56B05BB; Thu, 19 Nov 2026 03:00:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E08F96B05BC; Thu, 19 Nov 2026 03:00:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D45E56B05BD; Thu, 19 Nov 2026 03:00:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B51BF6B05BB for ; Thu, 19 Nov 2026 03:00:32 -0500 (EST) Received: from smtpin27.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 502B91C4409 for ; Thu, 19 Nov 2026 08:00:32 +0000 (UTC) X-FDA: 85451121504.27.BE20CC7 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf05.hostedemail.com (Postfix) with ESMTP id B2E0E10000E for ; Thu, 19 Nov 2026 08:00:30 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=VzGWi9uR; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of rppt@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1795075230; b=R+EX1GaiAt7e1IrydG8eiw1VDh4qXhg/cu0ZY7UJ2Xr4Ei+k3bGFpsatlwrYIVXfjiiMYn U03ev3VKPCF3RwP3rnFkDD3tZYyoDRYYMMvrIHJrz3J8qBHPzyZFObOUN3FGK/ZJVr1ymJ KZoUix41iUt+bzyaTlLapAagqXShQ14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1795075230; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yhKTd9PFQglELBRtpTYu4W3W99Gioeh3CPcw8i00DlQ=; b=wrZM+lbS8kzd9pv5VdMGTjW0mOiZrOdIrQaW3y23wuMDgGC8rd8959mqY1+CTjk7PPwjAj Rrg+h9pbvNScwgD6hVQfp4ldGdxTdTBV5Q9D8Ys0DDmbB+aGWQ+AMjk69t7LJUECaZYpAU 0QS/u2HuxhYcitrW5GA30FcB/Tb1Ck8= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=VzGWi9uR; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of rppt@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=rppt@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 43A6561D0B; Thu, 19 Nov 2026 08:00:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF05E1F000C7; Thu, 19 Nov 2026 08:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795075230; bh=yhKTd9PFQglELBRtpTYu4W3W99Gioeh3CPcw8i00DlQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=VzGWi9uROMYGTkKOazYsmKlhMzNc5nhXpnMk8mDh68gKBL3B+x0fn8IT2VwmfH1Ef rudOl0YdIbdAx9WxJt28qSgYc293YBRFbc8Reex7r49nSl3Ob3DnWeNsWSZz9zM/D4 J+N6xHljw23oX/WnkCWcYVCe5dhPBUi3zbmc1vHWKeBpAAkzh8HIDjfPgwsxdcGmzn kd+9Pl6pkdZO9vLBWRqZH1YamDRZywlSVUnyqLLZt5beZMAkw1dBfs1s5W1DV9ew1S 1zkx7BsNMPKEbu555/1Agg6ojWE7+gWcjaFLSgz9qRIjqB/d4ixApDFDjVAYb0CPxO Cd+MDnFgeZyyg== Date: Thu, 19 Nov 2026 10:00:17 +0200 From: Mike Rapoport To: Muchun Song Cc: Alexander Potapenko , Andrew Morton , Marco Elver , Dmitry Vyukov , Chris Down , David Hildenbrand , "Liam R . Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Johannes Weiner , Brendan Jackman , Zi Yan , Muchun Song , Joerg Roedel , Lu Baolu , Pranjal Shrivastava , Ketan , Mostafa Saleh , Sang-Heon Jeon , Jonathan Corbet , Shuah Khan , Randy Dunlap , Sashiko , kasan-dev@googlegroups.com, workflows@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 2/7] mm/page_ext: fix client data alignment Message-ID: References: <20261119065812.89959-1-songmuchun@bytedance.com> <20261119065812.89959-3-songmuchun@bytedance.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261119065812.89959-3-songmuchun@bytedance.com> X-Rspam-User: X-Rspamd-Server: rspam07 X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Rspamd-Queue-Id: B2E0E10000E X-Stat-Signature: cpfj1htondsd488erbbscah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58eBhCxQ2IQNlMUnl7hLvM4LbxeHfl/K3dvEArXGEdRL1PvCEp9VdyfSpRSCNuZuGZZPLZBsCSawfxve3wNchZrVWBr6I4Z5h8Kay1/pyetdOs4MlqagLsbqOvNZ652z0FgIakSes7o0v6ATx3LyvMLi2+A1LKWwcWuoq3QVYzEOtyEYwfJCtVhtK2+OzYWxhGLRbIGQ9XUuMe3bOWuZZII3YE6OSFK4spUGJ+PXCNVPhXK2uCU1E4snzep2QDpSSTn7hDBrfG9wVOAmcwF90pDe7AR/TjR66TYIOzGDfqL+0rpOy3nTtMj2YlVmtpuNjsSRQ+5LoH8MB6KRG5thF1kW4d8AcYkcvjlj/2O8FwrUpVGWa0xg2oVVdhwEm8/AHVQe9QGfQzlAeUEJac9+4g/qNbmyJI2Wbt8TGGgnxSu0ZKmM+jMB8oWrH5wgVaNznpg== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, Nov 19, 2026 at 02:58:07PM +0800, Muchun Song wrote: > page_ext lays out client payloads consecutively without aligning their > offsets or the final entry size. This happened to work while the active > payload sizes kept the stride naturally aligned, but IOMMU debug page > allocation added a four-byte payload after data requiring eight-byte > alignment. > > When page owner and IOMMU debug page allocation are both enabled on > x86-64, struct page_ext, struct page_owner, and the IOMMU payload use > 8, 64, and 4 bytes respectively. This produces a 76-byte entry stride, > leaving struct page_ext and page_owner data in every other entry only > four-byte aligned instead of eight-byte aligned. > > Align each client offset and round the final entry size to the largest > active alignment so every page_ext entry preserves the alignment > required by all active clients. > > Fixes: 466ae6978a5b ("iommu: Add page_ext for IOMMU_DEBUG_PAGEALLOC") > Signed-off-by: Muchun Song > Reviewed-by: Chris Down > Tested-by: Chris Down Reviewed-by: Mike Rapoport (Microsoft) > --- > v3: > - Cap client alignment at u64 alignment to preserve 64-bit alignment on > 32-bit architectures (reported by Sashiko) > - Open-code the lowest power-of-two factor for readability (suggested by > Andrew Morton) > - Use a local for the u64 alignment (suggested by Mike Rapoport) > - Simplify the commit message to focus on the alignment guarantee > - Collect Reviewed-by and Tested-by from Chris Down > > v2: > - New patch to fix the existing page_ext client alignment bug > --- > mm/page_ext.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) -- Sincerely yours, Mike.