lkml.org 
[lkml]   [2009]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PULL] Wrapper macros for struct task_struct and struct mm_struct cpumask transition
Date
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.


\
 
 \ /
  Last update: 2009-03-12 08:19    [W:0.067 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site