From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757481AbcILLD5 (ORCPT ); Mon, 12 Sep 2016 07:03:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20332 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbcILLDz (ORCPT ); Mon, 12 Sep 2016 07:03:55 -0400 Date: Mon, 12 Sep 2016 13:03:07 +0200 From: Oleg Nesterov To: Cheng Chao Cc: mingo@kernel.org, peterz@infradead.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: <20160912110307.GA2417@redhat.com> References: <1473408834-6122-1-git-send-email-chengchao@kedacom.com> <1473497532-5440-1-git-send-email-cs.os.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473497532-5440-1-git-send-email-cs.os.kernel@gmail.com> 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.25]); Mon, 12 Sep 2016 11:03:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/10, Cheng Chao wrote: > > @@ -126,6 +126,17 @@ int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg) > cpu_stop_init_done(&done, 1); > if (!cpu_stop_queue_work(cpu, &work)) > return -ENOENT; > + > +#if defined(CONFIG_PREEMPT_NONE) > + /* > + * Makes the stopper thread run as soon as possible. > + * And if the caller is TASK_RUNNING, keeps the caller TASK_RUNNING. > + * It's special useful for some callers which are expected to be > + * TASK_ON_RQ_QUEUED. > + * sched_exec does benefit from this improvement. > + */ > + schedule(); > +#endif > wait_for_completion(&done.completion); > return done.ret; > } Cheng, I already tried twice to suggest to conditionalize this schedule, because it can only help if cpu == smp_processor_id, and you didn't reply. I still think _cond_resched() makes more sense. I won't really argue if you prefer it this way. But did you see my emails? Oleg.