Re: RDMA Read: Local protection error
From: Christoph Lameter <hidden>
Date: 2016-05-26 20:10:37
On Thu, 26 May 2016, Bart Van Assche wrote:
On 05/26/2016 09:24 AM, Yishai Hadas wrote:quoted
On 5/25/2016 6:58 PM, Chuck Lever wrote:quoted
When debugging is disabled, kzalloc returns page-aligned addresses:Is it defined some where that regular kzalloc/kmalloc guaranties to return a page-aligned address as you see in your testing ? if so the debug mode should behave the same. Otherwise we can consider using any flag allocation that can force that if such exists. Let's get other people's input here.My understanding is that the fact that k[mz]alloc() returns a page-aligned buffer if the allocation size is > PAGE_SIZE / 2 is a side effect of the implementation and not something callers of that function should rely on. I think the only assumption k[mz]alloc() callers should rely on is that the allocated memory respects ARCH_KMALLOC_MINALIGN.
The alignment of slab objects is specified at slab creation with kmem_cache_create(). For kmalloc these are aligned to cache line boundaries unless the cache object size is less than that. Allocators may happen to align objects arbitrary in the absense of a alignment specfication. SLUB happens to align objects of multiple page size to page boundaries. But that only works if no extra storage is required (like f.e. for debugging features). It cannot be relied upon. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html