linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: igor.b@beldev.am
Cc: Harry Yoo <harry.yoo@oracle.com>,
	Vitaly Wool <vitaly.wool@konsulko.se>,
	Vlastimil Babka <vbabka@suse.cz>,
	Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mempool: fix the race condition in mempool_resize()
Date: Wed, 4 Mar 2026 13:20:44 -0800	[thread overview]
Message-ID: <20260304132044.a6fffc26f6bcd119771944ca@linux-foundation.org> (raw)
In-Reply-To: <98e1c65fec7c47e1ff77ac33d5604ef6@beldev.am>

On Wed, 04 Mar 2026 19:20:30 +0400 igor.b@beldev.am wrote:

> > I think pool->lock should prevent the bug you described from happening
> > and I don't think using xchg() is necessary when updating fields
> > protected by a spinlock.
> 
> Can you please explain how pool->lock protects pool->elements in e.g. 
> remove_element() function?

afaict all callers of add_element() and remove_element() hold
pool->lock.  mempool_exit() doesn't but presumably there are no
concurrent accessers at this time.

So yes, perhaps a more complete problem description is needed here.



      reply	other threads:[~2026-03-04 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 13:12 Vitaly Wool
2026-03-04 13:31 ` Harry Yoo
2026-03-04 15:20   ` igor.b
2026-03-04 21:20     ` 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=20260304132044.a6fffc26f6bcd119771944ca@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=harry.yoo@oracle.com \
    --cc=igor.b@beldev.am \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    --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