Re: [PATCH v4 10/10] sched/fair: Provide idle search schedstats
From: Steven Sistare
Date: Fri Dec 07 2018 - 08:45:59 EST
On 12/7/2018 6:56 AM, Valentin Schneider wrote:
> Hi Steve,
>
> On 06/12/2018 21:28, Steve Sistare wrote:
> [...]
>> @@ -6392,6 +6422,7 @@ static int wake_cap(struct task_struct *p, int cpu, int prev_cpu)
>> static int
>> select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags)
>> {
>> + unsigned long time = schedstat_start_time();
>
> With arm64's defconfig (!CONFIG_SCHEDSTATS) I get:
>
> kernel/sched/fair.c: In function âselect_task_rq_fairâ:
> kernel/sched/fair.c:6459:16: warning: unused variable âtimeâ [-Wunused-variable]
> unsigned long time = schedstat_start_time();
> ^~~~
>
> So you probably want something like this:
>
> ----->8-----
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5a113a8..7d33f74 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6456,12 +6456,14 @@ static int wake_cap(struct task_struct *p, int cpu, int prev_cpu)
> static int
> select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags)
> {
> - unsigned long time = schedstat_start_time();
> struct sched_domain *tmp, *sd = NULL;
> int cpu = smp_processor_id();
> int new_cpu = prev_cpu;
> int want_affine = 0;
> int sync = (wake_flags & WF_SYNC) && !(current->flags & PF_EXITING);
> + unsigned long time;
> +
> + time = schedstat_start_time();
>
> if (sd_flag & SD_BALANCE_WAKE) {
> record_wakee(p);
> -----8<-----
>
> The 0-day bot will catch those but since it's the only warn I got I figured
> I'd report it :)
Thanks. This patch is provided for steal evaluation only and it should be
dropped before the series is pushed upstream. If I ever post it again for
future work, I will apply your fix.
- Steve