Re: [PATCH] x86: introduce bootmem_state

Yinghai Lu
2009-03-06T18:22:36Z

Ingo Molnar wrote:
> * Yinghai Lu <yinghai@kernel.org> wrote:
>
>> Impact: cleanup
>>
>> extend after_bootmem and after_init_bootmem to bootmem_state
>> and will have BEFORE_BOOTMEM, DURING_BOOTMEM, AFTER_BOOTMEM
>
> Ok, that indeed makes all these bootstrap initialization details
> cleaner and more transparent.
>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>
>> ---
>> arch/x86/kernel/setup.c | 1 +
>> arch/x86/mm/init.c | 13 +++++++------
>> arch/x86/mm/init_32.c | 28 ++++++++++++++++++++--------
>> arch/x86/mm/init_64.c | 33 +++++++++++++++++++--------------
>> include/linux/mm.h | 8 ++++++++
>> 5 files changed, 55 insertions(+), 28 deletions(-)
>
> Note: "git grep after_bootmem" will show you another affected
> architecture as well.

that is sh, will send patch to them later if needed.

>
>> +++ linux-2.6/include/linux/mm.h
>> @@ -1067,6 +1067,14 @@ extern void __init mmap_init(void);
>> extern void show_mem(void);
>> extern void si_meminfo(struct sysinfo * val);
>> extern void si_meminfo_node(struct sysinfo *val, int nid);
>> +
>> +enum bootmem_state_t {
>> + BEFORE_BOOTMEM = 0,
>
> (nit: =0 is not required. )
some other enum, has it too...
>
>> + DURING_BOOTMEM,
>> + AFTER_BOOTMEM
>> +};
>> +extern enum bootmem_state_t bootmem_state;
>
> (nit: we put newlines after enum definitions)

ok

YH