Re: [PATCH 5/5] mm/sparse: return 0 if root mem_section exists

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

 



>> Function sparse_index_init() is used to setup memory section descriptors
>> dynamically. zero should be returned while mem_section[root] already has
>> been allocated.
>
>Why?
>

When CONFIG_SPARSEMEM_EXTREME is enabled, the memory section descriptors are
allocated dynamically and stored into "struct mem_section *mem_section[NR_SECTION_ROOTS]".

It's possible for multiple sections (e.g. 0, 1) sharing "mem_section[0]". When setup
the descriptor for section 0, the mem_section descriptor for section 1 should have
been created as well. So we needn't do same thing (actually duplicate) for section 1.

And the function returns "-EEXIST" in sparse_index_init() for section 1, which indicates
errors. Actually, here we need "0".

Does it make sense?

Thanks,
Gavin

>--
>To unsubscribe, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
>see: http://www.linux-mm.org/ .
>Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]