From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932465AbcIMQPT (ORCPT ); Tue, 13 Sep 2016 12:15:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50918 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932383AbcIMQPR (ORCPT ); Tue, 13 Sep 2016 12:15:17 -0400 Date: Tue, 13 Sep 2016 18:14:27 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: Cheng Chao , mingo@kernel.org, tj@kernel.org, akpm@linux-foundation.org, chris@chris-wilson.co.uk, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] stop_machine: Make migration_cpu_stop() does useful works for CONFIG_PREEMPT_NONE Message-ID: <20160913161427.GA32543@redhat.com> References: <1473408834-6122-1-git-send-email-chengchao@kedacom.com> <1473497532-5440-1-git-send-email-cs.os.kernel@gmail.com> <20160912113727.GQ10153@twins.programming.kicks-ass.net> <20160912114108.GP10168@twins.programming.kicks-ass.net> <20160912130537.GB7984@redhat.com> <20160912150111.GC10121@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160912150111.GC10121@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 13 Sep 2016 16:15:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/12, Peter Zijlstra wrote: > > On Mon, Sep 12, 2016 at 03:05:38PM +0200, Oleg Nesterov wrote: > > > But this leads to the question which I wanted to ask many times. > > > > Why cond_resched() is not NOP if CONFIG_PREEMPT=y ? > > Dunno, nobody bothered to do it? We should keep the might_sleep() of > course, but the preemption check is pointless. Yes, agreed, I actually meant _cond_resched(). > > Perhaps we have some users like, just for example, > > > > preempt_enable_no_resched(); > > cond_resched(); > > > > which actually want the should_resched() check even if CONFIG_PREEMPT, > > but most callers do not? > > I would hope not, the few preempt_enable_no_resched() users _should_ > have an actual schedule() call in the _very_ near future. Me too, and I failed to find something which could be broken... So perhaps should make it nop and investigate the new bug reports after that. Hmm. And preempt_enable_no_resched_notrace() under TASK_DEAD in __schedule() should be removed it seems, do_exit() can call __schedule() directly. Oleg.