All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: chrisl@kernel.org
Cc: stable@vger.kernel.org, Muchun Song <muchun.song@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	Yu Zhao <yuzhao@google.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Kent Overstreet <kent.overstreet@linux.dev>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH 6.11.y 2/3] mm/codetag: fix pgalloc_tag_split()
Date: Fri, 18 Oct 2024 10:29:21 +0200	[thread overview]
Message-ID: <2024101850-dwarf-payday-8d15@gregkh> (raw)
In-Reply-To: <20241017-stable-yuzhao-v1-2-3a4566660d44@kernel.org>

On Thu, Oct 17, 2024 at 02:58:03PM -0700, chrisl@kernel.org wrote:
> From: Yu Zhao <yuzhao@google.com>
> 
> [ Upstream commit 95599ef684d01136a8b77c16a7c853496786e173 ]
> 
> The current assumption is that a large folio can only be split into
> order-0 folios.  That is not the case for hugeTLB demotion, nor for THP
> split: see commit c010d47f107f ("mm: thp: split huge page to any lower
> order pages").
> 
> When a large folio is split into ones of a lower non-zero order, only the
> new head pages should be tagged.  Tagging tail pages can cause imbalanced
> "calls" counters, since only head pages are untagged by pgalloc_tag_sub()
> and the "calls" counts on tail pages are leaked, e.g.,
> 
>   # echo 2048kB >/sys/kernel/mm/hugepages/hugepages-1048576kB/demote_size
>   # echo 700 >/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
>   # time echo 700 >/sys/kernel/mm/hugepages/hugepages-1048576kB/demote
>   # echo 0 >/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
>   # grep alloc_gigantic_folio /proc/allocinfo
> 
> Before this patch:
>   0  549427200  mm/hugetlb.c:1549 func:alloc_gigantic_folio
> 
>   real  0m2.057s
>   user  0m0.000s
>   sys   0m2.051s
> 
> After this patch:
>   0          0  mm/hugetlb.c:1549 func:alloc_gigantic_folio
> 
>   real  0m1.711s
>   user  0m0.000s
>   sys   0m1.704s
> 
> Not tagging tail pages also improves the splitting time, e.g., by about
> 15% when demoting 1GB hugeTLB folios to 2MB ones, as shown above.
> 
> Link: https://lkml.kernel.org/r/20240906042108.1150526-2-yuzhao@google.com
> Fixes: be25d1d4e822 ("mm: create new codetag references during page splitting")
> Signed-off-by: Yu Zhao <yuzhao@google.com>
> Acked-by: Suren Baghdasaryan <surenb@google.com>
> Cc: Kent Overstreet <kent.overstreet@linux.dev>
> Cc: Muchun Song <muchun.song@linux.dev>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

You did not sign off on this backport, so even if I wanted to take it, I
couldn't :(

Please fix this, and patch 3/3 up, and just send those.

sorry,

greg k-h

  reply	other threads:[~2024-10-18  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 21:58 [PATCH 6.11.y 0/3] : Yu Zhao's memory fix backport chrisl
2024-10-17 21:58 ` [PATCH 6.11.y 1/3] mm/hugetlb_vmemmap: don't synchronize_rcu() without HVO chrisl
2024-10-17 21:58 ` [PATCH 6.11.y 2/3] mm/codetag: fix pgalloc_tag_split() chrisl
2024-10-18  8:29   ` Greg KH [this message]
2024-10-18 17:15     ` Chris Li
2024-10-17 21:58 ` [PATCH 6.11.y 3/3] mm/codetag: add pgalloc_tag_copy() chrisl
2024-10-18  5:58 ` [PATCH 6.11.y 0/3] : Yu Zhao's memory fix backport Greg KH
2024-10-18  6:39   ` Kent Overstreet
2024-10-18  8:18   ` Vlastimil Babka
2024-10-18  8:30     ` Greg KH

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=2024101850-dwarf-payday-8d15@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=kent.overstreet@linux.dev \
    --cc=muchun.song@linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=yuzhao@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.