Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

From: Pavel Tatashin
Date: Sun Jul 01 2018 - 21:47:22 EST


~~~
> Here, node id passed to sparse_init_nid() should be 'nid_begin', but not
> 'nid'. When you found out the current section's 'nid' is diferent than
> 'nid_begin', handle node 'nid_begin', then start to next node 'nid'.

Thank you for reviewing this work. Here nid equals to nid_begin:

See, "if" at 501, and this call is at 505.

492 void __init sparse_init(void)
493 {
494 unsigned long pnum_begin = first_present_section_nr();
495 int nid_begin = sparse_early_nid(__nr_to_section(pnum_begin));
496 unsigned long pnum_end, map_count = 1;
497
498 for_each_present_section_nr(pnum_begin + 1, pnum_end) {
499 int nid = sparse_early_nid(__nr_to_section(pnum_end));
500
501 if (nid == nid_begin) {
502 map_count++;
503 continue;
504 }
505 sparse_init_nid(nid, pnum_begin, pnum_end, map_count);
506 nid_begin = nid;
507 pnum_begin = pnum_end;
508 map_count = 1;
509 }
510 sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count);
511 vmemmap_populate_print_last();
512 }

Thank you,
Pavel