Re: [PATCH -v5 0/9] migrate_pages(): batch TLB flushing

From: Huang, Ying
Date: Tue Feb 21 2023 - 20:04:30 EST


Hugh Dickins <hughd@xxxxxxxxxx> writes:

> On Tue, 21 Feb 2023, Huang, Ying wrote:
>>
>> On second thought, I think that it may be better to provide a fix as
>> simple as possible firstly. Then we can work on a more complex fix as
>> we discussed above. The simple fix is easy to review now. And, we will
>> have more time to test and review the complex fix.
>>
>> In the following fix, I disabled the migration batching except for the
>> MIGRATE_ASYNC mode, or the split folios of a THP folio. After that, I
>> will work on the complex fix to enable migration batching for all modes.
>>
>> What do you think about that?
>
> I don't think there's a need to rush in the wrong fix so quickly.
> Your series was in (though sometimes out of) linux-next for some
> while, without causing any widespread problems. Andrew did send
> it to Linus yesterday, I expect he'll be pushing it out later today
> or tomorrow, but I don't think it's going to cause big problems.
> Aiming for a fix in -rc2 would be good.

Sure, I will target to fix in -rc2. Thanks for suggestion!

> Why would it be complex?

Now, I think the big picture could be,

if (MIGRATE_ASYNC) {
migrate_pages_batch(from,);
} else {
migrate_pages_batch(from,, MIGRATE_ASYNC,);
list_for_each_entry_safe (folio,, from) {
migrate_pages_batch(one_folio, , MIGRATE_SYNC,);
}
}

That is, for synchronous migration, try asynchronous batched migration
firstly, then fall back to synchronous migration one by one. This will
make the retry logic easier to be understood.

This needs some code change. Anyway, I will try to do that and show the
code.

Best Regards,
Huang, Ying