Messages in this thread | | | Date | Wed, 30 Jul 2008 09:48:41 -0500 | From | Christoph Lameter <> | Subject | Re: [PATCH] eCryptfs - use page_alloc not kmalloc to get a page of memory |
| |
Pekka Enberg wrote: >> For whatever reason, I did see non-page-aligned memory returned from >> kmalloc(PAGE_CACHE_SIZE), and I think this is what caused the problem >> once virt_to_page() was used to get hold of a page to pass around in the >> ecryptfs/crypto code... > > With SLUB? I can't see how that's possible. I can see this with SLAB, > though, for 4K pages.
It possible because PAGE_CACHE_SIZE is still handled by SLUB and if debugging is on then kmalloc may return non page aligned objects. The handoff to the page allocator only occurs for objects > 4k. We used to do this also for 4k objects but then we got performance regressions in tbench.
> In any case, the patch, of course, make sense as kmalloc() behavior > varies between allocators. > > Pekka
| |