mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joonwon Kang <joonwonkang@google.com>
Cc: dennis@kernel.org, tj@kernel.org, cl@gentwo.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	dodam@google.com
Subject: Re: [PATCH v6 1/4] percpu: Fix wrong chunk hints update
Date: Mon, 18 May 2026 11:00:18 -0700	[thread overview]
Message-ID: <20260518110018.0a8e3bd0d1cd9d6dabb2d930@linux-foundation.org> (raw)
In-Reply-To: <20260513085117.1024175-1-joonwonkang@google.com>

On Wed, 13 May 2026 08:51:13 +0000 Joonwon Kang <joonwonkang@google.com> wrote:

> Chunk end offset was set to a block end offset, which could prevent
> chunk hints from being updated correctly. It was observed that the chunk
> free size gets minus or shorter than the actual free size due to this.
> This commit fixes it.
> 
> Fixes: 92c14cab4326 ("percpu: convert chunk hints to be based on pcpu_block_md")
> Signed-off-by: Joonwon Kang <joonwonkang@google.com>
> Reviewed-by: Dennis Zhou <dennis@kernel.org>

Thanks, I've updated mm.git to this version.  Hopefully we'll be
getting formal review of this soon.

It would be nice to have a formal [0/N] conver letter to introduce this
series.

Below is how v6 altered mm.git, due to alterations in [4/4]:

> v6: Diverge more when the new contig size is the same as the old
>    contig_hint size but greater than the old scan_hint, does not become a
>    new contig_hint and is before the old contig_hint.


 mm/percpu.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

--- a/mm/percpu.c~b
+++ a/mm/percpu.c
@@ -728,19 +728,18 @@ static void pcpu_block_update(struct pcp
 			block->contig_hint.start = free.start;
 		} else {
 			if (block->contig_hint.size > block->scan_hint.size) {
-				if (free.start < block->contig_hint.start) {
+				if (free.start > block->contig_hint.start) {
+					block->scan_hint = free;
+				} else if (block->scan_hint.size &&
+					   free.start < block->scan_hint.start) {
 					/*
 					 * old scan_hint.size < new contig size
 					 * == old contig_hint.size. But, the new
-					 * contig is before the old contig_hint
-					 * so hold the invariant
-					 * scan_hint.start > contig_hint.start
-					 * iff scan_hint.size ==
-					 * contig_hint.size.
+					 * contig is before the old scan_hint
+					 * so invalidate the scan_hint to
+					 * protect the contig_hint.
 					 */
 					block->scan_hint.size = 0;
-				} else {
-					block->scan_hint = free;
 				}
 			} else if (free.start > block->scan_hint.start) {
 				block->scan_hint = free;
_


      parent reply	other threads:[~2026-05-18 18:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  8:51 Joonwon Kang
2026-05-13  8:51 ` [PATCH v6 2/4] percpu: Do not trust hint starts when they are not set Joonwon Kang
2026-05-26  6:33   ` Dennis Zhou
2026-05-13  8:51 ` [PATCH v6 3/4] percpu: Introduce struct pcpu_region Joonwon Kang
2026-05-26  7:29   ` Dennis Zhou
2026-05-13  8:51 ` [PATCH v6 4/4] percpu: Fix hint invariant breakage Joonwon Kang
2026-05-26  8:15   ` Dennis Zhou
2026-05-18 18:00 ` Andrew Morton [this message]

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=20260518110018.0a8e3bd0d1cd9d6dabb2d930@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=dennis@kernel.org \
    --cc=dodam@google.com \
    --cc=joonwonkang@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®