Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759584AbXEKIvF (ORCPT ); Fri, 11 May 2007 04:51:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751749AbXEKIuz (ORCPT ); Fri, 11 May 2007 04:50:55 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:45454 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754560AbXEKIux (ORCPT ); Fri, 11 May 2007 04:50:53 -0400 Date: Fri, 11 May 2007 17:49:27 +0900 Message-ID: <87tzujeodk.wl%takeuchi_satoru@jp.fujitsu.com> From: Satoru Takeuchi To: Rusty Russell Cc: Satoru Takeuchi , Linux Kernel , Srivatsa Vaddagiri , Zwane Mwaikambo , Nathan Lynch , Joel Schopp , Ashok Raj , Heiko Carstens , Gautham R Shenoy Subject: [PATCH 2/2] cpu hotplug: fix ksoftirqd termination on cpu hotplug with naughty realtime process In-Reply-To: <1178593345.28438.29.camel@localhost.localdomain> References: <87bqgxrlky.wl%takeuchi_satoru@jp.fujitsu.com> <1178545373.28438.7.camel@localhost.localdomain> <877irkrq8a.wl%takeuchi_satoru@jp.fujitsu.com> <1178593345.28438.29.camel@localhost.localdomain> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/21.4 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1558 Lines: 39 Fix ksoftirqd termination on cpu hotplug with naughty real time process. Assuming the following case: - Try to hot remove CPU2 from CPU1. - There is a real time process on CPU2, and that process doesn't sleep at all. - That rt process and ksoftirqd/2 is migrated to the CPU0 Then ksoftirqd/2 can't stop becasue that rt process runs everlastingly on CPU0, and CPU1 waiting the ksoftirqd/2's termination hangs up. To fix this problem, set the priority of ksoftirqd/2 to max one before kthread_stop(). Signed-off-by: Satoru Takeuchi Index: linux-2.6.21/kernel/softirq.c =================================================================== --- linux-2.6.21.orig/kernel/softirq.c 2007-05-11 13:45:34.000000000 +0900 +++ linux-2.6.21/kernel/softirq.c 2007-05-11 17:19:12.000000000 +0900 @@ -590,6 +590,7 @@ static int __cpuinit cpu_callback(struct { int hotcpu = (unsigned long)hcpu; struct task_struct *p; + struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; switch (action) { case CPU_UP_PREPARE: @@ -614,6 +615,7 @@ static int __cpuinit cpu_callback(struct case CPU_DEAD: p = per_cpu(ksoftirqd, hotcpu); per_cpu(ksoftirqd, hotcpu) = NULL; + sched_setscheduler(p, SCHED_FIFO, ¶m); kthread_stop(p); takeover_tasklets(hotcpu); break; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/