bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnumach: kalloc: Zone determining and constants optimization


From: Samuel Thibault
Subject: Re: [PATCH] gnumach: kalloc: Zone determining and constants optimization
Date: Wed, 30 Mar 2011 11:11:23 +0200
User-agent: Mutt/1.5.12-2006-07-14

Maksym Planeta, le Wed 30 Mar 2011 08:49:01 +0300, a écrit :
> +#define KALLOC_MAP_SIZE 8 * 1024 * 1024
> +#define ZONE_START_ORDER 4
> +#define ZONES_COUNT 12
> +#define ZONE_MAX_ORDER (ZONES_COUNT + ZONE_START_ORDER - 1)
> +#define SIZE_BY_ORDER(x) (1UL << (ZONE_START_ORDER + x))
> +#define ZONE_MAX_SIZE SIZE_BY_ORDER(ZONES_COUNT - 1)
> +#define MINSIZE (1 << ZONE_START_ORDER)
> +#define KALLOC_MAX ((PAGE_SIZE < ZONE_MAX_SIZE) ? KALLOC_MAX = ZONE_MAX_SIZE 
> : PAGE_SIZE)

Please separate tunable parameters from computed parameters.

>       kalloc_map = kmem_suballoc(kernel_map, &min, &max,
> -                                kalloc_map_size, FALSE);
> +                     KALLOC_MAP_SIZE, FALSE);

Please keep indentation as it is: the start of the second line is
aligned with the parenthesis.

>  
> -void
> +     void
>  kfree(data, size)

Please avoid spurious changes.

I'll have to have a closer look, but the principles seem sane (though I
don't think that's what will make Mach a lot faster :) )

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]