lkml.org 
[lkml]   [2009]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] posix-cpu-timers: use ->sighand instead of ->signal to check the task is alive
Date
> We can't use them as refcounts. You can't bump ->live or ->count without
> breaking group_dead or exec logic. Perhaps we can use ->count, but then
> we need other changes.

We certainly need to clean up exec anyway.

> But this has nothing to do with this patch.

Agreed.

> The goal is to keep task->signal after release_task(), it will be freed
> by __put_task_struct(). This allows a lot of simplifications and we can
> move some fields from task_struct to signal_struct.

That sounds fine to me in theory, but I still wonder what the story will be
about the use of siglock.

> But first we should change the code which does [...]

I did understand the rationale given the signal_struct lifetime change.

> > Uses here protecting cpu_clock_sample_group() e.g., are
> > around looking at ->signal->foobar, so if ->signal is still there, why not
> > look at it and be able to get the sample in whatever small window this is?
>
> What if arm_timer() sees ->signal != NULL, proceeds, and attaches the
> timer to the signal_struct of the already dead task? This signal_strcut
> will be released with the pending timer.

Of course. I distinctly mentioned the read-only uses (sample).

> Even cpu_clock_sample_group() is not safe, unless we add other changes.

Why? It does no locking and only relies on the signal_struct lifetime.

> But in any case. Even if we don't need the further changes, do you
> agree this patch is correct and doesn't change the behaviour?

Yes.


Thanks,
Roland


\
 
 \ /
  Last update: 2009-02-05 21:55    [W:0.072 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site