lkml.org 
[lkml]   [2010]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -mm 3/3] proc: make task_sig() lockless
Date
Oleg Nesterov <oleg@redhat.com> wrote:

> > Except that the data returned might then be inconsistent because you don't
> > hold a lock as you read the various bits of it.
>
> Yes. From the changelog:
>
> Of course, this means we read pending/blocked/etc nonatomically,
> but I hope this is OK for fs/proc.

Ah, yes. I read that as you meant how procfs accessed the actual data
structures, not how the user accessed procfs. It might be worth clarifying
that.

> But I don't think the returned data could be "really" inconsistent
> from the /bin/ps pov. Yes, it is possible that, say, some signal is
> seen as both pending and ignored without ->siglock. Or we can report
> user->sigpending != 0 while pending/shpending are empty.
>
> But this looks harmless to me. We never guaranteed /proc/pid/status
> can't report the "intermediate" state, and I don't think we can
> confuse the user-space.
>
> Do you agree? Or do you think this can make problems ?

I don't know of anything this will affect adversely. In fact, I'm not sure
there was a guarantee that it would be atomic anyway.

So as far as I'm concerned, you can add:

Acked-by: David Howells <dhowells@redhat.com>

> > Probably we can change do_task_stat() to avod ->siglock too, except
> > we can't get tty_nr lockless.

Btw, avoid has an 'i' in it... :-)


\
 
 \ /
  Last update: 2010-03-24 09:39    [W:0.109 / U:3.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site