]> bbs.cooldavid.org Git - net-next-2.6.git/commit
percpu: implement kernel memory based chunk allocation
authorTejun Heo <tj@kernel.org>
Fri, 9 Apr 2010 09:57:01 +0000 (18:57 +0900)
committerTejun Heo <tj@kernel.org>
Sat, 1 May 2010 06:30:50 +0000 (08:30 +0200)
commitb0c9778b1d07ed3aa7e411db201275553527b1b1
tree8649c1b27edebc6addef5087eb1830fc8bccdb74
parent9f6455325618821dcf6775d7972881fde32e77c5
percpu: implement kernel memory based chunk allocation

Implement an alternate percpu chunk management based on kernel memeory
for nommu SMP architectures.  Instead of mapping into vmalloc area,
chunks are allocated as a contiguous kernel memory using
alloc_pages().  As such, percpu allocator on nommu will have the
following restrictions.

* It can't fill chunks on-demand page-by-page.  It has to allocate
  each chunk fully upfront.

* It can't support sparse chunk for NUMA configurations.  SMP w/o mmu
  is crazy enough.  Let's hope no one does NUMA w/o mmu.  :-P

* If chunk size isn't power-of-two multiple of PAGE_SIZE, the
  unaligned amount will be wasted on each chunk.  So, archs which use
  this better align chunk size.

For instructions on how to use this, read the comment on top of
mm/percpu-km.c.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: Graff Yang <graff.yang@gmail.com>
Cc: Sonic Zhang <sonic.adi@gmail.com>
mm/percpu-km.c [new file with mode: 0644]
mm/percpu.c