On Sat, Dec 08, 2007 at 10:30:39AM +0100, Ingo Molnar wrote:I was hoping for some discussion about whether it was the best fix. The current kzalloc thing strikes me as a step backwards for all allocators. We'd do better to have a single non-inline kzalloc function rather than an extra branch in the normal kmalloc fast path. But here's the patch again, with my sign-off: Avoid calling page allocator with __GFP_ZERO, as we might be in atomic context and this will make thing unhappy on highmem systems. Instead, manually zero allocations from the page allocator. Signed-off-by: Matt Mackall <mpm@selenic.com> diff -r f7edf7226317 mm/slob.c --- a/mm/slob.c Wed Dec 05 15:57:06 2007 -0600 +++ b/mm/slob.c Wed Dec 05 15:57:51 2007 -0600 @@ -223,6 +231,7 @@ static void *slob_new_page(gfp_t gfp, in { void *page; + gfp &= ~__GFP_ZERO; #ifdef CONFIG_NUMA if (node != -1) page = alloc_pages_node(node, gfp, order); @@ -457,6 +470,8 @@ void *__kmalloc_node(size_t size, gfp_t page = virt_to_page(ret); page->private = size; } + if (unlikely((gfp & __GFP_ZERO) && ret)) + memset(ret, 0, size); return ret; } } -- Mathematics is the supreme nostalgia of our time. --
| Avi Kivity | [PATCH 09/58] KVM: MMU: Respect nonpae pagetable quadrant when zapping ptes |
| Andrew Morton | 2.6.25-rc2-mm1 |
| James Morris | Re: LSM conversion to static interface |
| Eric W. Biederman | Re: [PATCH] kexec: force x86_64 arches to boot kdump kernels on boot cpu |
git: | |
| David Miller | Re: 2.6.25-rc8: FTP transfer errors |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [GIT *] Solos PCI ADSL card update |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
