Hi Oleg,
Thanks for some patches about tasklist_lock. The avoidance of
tasklist_lock is very important for us. And now, I found another
avoidable tasklist_lock, and made the patch. Could you please have a
look?
This patch avoid taking tasklist_lock in kill_something_info() when
the pid is -1. It can convert to rcu_read_lock() for this case because
group_send_sig_info() doesn't need tasklist_lock.
This patch is for 2.6.25-rc5-mm1.
Signed-off-by: Atsushi Tsuji <a-tsuji@bk.jp.nec.com>
---
diff --git a/kernel/signal.c b/kernel/signal.c
index 3edbfd4..a888c58 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1089,14 +1089,16 @@ static int kill_something_info(int sig, struct siginfo
*info, int pid)
return ret;
}
- read_lock(&tasklist_lock);
if (pid != -1) {
+ read_lock(&tasklist_lock);
ret = __kill_pgrp_info(sig, info,
pid ? find_vpid(-pid) : task_pgrp(current));
+ read_unlock(&tasklist_lock);
} else {
int retval = 0, count = 0;
struct task_struct * p;
+ rcu_read_lock();
for_each_process(p) {
if (p->pid > 1 && !same_thread_group(p, current)) {
int err = group_send_sig_info(sig, info, p);
@@ -1106,8 +1108,8 @@ static int kill_something_info(int sig, struct siginfo
*info, int pid)
}
}
ret = count ? retval : -ESRCH;
+ rcu_read_unlock();
}
- read_unlock(&tasklist_lock);
return ret;
}
--
| Peter Zijlstra | Re: [15/17] SLUB: Support virtual fallback via SLAB_VFALLBACK |
| Christoph Lameter | Re: crash in kmem_cache_init |
| Greg Kroah-Hartman | [PATCH 017/196] aoechr: Convert from class_device to device |
| David Miller | Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead |
git: | |
| Raimund Bauer | [wishlist] graphical diff |
| Johannes Schindelin | Re: A tour of git: the basics (and notes on some unfriendly messages) |
| Pazu | qgit on Mac OS X |
| pradeep singh rautela | Re: Why does git track directory listed in .gitignore/".git/info/exclude"? |
| Stephen Pierce | SLS |
| Theodore Ts'o | Re: demand paging: proposal |
| Dong Liu | Re: CXterm for LINUX |
| Marc G Fournier | Re: Reducing traffic on c.o.l.; splitting c.o.l |
| Markus Wernig | host to host ipsec link |
| Beavis | mutiple pptp pass-through PF |
| Todd Pytel | IDE or SCSI virtual disks for VMWare image? |
| Sam Fourman Jr. | Asus Striker Extreme does not support 4GB memory |
| magical mounts | 12 hours ago | Linux kernel |
| Problem in scim in Fedora 9 | 13 hours ago | Linux general |
| The new Western Digital power saving drives | 13 hours ago | Hardware |
| Battery Maximizer Software | 1 day ago | Linux kernel |
| windows folder creation surprise | 1 day ago | Windows |
| Firewall | 2 days ago | OpenBSD |
| IP layer send packet | 2 days ago | Linux kernel |
| dtrace for linux available | 3 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 3 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 3 days ago | NetBSD |
