lkml.org 
[lkml]   [2010]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/3] make task_struct->signal immutable/refcountable
Date
Acked-by: Roland McGrath <roland@redhat.com>
but some comments:

> This patch adds the reference counter, sigcnt, into signal_struct. This
> reference is owned by task_struct and it is dropped in __put_task_struct().

I'm not thrilled about the field name, but whatever. We now have three
atomic counts with subtly different meanings, and no comments anywhere
really explaining it all.

* live: created and not yet begun to exit
* count: not yet reaped
* sigcnt: task_struct not yet freed

> Perhaps it makes sense to export get/put_signal_struct() later, but
> currently I don't see the immediate reason.

We should never export those at all. In fact, I would not even make it a
separate inline. We're here to simplify the lifetime rules, not give new
ways to complicate them. If anybody wants to keep a signal_struct alive,
they can do it with get_task_struct().

> - with or without this patch signal_struct->count should go away,
> or at least it should be "int nr_threads" for fs/proc. This will
> be addressed later.

Indeed. IMHO adding yet another atomic count here is OK only on the
proviso that we will be getting rid of the old one RSN.


Thanks,
Roland


\
 
 \ /
  Last update: 2010-04-09 21:41    [W:0.026 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site