Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752970AbXLFBI6 (ORCPT ); Wed, 5 Dec 2007 20:08:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751619AbXLFBIt (ORCPT ); Wed, 5 Dec 2007 20:08:49 -0500 Received: from x35.xmailserver.org ([64.71.152.41]:49091 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbXLFBIt (ORCPT ); Wed, 5 Dec 2007 20:08:49 -0500 X-AuthUser: davidel@xmailserver.org Date: Wed, 5 Dec 2007 17:08:47 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Oleg Nesterov cc: Andrew Morton , Ingo Molnar , Linus Torvalds , Roland McGrath , Linux Kernel Mailing List Subject: Re: [PATCH] fix group stop with exit race In-Reply-To: <20071205173028.GA3745@tv-sign.ru> Message-ID: References: <20071205173028.GA3745@tv-sign.ru> X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 33 On Wed, 5 Dec 2007, Oleg Nesterov wrote: > do_signal_stop() counts all sub-thread and sets ->group_stop_count accordingly. > Every thread should decrement ->group_stop_count and stop, the last one should > notify the parent. > > However a sub-thread can exit before it notices the signal_pending(), or it may > be somewhere in do_exit() already. In that case the group stop never finishes > properly. > > Note: this is a minimal fix, we can add some optimizations later. Say we can > return quickly if thread_group_empty(). Also, we can move some signal related > code from exit_notify() to exit_signals(). > > Signed-off-by: Oleg Nesterov Looks OK for me, even though we're doing more work on the exit path. OTOH I don't see a non-racy way of doing it w/out grabbing the lock. Did you try to bench how much this change costs? Anyway, looks sane to me... Acked-by: Davide Libenzi - Davide -- 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/