On Mon 21-01-19 16:27:47, Qian Cai wrote: [...] Sorry to miss this before but you want to > +#define pfn_to_online_page(pfn) \ > +({ \ > + struct page *___page = NULL; \ unsigned long ___pfn = pfn; > + unsigned long ___nr = pfn_to_section_nr(pfn); \ pfn_to_section_nr(___pfn); > + \ > + if (___nr < NR_MEM_SECTIONS && online_section_nr(___nr) && \ > + pfn_valid_within(pfn)) \ pfn_valid_within(___pfn)) > + ___page = pfn_to_page(pfn); \ > + ___page; \ > }) to prevent from issues when pfn expression has side effects. -- Michal Hocko SUSE Labs