Re: [PATCH 1/2] mm/sparsemem: Defer the ms->section_mem_map clearing a little later

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

 



On 02/01/18 at 06:15am, Dave Hansen wrote:
> On 01/31/2018 11:19 PM, Baoquan He wrote:
> >  	for_each_present_section_nr(0, pnum) {
> > +		struct mem_section *ms;
> > +		ms = __nr_to_section(pnum);
> >  		usemap = usemap_map[pnum];
> > -		if (!usemap)
> > +		if (!usemap) {
> > +#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
> > +			ms->section_mem_map = 0;
> > +#endif
> >  			continue;
> > +		}
> >  
> >  #ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
> >  		map = map_map[pnum];
> >  #else
> >  		map = sparse_early_mem_map_alloc(pnum);
> >  #endif
> > -		if (!map)
> > +		if (!map) {
> > +#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER
> > +			ms->section_mem_map = 0;
> > +#endif
> >  			continue;
> > +		}
> 
> This is starting to look like code that only a mother could love.  Can
> this be cleaned up a bit?

Sorry, will try. Just wonder why we don't need to clear
ms->section_mem_map when CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER is not
set. Will look into to find reason.

--
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 OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux