mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
signalfd simplification
This simplifies signalfd code, by avoiding it to remain attached to the sighand during its lifetime. In this way, the signalfd remain attached to the sighand only during poll(2) (and select and epoll) and read(2). This also allows to remove all the custom "tsk == current" checks in kernel/signal.c, since dequeue_signal() will only be called by "current". I think this is also what Ben was suggesting time ago. The external effect of this, is that a thread can extract only its own private signals and the group ones. I think this is an acceptable behaviour, in that those are the signals the thread would be able to fetch w/out signalfd. Signed-off-by: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
9db619e665
commit
b8fceee17a
8 changed files with 39 additions and 217 deletions
|
@ -24,7 +24,6 @@
|
|||
#include <linux/pid_namespace.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/profile.h>
|
||||
#include <linux/signalfd.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/kthread.h>
|
||||
|
@ -86,14 +85,6 @@ static void __exit_signal(struct task_struct *tsk)
|
|||
sighand = rcu_dereference(tsk->sighand);
|
||||
spin_lock(&sighand->siglock);
|
||||
|
||||
/*
|
||||
* Notify that this sighand has been detached. This must
|
||||
* be called with the tsk->sighand lock held. Also, this
|
||||
* access tsk->sighand internally, so it must be called
|
||||
* before tsk->sighand is reset.
|
||||
*/
|
||||
signalfd_detach_locked(tsk);
|
||||
|
||||
posix_cpu_timers_exit(tsk);
|
||||
if (atomic_dec_and_test(&sig->count))
|
||||
posix_cpu_timers_exit_group(tsk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue