Skip to contentSkip to conversation

Is Nouveau really using the io_reserve_lru?

DISCUSSION Christian König 4 participants 4 messages Sep 24, 2019 – Sep 27, 2019 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi guys,

while working through more old TTM functionality I stumbled over the io_reserve_lru.

Basic idea is that when this flag is set the driver->io_mem_reserve() callback can return -EAGAIN resulting in unmapping of other BOs.

But Nouveau doesn't seem to return -EAGAIN in the call path of io_mem_reserve anywhere.

So is this unused or am I missing something?

Regards,
Christian.
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

#1 lore raw
Quoted 11 lines · Christian König

Hi guys,

while working through more old TTM functionality I stumbled over the io_reserve_lru.

Basic idea is that when this flag is set the driver->io_mem_reserve() callback can return -EAGAIN resulting in unmapping of other BOs.

But Nouveau doesn't seem to return -EAGAIN in the call path of io_mem_reserve anywhere.

I believe this is a bug in Nouveau. We *should* be returning -EAGAIN if we fail to find space in BAR1 to map the BO into.

Ben.

Quoted 9 lines

So is this unused or am I missing something?

Regards,
Christian.
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): CACAvsv7jwLeY04SyaGjPcRN-ZPaGdVUUY6tC5q33kSsdwJumdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#3 lore raw

Am 26.09.19 um 23:44 schrieb Ben Skeggs:

Quoted 7 lines
Quoted 5 lines · Christian König

Hi guys,

while working through more old TTM functionality I stumbled over the io_reserve_lru.

Quoted 7 lines
Quoted 5 lines

Basic idea is that when this flag is set the driver->io_mem_reserve() callback can return -EAGAIN resulting in unmapping of other BOs.

But Nouveau doesn't seem to return -EAGAIN in the call path of io_mem_reserve anywhere.

I believe this is a bug in Nouveau. We *should* be returning -EAGAIN if we fail to find space in BAR1 to map the BO into.

Yeah, thought that this is rather odd. But I can't fix it since I don't really know the code.

On the other hand do you have any objections that I move the remaining io_reserve_lru functionality into Nouveau then?

It's only used by this driver and since Thomas cleaned up the VM handling that shouldn't be a problem any more.

Thanks,
Christian.

Quoted 10 lines

Ben.

Quoted 8 lines

So is this unused or am I missing something?

Regards,
Christian.
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

#4 lore raw
In reply to a message not in the archive
Quoted 9 lines · Ben Skeggs
Quoted 6 lines · Christian König

Hi guys,

while working through more old TTM functionality I stumbled over the io_reserve_lru.

Quoted 7 lines
Quoted 5 lines

Basic idea is that when this flag is set the driver->io_mem_reserve() callback can return -EAGAIN resulting in unmapping of other BOs.

But Nouveau doesn't seem to return -EAGAIN in the call path of io_mem_reserve anywhere.

I believe this is a bug in Nouveau. We *should* be returning -EAGAIN if we fail to find space in BAR1 to map the BO into.

Could this lead to SIGBUS in userspace, esp related to resume and similar situations? A user has been experiencing this in a tricky-to-reproduce scenario with a ton of vram dedicated to framebuffers and so on (3x 4K), and the nouveau ddx falls back to memcpy in certain cases.

-ilia
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau