lkml.org 
[lkml]   [2008]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] account_group_exec_runtime: fix the racy usage of ->signal

* Oleg Nesterov <oleg@redhat.com> wrote:

> On 11/07, Ingo Molnar wrote:
> >
> > * Oleg Nesterov <oleg@redhat.com> wrote:
> >
> > > --- K-28/kernel/sched_stats.h~A_G_E_R_FIX 2008-11-07 17:32:02.000000000 +0100
> > > +++ K-28/kernel/sched_stats.h 2008-11-07 17:44:39.000000000 +0100
> > > @@ -351,10 +351,12 @@ static inline void account_group_exec_ru
> > > unsigned long long ns)
> > > {
> > > struct signal_struct *sig;
> > > + unsigned long flags;
> > >
> > > - sig = tsk->signal;
> > > - if (unlikely(!sig))
> > > + if (unlikely(!lock_task_sighand(tsk, &flags)))
> > > return;
> >
> > i think this will lock up:
>
> Ah. I worried about this, but convinced myself this is OK...
>
> > the signal lock must not nest inside the rq
> > lock, and these accounting functions are called from within the
> > scheduler.
>
> Why? we seem to never do task_rq_lock() under ->siglock ?

signal_wake_up() ?

Ingo


\
 
 \ /
  Last update: 2008-11-08 10:31    [W:0.092 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site