lkml.org 
[lkml]   [2008]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] [mm/slob] fix bug - when slob allocates "struct kmem_cache", it does not force alignment.
From
Date
On Fri, 2008-04-25 at 18:57 +0800, Bryan Wu wrote:
> From: Yi Li <yi.li@analog.com>
>
> This may trigger misaligned memory access exception.
>
> Signed-off-by: Yi Li <yi.li@analog.com>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>

Looks good, thanks. Christoph, do you want to take this or should it go
through Andrew?

Acked-by: Matt Mackall <mpm@selenic.com>

> ---
> mm/slob.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/mm/slob.c b/mm/slob.c
> index e2c3c0e..6038cba 100644
> --- a/mm/slob.c
> +++ b/mm/slob.c
> @@ -533,7 +533,8 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
> {
> struct kmem_cache *c;
>
> - c = slob_alloc(sizeof(struct kmem_cache), flags, 0, -1);
> + c = slob_alloc(sizeof(struct kmem_cache),
> + flags, ARCH_KMALLOC_MINALIGN, -1);
>
> if (c) {
> c->name = name;
--
Mathematics is the supreme nostalgia of our time.



\
 
 \ /
  Last update: 2008-04-25 18:17    [W:0.536 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site