Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4474060ybz; Tue, 21 Apr 2020 01:01:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLwbxlg5/SZ5WSx6pyhXPPZ4QjL6q2rqnuinc/W4sCJt2TtrDcVMSnn2Z9bj/X485qx+0fZ X-Received: by 2002:a17:906:970e:: with SMTP id k14mr20021877ejx.202.1587456106114; Tue, 21 Apr 2020 01:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587456106; cv=none; d=google.com; s=arc-20160816; b=XPSG/VWhiQHO/J5lt8XTfXwzys5RZqs2eDg/BtNOucRuQrP+KZPH0Ta6jbvO7d+iGo l2kvA2lTfeuN/T/cydpXKdmwmTevAK+bJBR75a+k3ZAk+fTAgrWbsXJcn743ZqvJrSF7 CpIM1HRM9ZUH1JUVPV1L+F94YAqiZwTpIObuXN5lI4ThCHLMCaWIk9ITaRQrxGcx8wzE WWnOLMoeKZgQd5qze98LumXealIk7DdNregVk8aMa4YhfJgqY4zTE5vETsV1svLtLF0A SIyf6VliLmhbUyR/iixgJW9jK2HYxY8jj3HJ0/15wdfFxR6zUSkNtali+GFkRg8K2L4C MT7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=C7+wPznZSGgtVlJ9lC691M6w0YIGyIFPqtl4rjk11OU=; b=U6m6yLvk0ishgGP3Q+DNR7akr4CbBI/KV0M/loZgq5O7mtPcQM6l4ZutgRzbA4DtDJ fdJvXn50T8AycoWup0tmA1K3gNCZI7vpKx/PvVIZtdSrmPAOcHNFIA+kLZ/60oAts1ML 2LhICHbOL6jLh4MAOsz7xkmMpfSo8U+LW4tsVF6rwdrJsG8T5yerOWoCswGfrPmoBHsV nT6KXCN2Qc8xm3s3IEWbnpInnX895Zt+anB8Fu3B0sHHDYvlsDF29Zff7yFVR55qyoNG FehT+QiEmDWPVmFjR0VukuQ48XhKOHojMnnqCRtibunU6Jki6UR+2ne1P4YCM8iHZGv9 ytLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca3si1199251edb.164.2020.04.21.01.01.22; Tue, 21 Apr 2020 01:01:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbgDUIAQ (ORCPT + 99 others); Tue, 21 Apr 2020 04:00:16 -0400 Received: from mga03.intel.com ([134.134.136.65]:44813 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726628AbgDUIAP (ORCPT ); Tue, 21 Apr 2020 04:00:15 -0400 IronPort-SDR: 2qDMjm2HVaVSGZUYCfmlVkMPPn4h7xbW4cMMjxQ97kiExBJQQC5aNyTsy1jQKiJwlkCbWp3XCJ +LhmN0pgdhSQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 01:00:15 -0700 IronPort-SDR: X8Q0uUFFTXyIY6RJ64PYo7y0nRGE7CYiw2K+mKghqyjfJBNHzpM5yD9LQUsFn/0Y0i6nKAkVOp 3AgDu6A/RZwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,409,1580803200"; d="scan'208";a="273446547" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by orsmga002.jf.intel.com with ESMTP; 21 Apr 2020 01:00:12 -0700 Date: Tue, 21 Apr 2020 16:00:42 +0800 From: Chen Yu To: Valentin Schneider Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2][v2] sched: Extract the task putting code from pick_next_task() Message-ID: <20200421080042.GC9721@chenyu-office.sh.intel.com> References: <4f301770996c02f44d52a4868f510025d5a3a558.1587393807.git.yu.c.chen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Apr 20, 2020 at 06:44:29PM +0100, Valentin Schneider wrote: > > On 20/04/20 16:01, Chen Yu wrote: > > Introduce a new function finish_prev_task() to do the balance > > when necessary, and then put previous task back to the run queue. > > This function is extracted from pick_next_task() to prepare for > > future usage by other type of task picking logic. > > > > No functional change. > > > > With the absolutely tiny nit below: > > Reviewed-by: Valentin Schneider > > > Suggested-by: Peter Zijlstra > > Signed-off-by: Chen Yu > > --- > > kernel/sched/core.c | 39 +++++++++++++++++++++++---------------- > > 1 file changed, 23 insertions(+), 16 deletions(-) > > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index 3a61a3b8eaa9..bf59a5cf030c 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -3904,6 +3904,28 @@ static inline void schedule_debug(struct task_struct *prev, bool preempt) > > schedstat_inc(this_rq()->sched_count); > > } > > > > +static void finish_prev_task(struct rq *rq, struct task_struct *prev, > > + struct rq_flags *rf) > > +{ > > + const struct sched_class *class; > > +#ifdef CONFIG_SMP > > Nit: I would've put that declaration within the ifdef, given it isn't used > outside of it. > Okay, I'll do. Thanks, Chenyu