* Re: [PATCH -mm] cgroup,cpuset: use alternative malloc to allocate large memory buf for tasks
[not found] ` <6599ad830809110945pb85ec68o16328b31cbb0dc52@mail.gmail.com>
@ 2008-09-11 19:54 ` Paul Menage
0 siblings, 0 replies; only message in thread
From: Paul Menage @ 2008-09-11 19:54 UTC (permalink / raw)
To: Lai Jiangshan
Cc: Andrew Morton, Paul Jackson, Linux Kernel Mailing List, linux-mm
On Thu, Sep 11, 2008 at 9:45 AM, Paul Menage <menage@google.com> wrote:
> On Thu, Sep 11, 2008 at 3:30 AM, Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
>> This new alternative allocation implementation can allocate memory
>> up to 64M in 32bits system or 512M in 64bits system.
>
> Isn't a lot of this patch just reimplementing vmalloc()?
To extend on this, I think there are two ways of fixing the large
allocation problem:
1) just use vmalloc() rather than kmalloc() when the pid array is over
a certain threshold (probably 1 page?)
2) allocate pages/chunks in a similar way to your CL, but don't bother
mapping them. Instead we'd use the fact that each record (pid) is the
same size, and hence we can very easily use the high bits of an index
to select the chunk and the low bits to select the pid within the
chunk - no need to suffer the overhead of setting up and tearing down
ptes in order for the MMU do the same operation for us in hardware.
Obviously option 1 is a lot simpler, but option 2 avoids a
vmap()/vunmap() on every open/close of a tasks file. I'm not familiar
enough with the performance of vmap/vunmap on typical
hardware/workloads to know how high this overhead is - maybe a VM
guru can comment?
Paul
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-11 19:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <48C8F32E.2020004@cn.fujitsu.com>
[not found] ` <6599ad830809110945pb85ec68o16328b31cbb0dc52@mail.gmail.com>
2008-09-11 19:54 ` [PATCH -mm] cgroup,cpuset: use alternative malloc to allocate large memory buf for tasks Paul Menage
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox