Michal Hocko <mhocko@xxxxxxx> writes: > On Mon 22-07-13 17:36:26, Joonsoo Kim wrote: >> Current node iteration code have a minor problem which do one more >> node rotation if we can't succeed to allocate. For example, >> if we start to allocate at node 0, we stop to iterate at node 0. >> Then we start to allocate at node 1 for next allocation. >> >> I introduce new macros "for_each_node_mask_to_[alloc|free]" and >> fix and clean-up node iteration code to alloc or free. >> This makes code more understandable. > > I don't know but it feels like you are trying to fix an awkward > interface with another one. Why hstate_next_node_to_alloc cannot simply > return MAX_NUMNODES once the loop is done and start from first_node next > time it is called? We wouldn't have the bug you are mentioning and you > do not need scary looking macros. > Even though the macros looks confusing, the changes do help rest of the code. for ex: I liked how it made alloc simpler. + for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) { + page = alloc_fresh_huge_page_node(h, node); -aneesh -- 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>