Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757389AbYFSHAZ (ORCPT ); Thu, 19 Jun 2008 03:00:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752942AbYFSHAO (ORCPT ); Thu, 19 Jun 2008 03:00:14 -0400 Received: from mail4.hitachi.co.jp ([133.145.228.5]:57021 "EHLO mail4.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbYFSHAN (ORCPT ); Thu, 19 Jun 2008 03:00:13 -0400 X-AuditID: 0ac90647-ad124ba000004aeb-26-485a03fa46f5 Message-ID: <485A03E6.2090509@hitachi.com> Date: Thu, 19 Jun 2008 15:59:50 +0900 From: Hidehiro Kawai User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: ja MIME-Version: 1.0 To: Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-testers@vger.kernel.org, linux-mm@kvack.org, sugita , Satoshi OSHIMA , rusty@rustcorp.com.au Subject: [BUG][PATCH -mm] avoid BUG() in __stop_machine_run() References: <20080611225945.4da7bb7f.akpm@linux-foundation.org> In-Reply-To: <20080611225945.4da7bb7f.akpm@linux-foundation.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1514 Lines: 37 When a process loads a kernel module, __stop_machine_run() is called, and it calls sched_setscheduler() to give newly created kernel threads highest priority. However, the process can have no CAP_SYS_NICE which required for sched_setscheduler() to increase the priority. For example, SystemTap loads its module with only CAP_SYS_MODULE. In this case, sched_setscheduler() returns -EPERM, then BUG() is called. Failure of sched_setscheduler() wouldn't be a real problem, so this patch just ignores it. Or, should we give the CAP_SYS_NICE capability temporarily? Signed-off-by: Hidehiro Kawai --- kernel/stop_machine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Index: linux-2.6.26-rc5-mm3/kernel/stop_machine.c =================================================================== --- linux-2.6.26-rc5-mm3.orig/kernel/stop_machine.c +++ linux-2.6.26-rc5-mm3/kernel/stop_machine.c @@ -143,8 +143,7 @@ int __stop_machine_run(int (*fn)(void *) kthread_bind(threads[i], i); /* Make it highest prio. */ - if (sched_setscheduler(threads[i], SCHED_FIFO, ¶m) != 0) - BUG(); + sched_setscheduler(threads[i], SCHED_FIFO, ¶m); } /* We've created all the threads. Wake them all: hold this CPU so one -- 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/