[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190118161616.GH14054@worktop.programming.kicks-ass.net>
Date: Fri, 18 Jan 2019 17:16:16 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Chunyan Zhang <chunyan.zhang@...soc.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Vincent Wang <vincent.wang@...soc.com>,
Quentin Perret <quentin.perret@....com>,
linux-kernel@...r.kernel.org, Chunyan Zhang <zhang.lyra@...il.com>
Subject: Re: [PATCH V2] sched/cpufreq: calculate util / cap in advance in
map_util_freq()
On Thu, Jan 10, 2019 at 11:02:05AM +0800, Chunyan Zhang wrote:
> From: Vincent Wang <vincent.wang@...soc.com>
>
> When a task that is in_iowait state is enqueued, cpufreq_update_util()
> will be invoked with SCHED_CPUFREQ_IOWAIT flag. In this case,the value
> of util and cap, which are parameters used in map_util_freq(), will be
> cpu frequency, instead of cpu util and capactiy.
>
> For some 32bit architectures, the size of unsigned long is 32. When
> calculating freq, there may be an overflow error in this expression:
Would it not be much better to fix that one case instead of adding extra
instructions for everyone all the time?
Powered by blists - more mailing lists