>>>> - Once all 4MB chunks of a memory block are offline, we can remove the >>>> memory block and therefore the struct pages (seems to work in my prototype), >>>> which is nice. >>> >>> OK, so our existing ballooning solutions indeed do not free up memmaps >>> which is suboptimal. >> >> And we would have to hack deep into the current offlining code to make >> it work (at least that's my understanding). >> >>> >>>> Todo: >>>> - We might have to add a parameter to offline_pages(), telling it to not >>>> try forever but abort in case it takes too long. >>> >>> Offlining fails when it see non-migrateable pages but other than that it >>> should always succeed in the finite time. If not then there is a bug to >>> be fixed. >> >> I just found the -EINTR in the offlining code and thought this might be >> problematic. (e.g. if somebody pins a page that is still to be migrated >> - or is that avoided by isolating?) I haven't managed to trigger this >> scenario yet. Was just a thought, that's why I mentioned it but didn't >> implement it. > > Offlining is a 3 stage thing. Check for unmovable pages and fail with > EBUSY, isolating free memory and migrating the rest. If the first 2 > succeed we expect the migration will finish in a finite time. BTW I was able to easily produce the case where do_migrate_range() would loop for ever (well at least for multiple minutes, but I assume this would have went on :) ) -- Thanks, David / dhildenb