From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932824AbbLNVLd (ORCPT ); Mon, 14 Dec 2015 16:11:33 -0500 Received: from casper.infradead.org ([85.118.1.10]:52855 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932489AbbLNVL3 (ORCPT ); Mon, 14 Dec 2015 16:11:29 -0500 Date: Mon, 14 Dec 2015 22:11:22 +0100 From: Peter Zijlstra To: Oleg Nesterov 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: <20151214211122.GZ6357@twins.programming.kicks-ass.net> References: <20151213211116.GK6373@twins.programming.kicks-ass.net> <20151214185004.GA27367@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151214185004.GA27367@redhat.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2015 at 07:50:04PM +0100, Oleg Nesterov wrote: > > + 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. Yes that looks like a viable cleanup. But at least now we have a base that's working for everyone. I'll try and do some patches tomorrow.