Re: [PATCH 1/4] mm: adjust reserved highatomic count

From: Vlastimil Babka
Date: Mon Oct 10 2016 - 03:33:53 EST


On 10/07/2016 04:29 PM, Minchan Kim wrote:
In that case, we should adjust nr_reserved_highatomic.
Otherwise, VM cannot reserve highorderatomic pageblocks any more
although it doesn't reach 1% limit. It means highorder atomic
allocation failure would be higher.

So, this patch decreases the account as well as migratetype
if it was MIGRATE_HIGHATOMIC.

Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx>

Hm wouldn't it be simpler just to prevent the pageblock's migratetype to be
changed if it's highatomic? Possibly also not do move_freepages_block() in

It could be. Actually, I did it with modifying can_steal_fallback which returns
false it found the pageblock is highorderatomic but changed to this way again
because I don't have any justification to prevent changing pageblock.
If you give concrete justification so others isn't against on it, I am happy to
do what you suggested.

Well, MIGRATE_HIGHATOMIC is not listed in the fallbacks array at all, so we are not supposed to steal from it in the first place. Stealing will only happen due to races, which would be too costly to close, so we allow them and expect to be rare. But we shouldn't allow them to break the accounting.