[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48876E2E.4000508@sgi.com>
Date: Wed, 23 Jul 2008 10:45:18 -0700
From: Mike Travis <travis@....com>
To: Rusty Russell <rusty@...tcorp.com.au>
CC: Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Christoph Lameter <cl@...ux-foundation.org>,
Jack Steiner <steiner@....com>, linux-kernel@...r.kernel.org,
Paul Jackson <pj@....com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Adrian Bunk <bunk@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 1/8] cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr
Rusty Russell wrote:
...
>> Another thought I had is perhaps cpumask.h should define something that
>> indicates a "huge NR_CPUS count" that is used globally to trigger things
>> like kmalloc of cpumask variables, instead of declaring them on the
>> stack...? Or (as has been discussed in the past), maybe a new cpumask_t
>> type will be needed?
>
> AFAICT the final answer has to be a get_cpu_mask()/put_cpu_mask(), which
> sleeps and doesn't nest (so we can use a pool allocator). Of course, that
> kind of analysis is non-trivial, so I suggest that's not for this merge
> window...
>
> Want me to try something and see if it boots?
> Rusty.
Hi Rusty,
There are a number of occasions where a function declares a temporary cpumask_t
variable on the stack to hold (say) current->cpus_allowed. I tried a couple of
options early on to a.) reserve one or two cpumask_t variables in the task
struct; and b.) reserve one or two cpumask_t variables per cpu. Both had weird
consequences in some usages and since 4096 is *only* 512 bytes, it didn't seem
worth the effort. Our next iteration will have NR_CPUS=16384 and therefore
removing all stack declared cpumask_t variables is highly desirable.
Your idea of a pool allocator is very interesting... ;-)
Thanks,
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists