From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 8 Feb 2003 22:32:02 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 8 Feb 2003 22:32:02 -0500 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:33541 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Sat, 8 Feb 2003 22:32:01 -0500 Date: Sat, 8 Feb 2003 19:37:31 -0800 (PST) From: Linus Torvalds To: Roland McGrath cc: Anton Blanchard , , Ingo Molnar , Andrew Morton , Subject: Re: heavy handed exit() in latest BK In-Reply-To: <200302090333.h193Xnn04935@magilla.sf.frob.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 8 Feb 2003, Roland McGrath wrote: > > Ah. Deciding state should be treated as a bitmask is not so hot when > TASK_RUNNING is 0. Oops. Indeed. TASK_RUNNING isn't a bit at all, it's a lack of sleep. Turning the logic the other way around: /* Ignore processes that are dead or stopped (except for SIGKILL) */ mask = TASK_ZOMBIE | TASK_DEAD; if (sig != SIGKILL) mask != TASK_STOPPED; and testing for !((p)->state & mask) should fix it. The mask ends up being the states that are _not_ good to send signals for ;) Linus