Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1114908imu; Fri, 9 Nov 2018 11:09:55 -0800 (PST) X-Google-Smtp-Source: AJdET5f33EizdU2MPe+6/EP7oPsyqxATDcdPHdWmegL0+V0zb5uDoXzWXakMsFOXxBhjB5IFpnI5 X-Received: by 2002:a62:5615:: with SMTP id k21-v6mr10050173pfb.190.1541790594996; Fri, 09 Nov 2018 11:09:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541790594; cv=none; d=google.com; s=arc-20160816; b=mxqQHweELdN2pKuqtQbjLgCH6i/MVevZDhevuqprCm+cggTKhqxZA0nXrmh1YVIiy4 XFT1w6flE5S/2h+uykYI5Rs7S52kVg21w3BLx9fEtn4E3OMfEjtMpLp9XW7UBGMz/NJN 1yo9PWIlc2kccWp4K3N0eRCTEvU7jipwn9g9amDdAzIZiGgiSMlGudBGlkTZAj0JDhMA RkriLFZ7CkbV6Rpsd5Ii5sGLUCfyrXiZvDEk5Ue3ywz3sSGXGfLeeSpoza+ZTzZSZzkD rpogcNTULf7q3G+Rs97G32SifmqweH/+bHyofQIMHFTOGazj28BLLTxWdFeBRZh2Qxqa 16Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xF4UrwFhLFRGYNLlUBsOD0PGPerGNrFL0SpcGYSiI4U=; b=bA2ZDV/b05AfaeZlU2N9awxR/YS6Te/tQGfzEIanesWILliKcUtjMJlpZIX/cKFGeV dsfqGO6cm/eV8hBuCchc8pSopIN4GYoZO60T3NP5qjH76IC8tZnUMj5H7TveG2cx6Oop Yh57c5gKtzKpLmGFgO6dJ7EN0cGrcuzwkaHHOg+6I40O3qA5qxUyhCTH3ug2MqbRcyun 5VMV7xD72DWbuCak1WlbwFijevS8R51vGO+arbsHc/N69JNTZthYNRN4IdzP7GkyGwFN Zp03TZHyMn5DFMpgBErxZ5uyVHhHHObbux5Z4wDn74QvullSi0NBTpcFWxYsroWcG2w4 NgSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8-v6si6806238pgp.292.2018.11.09.11.09.36; Fri, 09 Nov 2018 11:09:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbeKJEt4 (ORCPT + 99 others); Fri, 9 Nov 2018 23:49:56 -0500 Received: from foss.arm.com ([217.140.101.70]:36656 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbeKJEt4 (ORCPT ); Fri, 9 Nov 2018 23:49:56 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 072ACA78; Fri, 9 Nov 2018 11:08:02 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E6EB3F5CF; Fri, 9 Nov 2018 11:07:59 -0800 (PST) Subject: Re: [PATCH v3 05/10] sched/fair: Hoist idle_stamp up from idle_balance To: Steve Sistare , mingo@redhat.com, peterz@infradead.org Cc: subhra.mazumdar@oracle.com, dhaval.giani@oracle.com, daniel.m.jordan@oracle.com, pavel.tatashin@microsoft.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com, riel@redhat.com, jbacik@fb.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, quentin.perret@arm.com, linux-kernel@vger.kernel.org References: <1541767840-93588-1-git-send-email-steven.sistare@oracle.com> <1541767840-93588-6-git-send-email-steven.sistare@oracle.com> From: Valentin Schneider Message-ID: <9ad62a6f-0269-a5d9-9757-ba5419f9cc1d@arm.com> Date: Fri, 9 Nov 2018 19:07:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1541767840-93588-6-git-send-email-steven.sistare@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On 09/11/2018 12:50, Steve Sistare wrote: > Move the update of idle_stamp from idle_balance to the call site in > pick_next_task_fair, to prepare for a future patch that adds work to > pick_next_task_fair which must be included in the idle_stamp interval. > No functional change. > > Signed-off-by: Steve Sistare > --- > kernel/sched/fair.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 9031d39..da368ed 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -3725,6 +3725,8 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) > rq->misfit_task_load = task_h_load(p); > } > > +#define IF_SMP(statement) statement > + I'm not too hot on those IF_SMP() macros. Since you're not introducing any other user for them, what about an inline function for rq->idle_stamp setting ? When it's mapped to an empty statement (!CONFIG_SMP) GCC is smart enough to remove the rq_clock() that would be passed to it on CONFIG_SMP: ----->8----- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c11adf3..34d9864 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3725,7 +3725,10 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) rq->misfit_task_load = task_h_load(p); } -#define IF_SMP(statement) statement +static inline void set_rq_idle_stamp(struct rq *rq, u64 value) +{ + rq->idle_stamp = value; +} static void overload_clear(struct rq *rq) { @@ -3772,7 +3775,7 @@ static inline int idle_balance(struct rq *rq, struct rq_flags *rf) return 0; } -#define IF_SMP(statement) /* empty */ +static inline void set_rq_idle_stamp(struct rq *rq, u64 value) {} static inline void overload_clear(struct rq *rq) {} static inline void overload_set(struct rq *rq) {} @@ -6773,12 +6776,12 @@ done: __maybe_unused; * We must set idle_stamp _before_ calling idle_balance(), such that we * measure the duration of idle_balance() as idle time. */ - IF_SMP(rq->idle_stamp = rq_clock(rq);) + set_rq_idle_stamp(rq, rq_clock(rq)); new_tasks = idle_balance(rq, rf); if (new_tasks) - IF_SMP(rq->idle_stamp = 0;) + set_rq_idle_stamp(rq, 0); /* * Because idle_balance() releases (and re-acquires) rq->lock, it is