Re: [PATCH 2/4] sched/core: change rq->nr_iowait type to atomic_long_t on 64-bit
From: Jens Axboe
Date: Mon Aug 19 2024 - 10:43:24 EST
On 8/19/24 12:30 AM, Zhang Qiao wrote:
>> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
>> index b6b3b565bcb1..6a90c2da1eb3 100644
>> --- a/kernel/sched/sched.h
>> +++ b/kernel/sched/sched.h
>> @@ -1082,7 +1082,11 @@ struct rq {
>> u64 clock_idle_copy;
>> #endif
>>
>> +#ifdef CONFIG_64BIT
>> + atomic_long_t nr_iowait;
>> +#else
>> atomic_t nr_iowait;
>> +#endif
>
> When CONFIG_64BIT is not set, the type atomic_long_t as a synonym of
> the type atomic_t. Can you directly use atomic_long_t, is right?
Ah indeed, thanks! Yeah we can just use atomic_long_t unconditionally,
and that'd kill the ifdefs in sched/core/core.c as well as we can just
define the shift to be half the atomic_long_t size, 4 *
sizeof(atomic_long_t).
I'll respin with that.
--
Jens Axboe