Subject: Re: more siginfo q;s
To: Christos Zoulas <christos@zoulas.com>
From: enami tsugutomo <enami@but-b.or.jp>
List: tech-kern
Date: 09/15/2003 13:46:47
> | > +			kpsendsig(l, ksi, returnmask);
> | > +			ksiginfo_del(p, ksi);
> | > +			pool_put(&ksiginfo_pool, ksi);
> | 
> | Hmm, it looks like kpsendsig() may sleep but are you sure that bad
> | thing won't occur?  (I don't know since I just read this diff through
> | peephole).
> 
> What kind of bad thing you are thinking of?

It is ok you're sure that no other thread won't pick up the same ksi.

> | > +	struct ksiginfo *ksi_next;
> | > +	struct ksiginfo *ksi_prev;
> | 
> | Why needs to be doublly linked?
> 
> I had it a singly linked list, but I thought that the performance/storage
> trade-off is better for the doubly linked list, specially for queued signals.

If ksiginfo_get() is changed to remove an element when it is returned,
single list is enough since ksiginfo_del() can be nuked.  And
ksiginfo_save() can be written more straightforward.

Anyway, ksiginfo_del() need to update the head pointer if the element
pointed by it is removed.

Also, you'are missing yamt's point (one of two); in ksiginfo_exithook,
don't touch ksi->ksi_next once the ksi is passed to pool_put().

enami.