[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090428044102.GC6304@wotan.suse.de>
Date: Tue, 28 Apr 2009 06:41:02 +0200
From: Nick Piggin <npiggin@...e.de>
To: David Rientjes <rientjes@...gle.com>
Cc: Pekka Enberg <penberg@...helsinki.fi>, linux-kernel@...r.kernel.org
Subject: Re: [patch] slqb: enforce MAX_ORDER
On Sun, Apr 26, 2009 at 12:56:31PM -0700, David Rientjes wrote:
> Slabs may not be allocated at MAX_ORDER or higher.
>
> Cc: Nick Piggin <npiggin@...e.de>
> Signed-off-by: David Rientjes <rientjes@...gle.com>
Thanks
> ---
> mm/slqb.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slqb.c b/mm/slqb.c
> --- a/mm/slqb.c
> +++ b/mm/slqb.c
> @@ -872,6 +872,7 @@ __setup("slqb_debug", setup_slqb_debug);
> static int __init setup_slqb_min_order(char *str)
> {
> get_option(&str, &slqb_min_order);
> + slqb_min_order = min(slqb_min_order, MAX_ORDER - 1);
>
> return 1;
> }
> @@ -1840,8 +1841,8 @@ static int calculate_order(int size)
> * This size cannot fit in order-1. Allow bigger orders, but
> * forget about trying to save space.
> */
> - order = slab_order(size, MAX_ORDER, 0);
> - if (order <= MAX_ORDER)
> + order = slab_order(size, MAX_ORDER - 1, 0);
> + if (order < MAX_ORDER)
> return order;
>
> return -ENOSYS;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists