[PATCH v6 01/10] cpuidle/poll_state: poll via smp_cond_load_relaxed()
Ankur Arora
ankur.a.arora at oracle.com
Mon Aug 12 15:35:49 PDT 2024
Christoph Lameter (Ampere) <cl at gentwo.org> writes:
> On Fri, 26 Jul 2024, Ankur Arora wrote:
>
>> diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
>> index 9b6d90a72601..532e4ed19e0f 100644
>> --- a/drivers/cpuidle/poll_state.c
>> +++ b/drivers/cpuidle/poll_state.c
>> @@ -21,21 +21,21 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
>>
>> raw_local_irq_enable();
>> if (!current_set_polling_and_test()) {
>> - unsigned int loop_count = 0;
>> + unsigned int loop_count;
>> u64 limit;
>
> loop_count is only used in the while loop below. So the declaration could be
> placed below the while.
That's a good idea. Will fix.
>>
>> limit = cpuidle_poll_time(drv, dev);
>>
>> while (!need_resched()) {
>> - cpu_relax();
>> - if (loop_count++ < POLL_IDLE_RELAX_COUNT)
>> - continue;
>> -
>> loop_count = 0;
>> if (local_clock_noinstr() - time_start > limit) {
>> dev->poll_time_limit = true;
>> break;
>> }
>
> Looks ok otherwise
>
> Reviewed-by: Christoph Lameter <cl at linux.com>
Thanks for the review.
--
ankur
More information about the linux-arm-kernel
mailing list