Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Vitaly Wool <vitaly.wool@konsulko.se>, Harry Yoo <harry@kernel.org>
Cc: akpm@linux-foundation.org, cl@gentwo.org, hao.li@linux.dev,
	hch@lst.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	nickolai@csail.mit.edu, rientjes@google.com,
	roman.gushchin@linux.dev, vitaly.vul@partner.samsung.com
Subject: Re: [PATCH v1] mempool: fix min_nr exceeding the elements array after concurrent resizes
Date: Tue, 20 Oct 2026 10:27:07 +0200	[thread overview]
Message-ID: <3a034d40-e01d-42cf-9325-8c1e4a6db1b9@kernel.org> (raw)
In-Reply-To: <F846CE95-6D2A-4D53-9C09-5C8630E2C8A7@konsulko.se>

On 10/19/26 08:45, Vitaly Wool wrote:
> 
> 
>> On Oct 18, 2026, at 6:15 PM, Harry Yoo <harry@kernel.org> wrote:
>> 
>> On Sun, Oct 18, 2026 at 06:03:15PM +0200, Vitaly Wool wrote:
>>>>> How about we take my patch [1] instead since
>>>>> it isn't prone to this bug and is a nice optimization to the existing
>>>>> mempool_resize() at the same time?
>>>> 
>>>> It is not a good idea to squeeze a bug fix and an optimization
>>>> into one patch.
>>> 
>>> Generally speaking, yes. But that patch had been submitted before the fix
>>> popped up, so there was no sqeezing per se.
>> 
>> I mean the patch you've submitted does two things (wihch is not good).
>> 
>> It should be split into two patches that 1) fixes the bug and 2)
>> optimizes it.
> 
> I don’t think this is a fair statement. I would say that the patch I’ve
> submitted improves mempool_resize() to be rid of unnecessary
> reallocations and data copying, and that (improved) implementation is
> *not* prone to the race found in the previous version of this function.

But it makes the code more complex:

 2 files changed, 28 insertions(+), 16 deletions(-)

without an in-tree use case.

> ~Vitaly



  parent reply	other threads:[~2026-10-20  8:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 13:25 [PATCH v1] mempool: fix min_nr exceeding the elements array after concurrent resizes Nickolai Zeldovich
2026-10-16 15:46 ` Harry Yoo
2026-10-16 16:33   ` Nickolai Zeldovich
2026-10-18 15:01   ` Vitaly Wool
2026-10-18 15:15     ` Harry Yoo
2026-10-18 16:03       ` Vitaly Wool
2026-10-18 16:15         ` Harry Yoo
2026-10-19  6:45           ` Vitaly Wool
2026-10-19 13:27             ` Harry Yoo
2026-10-20  8:27             ` Vlastimil Babka (SUSE) [this message]
2026-10-20 10:50               ` Vitaly Wool
2026-10-20 10:57                 ` Harry Yoo
2026-10-20  8:42   ` Vlastimil Babka (SUSE)

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=3a034d40-e01d-42cf-9325-8c1e4a6db1b9@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=harry@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nickolai@csail.mit.edu \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vitaly.vul@partner.samsung.com \
    --cc=vitaly.wool@konsulko.se \
    /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