On 07/24/2018 03:38 PM, Laura Abbott wrote: > On 07/23/2018 09:24 PM, Mike Kravetz wrote: >> With v4.17, I can see an issue like those addressed in commits 3c605096d315 >> ("mm/page_alloc: restrict max order of merging on isolated pageblock") >> and d9dddbf55667 ("mm/page_alloc: prevent merging between isolated and >> other pageblocks"). After running a CMA stress test for a while, I see: >> MemTotal: 8168384 kB >> MemFree: 8457232 kB >> MemAvailable: 9204844 kB >> If I let the test run, MemFree and MemAvailable will continue to grow. >> >> I am certain the issue is with pageblocks of migratetype ISOLATED. If >> I disable all special 'is_migrate_isolate' checks in freepage accounting, >> the issue goes away. Further, I am pretty sure the issue has to do with >> pageblock merging and or page orders spanning pageblocks. If I make >> pageblock_order equal MAX_ORDER-1, the issue also goes away. >> >> Just looking for suggesting in where/how to debug. I've been hacking on >> this without much success. >> -- >> Mike Kravetz >> > > If you revert d883c6cf3b39 ("Revert "mm/cma: manage the memory of the CMA > area by using the ZONE_MOVABLE"") do you still see the issue? I thought > there was another isolation edge case which was fixed by that series. > Thanks Laura, Reverting that patch certainly seems to help. Although, I'm guessing there is still some accounting issue even with the patch reverted. Right after boot, MemTotal: 8168380 kB MemFree: 7233360 kB MemAvailable: 7317704 kB After stress testing for a couple hours, MemTotal: 8168380 kB MemFree: 7848468 kB MemAvailable: 7634856 kB While looking at the code, I did not like the way set_migratetype_isolate may 'isolate' more than pageblock_nr_pages if there is a > pageblock_order sized free page. This seems to work because alloc_contig_range always aligns to MAX_ORDER-1. But, I'd like to change this and see if it helps. -- Mike Kravetz