Re: [PATCH 0/3] nohz: Convert tick dependency mask to atomic_t
From: Ingo Molnar
Date: Tue Mar 29 2016 - 09:14:55 EST
* Ingo Molnar <mingo@xxxxxxxxxx> wrote:
> That's a totally useless analysis of task_struct::flags, while we want to
> convert thread_info::flags...
So going over to arguing about thread_info::flags:
1)
We already have ti::flags accessors for most of the generic code. There's a few
outliers (in the scheduler code...) which can be fixed.
2)
We could introduce a ARCH_HAS_ATOMIC_TIF flag to do per arch conversion: this
would trigger #ifdefs in the accessors. When an architecture switches ti::flags to
atomic_t, it also sets ARCH_HAS_ATOMIC_TIF.
I'd still do a flags => __flags rename of the field, to make the conversion easy
and safe. So any arch that has ARCH_HAS_ATOMIC_TIF set provides an atomic_t
thread_info::__flags field.
3)
The new accessors under ARCH_HAS_ATOMIC_TIF would use atomic.h functions to
shuffle the thread-info flags.
4)
After one kernel release we could add:
WARN_ONCE("please convert thread_info::flags to atomic_t!", 1);
to the old accessors to accelerate conversion.
5)
Eventually, once every architecture is converted, we could eliminate the old
sched.c fetch_or() macro.
Thanks,
Ingo