Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PULL] Wrapper macros for struct task_struct and struct mm_struct cpumask transition | Date | Thu, 12 Mar 2009 17:45:22 +1030 |
| |
On Thursday 12 March 2009 14:50:11 Nick Piggin wrote: > On Thursday 12 March 2009 15:06:52 Rusty Russell wrote: > > Rusty Russell (2): > > cpumask: tsk_cpumask for accessing the struct task_struct's cpus_allowed. > > cpumask: mm_cpumask for accessing the struct mm_struct's cpu_vm_mask. > > > > include/linux/mm_types.h | 3 +++ > > include/linux/sched.h | 3 +++ > > What's the transition?
Generally, cpumask_t to cpumask_var_t, ie. a struct cpumask [1] normally, or a struct cpumask * for CONFIG_CPUMASK_OFFSTACK=y (currently x86 only).
In these cases though, we're allocating them anyway so it makes more sense to do a dangling bitmap at the end of the struct (and only allocate nr_cpu_ids bits when CONFIG_CPUMASK_OFFSTACK=y).
I had a patch which used a const struct cpumask * for task_struct: we only ever replace the whole thing, so we can often use the standard cpu_mask_all or cpumask_of() and only allocate when it's set to something else. But the code was pretty ugly.
Anyway, it's a trivial to change if people use the wrappers. And if the wrappers are in Linus' tree, it's easy to get the conversions into linux-next.
Cheers, Rusty.
| |