Re: [PATCH 6/7] nouveau/dmem: Evict device private memory during release

From: John Hubbard
Date: Mon Sep 26 2022 - 18:16:31 EST


On 9/26/22 14:35, Lyude Paul wrote:
>> + for (i = 0; i < npages; i++) {
>> + if (src_pfns[i] & MIGRATE_PFN_MIGRATE) {
>> + struct page *dpage;
>> +
>> + /*
>> + * _GFP_NOFAIL because the GPU is going away and there
>> + * is nothing sensible we can do if we can't copy the
>> + * data back.
>> + */
>
> You'll have to excuse me for a moment since this area of nouveau isn't one of
> my strongpoints, but are we sure about this? IIRC __GFP_NOFAIL means infinite
> retry, in the case of a GPU hotplug event I would assume we would rather just
> stop trying to migrate things to the GPU and just drop the data instead of
> hanging on infinite retries.
>
Hi Lyude!

Actually, I really think it's better in this case to keep trying
(presumably not necessarily infinitely, but only until memory becomes
available), rather than failing out and corrupting data.

That's because I'm not sure it's completely clear that this memory is
discardable. And at some point, we're going to make this all work with
file-backed memory, which will *definitely* not be discardable--I
realize that we're not there yet, of course.

But here, it's reasonable to commit to just retrying indefinitely,
really. Memory should eventually show up. And if it doesn't, then
restarting the machine is better than corrupting data, generally.


thanks,

--
John Hubbard
NVIDIA