lkml.org 
[lkml]   [2014]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Do we really need curr_target in signal_struct ?
On 01/29, Rakib Mullick wrote:
>
> On Tue, Jan 28, 2014 at 10:43 PM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> > But I guess ->curr_target was added exactly to avoid this loop if
> > possible, assuming that wants_signal(->current_targer) should be
> > likely true. Although perhaps this optimization is too simple.
> >
> Well, this code block will only hit when first check for wants_signal()
> will miss,

Yes,

> that means we need to find some other thread of the group.

Yes,

> AFAIU, ->current_target is only a loop breaker to avoid infinite loop,

No. It caches the last result of "find a thread which can handle this
group-wide signal".

> but - by using while_each_thread() we can remove it completely, thus
> helps to get rid from maintaining it too.

... and remove the optimization above.

> I'll prepare a proper patch with you suggestions for reviewing.

I am not sure we want this patch. Once again, I do not know how much
->curr_target helps, and certainaly it can't help always. But you
should not blindly remove it just because yes, sure, it is not strictly
needed to find a wants_signal() thread.

Oleg.



\
 
 \ /
  Last update: 2014-01-29 16:21    [W:0.071 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site