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 E8BB9332604 for ; Mon, 18 May 2026 18:00:19 +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=1779127220; cv=none; b=Z0RkdFHxJpZJPrDD23S48KHbdfU424Q/TqbhSAqhNd1H4wjG+9NlpFFHXJ7NlL1uThZsROwNTzr4Si4VCXQCiIMBsCGtm97s/HsvLmruPHtjDivd6/7YDeTffDtj/YseoA8zZvUGHXM4eLns6zO9Hi2ai7k6FZBhd2WZ8MyiJFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779127220; c=relaxed/simple; bh=qALU1Adzrm+5c8y1mhuY4iAZnHBYio0v+wam27atlrY=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=oG4wT8JDFa4+vQ2DXi0KBvhcVzknTyU+x8Ey7CbPondIknUC91uVP5TRzGZd20o6ZnR1br9KuLNcxINNW4qM2f0OaCxathWhbELw4CPsgya8epzLNMuhIlH8u7yRAUTW1J41ad9lrkPLrQyY/Jjuz8+qvNQ0sN1tJ3neit21MUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=dAceMUW9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="dAceMUW9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EC26C2BCB7; Mon, 18 May 2026 18:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1779127219; bh=qALU1Adzrm+5c8y1mhuY4iAZnHBYio0v+wam27atlrY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dAceMUW9snIfEaXg5i1uRHTLkBzioKubsHCs8bzXpEDPba8/Nv7zbEPFgiln25N5n KfDEWbqMH074b6usyrMEvq/AKRETCI4/1YqGYKR1uXBEqWUMeoslPHqhwlOCPhAoVH DWz7AqFr/9LD4IfoN47qQzTNTqRQYDjw6Ylzi/vQ= Date: Mon, 18 May 2026 11:00:18 -0700 From: Andrew Morton To: Joonwon Kang 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 Message-Id: <20260518110018.0a8e3bd0d1cd9d6dabb2d930@linux-foundation.org> In-Reply-To: <20260513085117.1024175-1-joonwonkang@google.com> References: <20260513085117.1024175-1-joonwonkang@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 13 May 2026 08:51:13 +0000 Joonwon Kang 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 > Reviewed-by: Dennis Zhou 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; _