Re: [PATCH 1/5] mm/sparse: check size of struct mm_section

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

 



>> >> In order to fully utilize the memory chunk allocated from bootmem
>> >> allocator, it'd better to assure memory sector descriptor won't run
>> >> across the boundary (PAGE_SIZE).
>
>OK, I misread this part of the changelog changelog.
>

I should have clarified that more clear :-)

>> >
>> >Why? The memory is continuous, right?
>> 
>> Yes, the memory is conginous and the capacity of specific entry
>> in mem_section[NR_SECTION_ROOTS] has been defined as follows:
>> 
>> 
>> #define SECTIONS_PER_ROOT       (PAGE_SIZE / sizeof (struct mem_section))
>> 
>> Also, the memory is prone to be allocated from bootmem by function
>> alloc_bootmem_node(), which has PAGE_SIZE alignment. So I think it's
>> reasonable to introduce the extra check here from my personal view :-)
>
>No it is not necessary because we will never cross the page boundary
>because (SECTIONS_PER_ROOT uses an int division)

Current situation is that we don't cross the page foundary, but somebody
else might change the data struct (struct mem_section) in future. It will
trigger warning at build time to alarm that the struct should fit with
page size.

Anyway, I will drop this in next revision if you want keep as of being.
Otherwise, I will include it in next revision :-)

Thanks for your time, Michal.

Thanks,
Gavin

>-- 
>Michal Hocko
>SUSE Labs
>SUSE LINUX s.r.o.
>Lihovarska 1060/12
>190 00 Praha 9    
>Czech Republic
>
>--
>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]