From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753405AbbLNStp (ORCPT ); Mon, 14 Dec 2015 13:49:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31957 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753243AbbLNSto (ORCPT ); Mon, 14 Dec 2015 13:49:44 -0500 Date: Mon, 14 Dec 2015 19:50:04 +0100 From: Oleg Nesterov To: Peter Zijlstra Cc: Linus Torvalds , linux-kernel@vger.kernel.org, jstancek@redhat.com, clm@fb.com, vladimir.murzin@arm.com, pjt@google.com, efault@gmx.de, tglx@linutronix.de, hpa@zytor.com, neilb@suse.de Subject: Re: [PATCH] sched/wait: Fix the signal handling fix Message-ID: <20151214185004.GA27367@redhat.com> References: <20151213211116.GK6373@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151213211116.GK6373@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter, sorry. I didn't actually read this patch yet (and a lot of previous emails). Will try tomorrow, I am not even sure I understand the problem(s) correctly. But let me ask one question anyway, On 12/13, Peter Zijlstra wrote: > > --- a/kernel/sched/wait.c > +++ b/kernel/sched/wait.c > @@ -392,7 +392,7 @@ __wait_on_bit(wait_queue_head_t *wq, str > do { > prepare_to_wait(wq, &q->wait, mode); > if (test_bit(q->key.bit_nr, q->key.flags)) > - ret = (*action)(&q->key); > + ret = (*action)(&q->key, mode); And every action() should check signal_pending_state()... So why we can't change __wait_on_bit/etc instead and remove all the signal- pending checks from the callbacks? It seems that we can just check signal_pending_state() before prepare_to_wait(). Or perhaps we can add another helper which acts like prepare_to_wait_event(). Yes, some callers want -EINTR, some -ERESTARTSYS, but this shouldn't be a problem. And sorry if this was already discussed, another case when I am trying to return to lkml with a lot of unread emails. Oleg.