On Fri 17-01-20 16:35:03, Tianyu Lan wrote: [...] > > Could you describe your usecase in more details please? > > Hyper-V sends hot-remove request message which just contains requested > page number but not provide detail range. So Hyper-V driver needs to search > suitable memory block in system memory to return back to host if there is no > memory hot-add before. So I used the is_mem_section_removable() do such check. As David described, you would be much better of by using alloc_contig_range to find a memory that would be suitable for hotremoving without any races. -- Michal Hocko SUSE Labs