linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (Oracle)" <ljs@kernel.org>
To: Vernon Yang <vernon2gm@gmail.com>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	 akpm@linux-foundation.org, Wei Yang <richard.weiyang@gmail.com>,
	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 <yanglincheng@kylinos.cn>
Subject: Re: [PATCH mm-new v8 2/4] mm: khugepaged: refine scan progress number
Date: Wed, 25 Mar 2026 14:10:23 +0000	[thread overview]
Message-ID: <22dccc17-787c-448e-a571-23c7a9afeaff@lucifer.local> (raw)
In-Reply-To: <CACZaFFPfx=y5Fy+nwT8o8TA=W0QBfOvTqbJnhVPn8B95SFxijg@mail.gmail.com>

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)
> <david@kernel.org> 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


  reply	other threads:[~2026-03-25 14:10 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-21  9:39 [PATCH mm-new v8 0/4] Improve khugepaged scan logic Vernon Yang
2026-02-21  9:39 ` [PATCH mm-new v8 1/4] mm: khugepaged: add trace_mm_khugepaged_scan event Vernon Yang
2026-03-25 14:06   ` Lorenzo Stoakes (Oracle)
2026-02-21  9:39 ` [PATCH mm-new v8 2/4] mm: khugepaged: refine scan progress number Vernon Yang
2026-02-24  3:52   ` Wei Yang
2026-02-25 14:25     ` Vernon Yang
2026-02-25 14:29       ` David Hildenbrand (Arm)
2026-02-26 14:31         ` Vernon Yang
2026-02-26 15:45           ` David Hildenbrand (Arm)
2026-02-26 17:15             ` Vernon Yang
2026-03-25 14:10               ` Lorenzo Stoakes (Oracle) [this message]
2026-03-25 14:22                 ` Lorenzo Stoakes (Oracle)
2026-03-25 15:09                 ` Andrew Morton
2026-03-25 15:17                   ` David Hildenbrand (Arm)
2026-03-25 15:20                     ` Lorenzo Stoakes (Oracle)
2026-03-25 15:22                       ` David Hildenbrand (Arm)
2026-03-25 16:17                         ` Andrew Morton
2026-03-25 16:26                           ` Lorenzo Stoakes (Oracle)
2026-03-25 18:36                             ` Andrew Morton
2026-03-25 18:53                               ` Lorenzo Stoakes (Oracle)
2026-03-25 19:15                                 ` Andrew Morton
2026-03-25 20:03                                   ` Lorenzo Stoakes (Oracle)
2026-03-25 20:16                                     ` David Hildenbrand (Arm)
2026-03-25 20:49                                       ` Andrew Morton
2026-03-25 17:00                         ` Vernon Yang
2026-03-25 17:08                           ` Lorenzo Stoakes (Oracle)
2026-03-25 18:59                           ` Andrew Morton
2026-03-25 19:04                             ` Lorenzo Stoakes (Oracle)
2026-03-26  1:59                               ` Vernon Yang
2026-03-26  8:03                                 ` Lorenzo Stoakes (Oracle)
2026-02-21  9:39 ` [PATCH mm-new v8 3/4] mm: add folio_test_lazyfree helper Vernon Yang
2026-02-21  9:39 ` [PATCH mm-new v8 4/4] mm: khugepaged: skip lazy-free folios Vernon Yang
2026-02-21 10:27   ` Barry Song
2026-02-21 13:38     ` Vernon Yang
2026-02-23 13:16       ` David Hildenbrand (Arm)
2026-02-23 20:08         ` Barry Song
2026-02-24 10:10           ` David Hildenbrand (Arm)
2026-02-23 20:10       ` Barry Song
2026-02-26  7:55         ` Vernon Yang
2026-03-16 19:41           ` Andrew Morton
2026-03-17  2:16             ` Vernon Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22dccc17-787c-448e-a571-23c7a9afeaff@lucifer.local \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=richard.weiyang@gmail.com \
    --cc=vernon2gm@gmail.com \
    --cc=yanglincheng@kylinos.cn \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox