[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241217145814.euTL-GEf@linutronix.de>
Date: Tue, 17 Dec 2024 15:58:14 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: linux-kernel@...r.kernel.org
Cc: André Almeida <andrealmeid@...lia.com>,
Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v5 09/14] futex: Allow to re-allocate the private hash
bucket.
On 2024-12-16 00:00:13 [+0100], To linux-kernel@...r.kernel.org wrote:
> @@ -154,6 +303,17 @@ struct futex_hash_bucket *futex_hash(union futex_key *key)
>
> void futex_hash_put(struct futex_hash_bucket *hb)
> {
> + struct futex_hash_bucket_private *hb_p;
> +
> + if (hb->hb_slot == 0)
> + return;
> + hb_p = container_of(hb, struct futex_hash_bucket_private,
> + queues[hb->hb_slot - 1]);
> +
> + if (!rcuref_put(&hb_p->users))
> + return;
> +
> + futex_assign_new_hb(NULL);
I have reworked two things:
- I have to remove futex_assign_new_hb() here and let the next
rcuref_get() perform the assignment instead. The reason is that the
caller can change its task state (futex_wait_queue()) and blocking on
the mutex will reset it. Instead of delaying it after the schedule()
it looks simpler to delay it to the next rcuref_get() where it has to
be handled anyway.
- The logic in __futex_assign_new_hb() didn't deal properly with delayed
assigns.
> }
Sebastian
Powered by blists - more mailing lists