lkml.org 
[lkml]   [2023]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] posix-timers: Prefer delivery of signals to the current thread
On 01/30, Dmitry Vyukov wrote:
>
> On Sat, 28 Jan 2023 at 20:56, Oleg Nesterov <oleg@redhat.com> 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));
> > ?
>
> But why?
> IIUC this makes the test even "weaker". As Thomas notes it's already
> somewhat "weak". And this would make it even "weaker".

Not sure I understand why can this change make the test more weak...

IIUC, _in theory_ the test-case can "hang" forever, since all threads
are running nothing guarentees that every thread will have a chance to
call cpu_timer_fire() and get a signal.

With this change this is not possible, and the test-case will still
verify that all threads must get a signal.

Nevermind,

> So if it passes
> in the current version, I would keep it as is.

OK, I won't insist, please forget.

Oleg.

\
 
 \ /
  Last update: 2023-03-27 00:02    [W:0.090 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site