From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBB7F3CF66B for ; Wed, 25 Mar 2026 14:10:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774447826; cv=none; b=pTqiJwZbC6YwoaJnFtSjlZaJysNwPPmpwU+UA7IWkgLAxd2MVwEBIBuSc3s7uPZn98Rk2IrWprZQqR5DTu/b+pdcu6m88lNni3N8cHXwJ5FILZQ0qhDjhA8LF9TZ4K82gijEpKhQzV18mIpJzlkJOL+ZJ45Yd9+T24RL5pLtH3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774447826; c=relaxed/simple; bh=j+9XRVrfFaG+hzCjGNEprbRdCLP8evJg2yIG9r3fY9k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Nt1lJjKduf5i94wEb0xRjVVbs+/EmUwa4IuSzsCCAS+DkmAZfYy9iw4+DUToQ3ODTPU4OJ1Sm7pbY+lAlq6/uJOXewDtd7Rr/YZB8o2hpzJdqNGRwleHEZU5c36CRMvzrfbaxnfqcwjglQaIsPzGyIwtEM5uajj3TuYrjqFv4GQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CcF/cFqA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CcF/cFqA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7C2CC4CEF7; Wed, 25 Mar 2026 14:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774447826; bh=j+9XRVrfFaG+hzCjGNEprbRdCLP8evJg2yIG9r3fY9k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CcF/cFqARf0VuUhI7Y/Pt9slkoRqLx674TxnSdmyHU/puzVrbNwnd3VXHJgeUa9W6 419nMt72rDHPd5p7sN1FkWntwtoHPMuFe5879CchUb3356LArWQPPU1HHywl/oIT6m NFvrmCv71j0R4VtxhZ5scVhEvD39MMx8U4gadelKRQdKHzBVLjjaX609KhW6vBiKa9 oKeYAxpU00syBdrNlI4hmPAXFUKbOftolNHzF7rTzWQ/wr1yo8qj5oefDFRyNOfGnE nzctTlDEXeE6bvAL+hqqJfE2SF2obHRaKUv/QTnULqqhNiLmfN6fsrZ0ls1JMezJLl xNHWza5UwVNIg== Date: Wed, 25 Mar 2026 14:10:23 +0000 From: "Lorenzo Stoakes (Oracle)" To: Vernon Yang Cc: "David Hildenbrand (Arm)" , akpm@linux-foundation.org, Wei Yang , lorenzo.stoakes@oracle.com, ziy@nvidia.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vernon Yang Subject: Re: [PATCH mm-new v8 2/4] mm: khugepaged: refine scan progress number Message-ID: <22dccc17-787c-448e-a571-23c7a9afeaff@lucifer.local> References: <20260221093918.1456187-1-vernon2gm@gmail.com> <20260221093918.1456187-3-vernon2gm@gmail.com> <20260224035247.r6mxsfcpiev4wnce@master> <1da56bbb-9211-42d7-9b08-3ee56d2b538d@kernel.org> <8a5277e0-d70e-4849-9763-ed90e350a118@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Feb 27, 2026 at 01:15:24AM +0800, Vernon Yang wrote: > On Thu, Feb 26, 2026 at 11:45 PM David Hildenbrand (Arm) > wrote: > > > > On 2/26/26 15:31, Vernon Yang wrote: > > > On Wed, Feb 25, 2026 at 03:29:05PM +0100, David Hildenbrand (Arm) wrote: > > >> On 2/25/26 15:25, Vernon Yang wrote: > > >>> > > >>> Thank you for suggestion. > > >>> > > >>> Placing it inside "struct collapse_control" makes the overall code > > >>> simpler, there also coincidentally has a 4-bytes hole, as shown below: > > >>> > > >>> struct collapse_control { > > >>> bool is_khugepaged; /* 0 1 */ > > >>> > > >>> /* XXX 3 bytes hole, try to pack */ > > >>> > > >>> u32 node_load[64]; /* 4 256 */ > > >>> > > >>> /* XXX 4 bytes hole, try to pack */ > > >>> > > >>> /* --- cacheline 4 boundary (256 bytes) was 8 bytes ago --- */ > > >>> nodemask_t alloc_nmask; /* 264 8 */ > > >>> > > >>> /* size: 272, cachelines: 5, members: 3 */ > > >>> /* sum members: 265, holes: 2, sum holes: 7 */ > > >>> /* last cacheline: 16 bytes */ > > >>> }; > > >>> > > >>> But regardless of khugepaged or madvise(MADV_COLLAPSE), "cur_progress" > > >>> will be counted, while madvise(MADV_COLLAPSE) actually does not need to > > >>> be counted. > > >>> > > >>> David, do we want to place "cur_progress" inside the "struct collapse_control"? > > >> > > >> Might end up looking nicer code-wise. But the reset semantics (within a > > >> pmd) are a bit weird. > > >> > > >>> If Yes, it would be better to rename "cur_progress" to "pmd_progress", > > >>> as show below: > > >>> > > >> > > >> "pmd_progress" is misleading. "progress_in_pmd" might be clearer. > > >> > > >> Play with it to see if it looks better :) > > > > > > Hi Andrew, David, > > > > > > Based on previous discussions [1], v2 as follow, and testing shows the > > > same performance benefits. Just make code cleaner, no function changes. > > > > > > If David has no further revisions, Andrew, could you please squash the > > > following clean into this patch? If you prefer a new version, please let > > > me know. Thanks. > > > > Do we also have to update the resulting patch description? Patch itself > > LGTM. > > No need to update the patch description. I will take a look at this (sorry for delay) but general point - while fix-patches are convenient, they're incredibly anti-reviewer. I hope at some point in the future we can move away from that so you can look at a series on list and know that what's shown there is the actual patch. As it stands, I can't go line-by-line correctly here without quite a bit of additional effort. (Not a criticism of you Vernon just a general point about mm process). > > -- > Cheers, > Vernon Thanks, Lorenzo