[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230128201520.GB14906@redhat.com>
Date: Sat, 28 Jan 2023 21:15:22 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Marco Elver <elver@...gle.com>, linux-kernel@...r.kernel.org,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Frederic Weisbecker <frederic@...nel.org>
Subject: Re: [PATCH v4] posix-timers: Prefer delivery of signals to the
current thread
Forgot to mention ...
On 01/28, Oleg Nesterov wrote:
>
> Dmitry,
>
> I agree with what you said, just one note...
>
> On 01/27, Dmitry Vyukov wrote:
> >
> > After this change the test passes quickly (within a second for me).
>
> yet perhaps it makes sense to slightly change it? It does
>
> +static void *distribution_thr(void *arg) {
> + while (__atomic_load_n(&remain, __ATOMIC_RELAXED));
> + return NULL;
> +}
>
> so distribution_thr() eats CPU even after this thread gets a signal and thus
> (in theory) it can "steal" cpu_timer_fire() from other threads unpredictably
> long ? How about
>
> - while (__atomic_load_n(&remain, __ATOMIC_RELAXED));
> + while (__atomic_load_n(&got_signal, __ATOMIC_RELAXED));
>
> ?
Of course, in this case it also makes sense to change the main() function the
same way and add BUG_ON(remain) after the "for (...) pthread_join()" block.
Oleg.
Powered by blists - more mailing lists