All of lore.kernel.org
 help / color / mirror / Atom feed
* Is Nouveau really using the io_reserve_lru?
@ 2019-09-24 12:19 Christian König
  2019-09-26 21:44 ` [Nouveau] " Ben Skeggs
  0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2019-09-24 12:19 UTC (permalink / raw)
  To: Ben Skeggs, Dave Airlie, Daniel Vetter,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, nouveau

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
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Nouveau] Is Nouveau really using the io_reserve_lru?
  2019-09-24 12:19 Is Nouveau really using the io_reserve_lru? Christian König
@ 2019-09-26 21:44 ` Ben Skeggs
       [not found]   ` <CACAvsv7jwLeY04SyaGjPcRN-ZPaGdVUUY6tC5q33kSsdwJumdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Skeggs @ 2019-09-26 21:44 UTC (permalink / raw)
  To: Christian König; +Cc: Dave Airlie, nouveau, dri-devel, Ben Skeggs

On Tue, 24 Sep 2019 at 22:19, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> 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.
>
> So is this unused or am I missing something?
>
> Regards,
> Christian.
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is Nouveau really using the io_reserve_lru?
       [not found]   ` <CACAvsv7jwLeY04SyaGjPcRN-ZPaGdVUUY6tC5q33kSsdwJumdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-09-27 12:19     ` Koenig, Christian
  2019-09-27 18:07     ` Ilia Mirkin
  1 sibling, 0 replies; 5+ messages in thread
From: Koenig, Christian @ 2019-09-27 12:19 UTC (permalink / raw)
  To: Ben Skeggs
  Cc: Dave Airlie, nouveau, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Ben Skeggs, Daniel Vetter

Am 26.09.19 um 23:44 schrieb Ben Skeggs:
> On Tue, 24 Sep 2019 at 22:19, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> 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.

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.

>
> Ben.
>> So is this unused or am I missing something?
>>
>> Regards,
>> Christian.
>> _______________________________________________
>> Nouveau mailing list
>> Nouveau@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is Nouveau really using the io_reserve_lru?
       [not found]   ` <CACAvsv7jwLeY04SyaGjPcRN-ZPaGdVUUY6tC5q33kSsdwJumdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2019-09-27 12:19     ` Koenig, Christian
@ 2019-09-27 18:07     ` Ilia Mirkin
  1 sibling, 0 replies; 5+ messages in thread
From: Ilia Mirkin @ 2019-09-27 18:07 UTC (permalink / raw)
  To: Ben Skeggs
  Cc: Dave Airlie, nouveau, Christian König,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Ben Skeggs

On Thu, Sep 26, 2019 at 5:44 PM Ben Skeggs <skeggsb@gmail.com> wrote:
>
> On Tue, 24 Sep 2019 at 22:19, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
> >
> > 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.

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
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is Nouveau really using the io_reserve_lru?
@ 2019-09-27 18:08 Koenig, Christian
  0 siblings, 0 replies; 5+ messages in thread
From: Koenig, Christian @ 2019-09-27 18:08 UTC (permalink / raw)
  To: Ilia Mirkin
  Cc: Dave Airlie, nouveau, Ben Skeggs,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1107 bytes --]



Am 27.09.2019 20:07 schrieb Ilia Mirkin <imirkin@alum.mit.edu>:
On Thu, Sep 26, 2019 at 5:44 PM Ben Skeggs <skeggsb@gmail.com> wrote:
>
> On Tue, 24 Sep 2019 at 22:19, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
> >
> > 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.

Could this lead to SIGBUS in userspace, esp related to resume and
similar situations?

Yes, I would say that's exactly what would happen.

Christian.

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


[-- Attachment #1.2: Type: text/html, Size: 2200 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-27 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 12:19 Is Nouveau really using the io_reserve_lru? Christian König
2019-09-26 21:44 ` [Nouveau] " Ben Skeggs
     [not found]   ` <CACAvsv7jwLeY04SyaGjPcRN-ZPaGdVUUY6tC5q33kSsdwJumdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-09-27 12:19     ` Koenig, Christian
2019-09-27 18:07     ` Ilia Mirkin
2019-09-27 18:08 Koenig, Christian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.