On Sun, 28 Jun 2020, 孙世龙 sunshilong wrote: > >>Are there still some methods that could be used by the Linux kernel > >> to reduce memory fragmentation? > > > >Without compaction or migration, that's just about it. > Do you mean there are no other methods that could be used to > achieve this goal? > Without compaction and migration, we don't have the ability to move pages around for defragmentation so any strategy can only be used at allocation time. __rmqueue_smallest() will attempt to take the smallest possible free page to leave higher order pages available in an attempt to consolidate allocations on the smallest set of pageblocks as possible given the allocation migratetype. When we do have to fallback to a pageblock of a different migratetype, we take the largest possible free page and convert it over if it's at least half free for subsequent allocations of the desired migratetype. That's the extent that we can do this at allocation time.