Re: [Nouveau] [PATCH] drm/nouveau: fix memory leak in nouveau_conn_reset()

2019-07-03 Thread Ben Skeggs
On Mon, 1 Jul 2019 at 12:37, Yongxin Liu wrote: > > In nouveau_conn_reset(), if connector->state is true, > __drm_atomic_helper_connector_destroy_state() will be called, > but the memory pointed by asyc isn't freed. Memory leak happens > in the following function

[Nouveau] [PATCH 4/6] nouveau: unlock mmap_sem on all errors from nouveau_range_fault

2019-07-03 Thread Christoph Hellwig
Currently nouveau_svm_fault expects nouveau_range_fault to never unlock mmap_sem, but the latter unlocks it for a random selection of error codes. Fix this up by always unlocking mmap_sem for non-zero return values in nouveau_range_fault, and only unlocking it in the caller for successful returns.

[Nouveau] hmm_range_fault related fixes and legacy API removal v2

2019-07-03 Thread Christoph Hellwig
Hi Jérôme, Ben and Jason, below is a series against the hmm tree which fixes up the mmap_sem locking in nouveau and while at it also removes leftover legacy HMM APIs only used by nouveau. Changes since v1: - don't return the valid state from hmm_range_unregister - additional nouveau cleanups

[Nouveau] [PATCH 6/6] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Christoph Hellwig
Switch the one remaining user in nouveau over to its replacement, and remove all the wrappers. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell Reviewed-by: Jason Gunthorpe --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- include/linux/hmm.h| 34

[Nouveau] [PATCH 2/6] mm: move hmm_vma_range_done and hmm_vma_fault to nouveau

2019-07-03 Thread Christoph Hellwig
These two functions are marked as a legacy APIs to get rid of, but seem to suit the current nouveau flow. Move it to the only user in preparation for fixing a locking bug involving caller and callee. All comments referring to the old API have been removed as this now is a driver private helper.

[Nouveau] [PATCH 5/6] nouveau: return -EBUSY when hmm_range_wait_until_valid fails

2019-07-03 Thread Christoph Hellwig
-EAGAIN has a magic meaning for non-blocking faults, so don't overload it. Given that the caller doesn't check for specific error codes this change is purely cosmetic. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- 1 file changed, 1 insertion(+), 1

[Nouveau] [PATCH 3/6] nouveau: remove the block parameter to nouveau_range_fault

2019-07-03 Thread Christoph Hellwig
The parameter is always false, so remove it as well as the -EAGAIN handling that can only happen for the non-blocking case. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_svm.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 1/6] mm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot}

2019-07-03 Thread Christoph Hellwig
We should not have two different error codes for the same condition. In addition this really complicates the code due to the special handling of EAGAIN that drops the mmap_sem due to the FAULT_FLAG_ALLOW_RETRY logic in the core vm. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell

Re: [Nouveau] [PATCH 4/5] nouveau: unlock mmap_sem on all errors from nouveau_range_fault

2019-07-03 Thread Christoph Hellwig
On Wed, Jul 03, 2019 at 01:46:02PM -0700, Ralph Campbell wrote: > You can delete the comment "With the old API the driver must ..." > (not visible in the patch here). Sure. > I suggest moving the two assignments: > range->default_flags = 0; > range->pfn_flags_mask = -1UL; > to just

Re: [Nouveau] [PATCH 4/5] nouveau: unlock mmap_sem on all errors from nouveau_range_fault

2019-07-03 Thread Ralph Campbell
On 7/3/19 11:45 AM, Christoph Hellwig wrote: Currently nouveau_svm_fault expects nouveau_range_fault to never unlock mmap_sem, but the latter unlocks it for a random selection of error codes. Fix this up by always unlocking mmap_sem for non-zero return values in nouveau_range_fault, and only

Re: [PATCH 1/5] mm: return valid info from hmm_range_unregister

2019-07-03 Thread Jason Gunthorpe
On Wed, Jul 03, 2019 at 10:28:57PM +0200, Christoph Hellwig wrote: > On Wed, Jul 03, 2019 at 07:00:50PM +, Jason Gunthorpe wrote: > > I don't think the API should be encouraging some shortcut here.. > > > > We can't do the above pattern because the old hmm_vma API didn't allow > > it, which

[PATCH] nouveau: remove bogus uses of DMA_ATTR_SKIP_CPU_SYNC

2019-07-03 Thread Christoph Hellwig
DMA_ATTR_SKIP_CPU_SYNC should only be used when the driver manually performs dma cache maintainance operations using the dma_sync_* calls. Nouveau doesn't do that, and generally just assumes DMA is coherent. Use plain dma_map_page which doesn't make this code correct but at least a little less

Re: [PATCH 1/5] mm: return valid info from hmm_range_unregister

2019-07-03 Thread Christoph Hellwig
On Wed, Jul 03, 2019 at 07:00:50PM +, Jason Gunthorpe wrote: > I don't think the API should be encouraging some shortcut here.. > > We can't do the above pattern because the old hmm_vma API didn't allow > it, which is presumably a reason why it is obsolete. > > I'd rather see drivers move to

Re: [PATCH 5/5] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Ralph Campbell
On 7/3/19 11:45 AM, Christoph Hellwig wrote: Switch the one remaining user in nouveau over to its replacement, and remove all the wrappers. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +-

[Nouveau] [Bug 111044] Resume up from suspend sometimes freezes system (Optimus/Nouveau)

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111044 JM9 changed: What|Removed |Added Assignee|nouveau@lists.freedesktop.o |ch...@chris-wilson.co.uk |rg

[Nouveau] [Bug 111044] Resume up from suspend sometimes freezes system (Optimus/Nouveau)

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111044 --- Comment #9 from JM9 --- Yes, on resume, I typically don't have the external monitors connected, so it is the internal screen that displays the nouveau messages and appears to freeze. I'm using Wayland compositor (SwayWM:

[Nouveau] [Bug 111044] Resume up from suspend sometimes freezes system (Optimus/Nouveau)

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111044 --- Comment #8 from Ilia Mirkin --- (In reply to JM9 from comment #7) > ok, thanks. This is what it looks like with all the monitors connected: > > /sys/class/drm/card0-eDP-1/status:connected > /sys/class/drm/card0-VGA-1/status:connected >

Re: [PATCH 1/5] mm: return valid info from hmm_range_unregister

2019-07-03 Thread Jason Gunthorpe
On Wed, Jul 03, 2019 at 11:44:58AM -0700, Christoph Hellwig wrote: > Checking range->valid is trivial and has no meaningful cost, but > nicely simplifies the fastpath in typical callers. It should not be the typical caller.. > hmm_vma_range_done function, which now is a trivial wrapper around

[Nouveau] [Bug 111044] Resume up from suspend sometimes freezes system (Optimus/Nouveau)

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111044 --- Comment #7 from JM9 --- ok, thanks. This is what it looks like with all the monitors connected: /sys/class/drm/card0-eDP-1/status:connected /sys/class/drm/card0-VGA-1/status:connected /sys/class/drm/card1-DP-1/status:connected

[Nouveau] hmm_range_fault related fixes and legacy API removal

2019-07-03 Thread Christoph Hellwig
Hi Jérôme, Ben and Jason, below is a series against the hmm tree which fixes up the mmap_sem locking in nouveau and while at it also removes leftover legacy HMM APIs only used by nouveau. ___ Nouveau mailing list Nouveau@lists.freedesktop.org

[Nouveau] [PATCH 5/5] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Christoph Hellwig
Switch the one remaining user in nouveau over to its replacement, and remove all the wrappers. Signed-off-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- include/linux/hmm.h| 34 -- 2 files

[PATCH 3/5] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Christoph Hellwig
hmm_vma_fault is marked as a legacy API to get rid of, but seems to suit the current nouveau flow. Move it to the only user in preparation for fixing a locking bug involving caller and callee. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell ---

[Nouveau] [PATCH 2/5] mm: always return EBUSY for invalid ranges in hmm_range_{fault, snapshot}

2019-07-03 Thread Christoph Hellwig
We should not have two different error codes for the same condition. In addition this really complicates the code due to the special handling of EAGAIN that drops the mmap_sem due to the FAULT_FLAG_ALLOW_RETRY logic in the core vm. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell

[Nouveau] [PATCH 1/5] mm: return valid info from hmm_range_unregister

2019-07-03 Thread Christoph Hellwig
Checking range->valid is trivial and has no meaningful cost, but nicely simplifies the fastpath in typical callers. Also remove the hmm_vma_range_done function, which now is a trivial wrapper around hmm_range_unregister. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell ---

[Nouveau] [PATCH 4/5] nouveau: unlock mmap_sem on all errors from nouveau_range_fault

2019-07-03 Thread Christoph Hellwig
Currently nouveau_svm_fault expects nouveau_range_fault to never unlock mmap_sem, but the latter unlocks it for a random selection of error codes. Fix this up by always unlocking mmap_sem for non-zero return values in nouveau_range_fault, and only unlocking it in the caller for successful returns.

Re: [Nouveau] [PATCH 22/22] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Jason Gunthorpe
On Wed, Jul 03, 2019 at 08:03:08PM +0200, Christoph Hellwig wrote: > On Wed, Jul 03, 2019 at 03:01:25PM -0300, Jason Gunthorpe wrote: > > Christoph, I guess you didn't mean to send this branch to the mailing > > list? > > > > In any event some of these, like this one, look obvious and I could > >

Re: [Nouveau] [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Jason Gunthorpe
On Wed, Jul 03, 2019 at 08:05:25PM +0200, Christoph Hellwig wrote: > On Wed, Jul 03, 2019 at 03:03:56PM -0300, Jason Gunthorpe wrote: > > I was thinking about doing exactly this too, but amdgpu started using > > this already obsolete API in their latest driver :( > > > > So, we now need to get

Re: [Nouveau] [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Christoph Hellwig
On Wed, Jul 03, 2019 at 03:03:56PM -0300, Jason Gunthorpe wrote: > I was thinking about doing exactly this too, but amdgpu started using > this already obsolete API in their latest driver :( > > So, we now need to get both drivers to move to the modern API. Actually the AMD folks fixed this up

Re: [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Jason Gunthorpe
On Mon, Jul 01, 2019 at 08:20:18AM +0200, Christoph Hellwig wrote: > hmm_vma_fault is marked as a legacy API to get rid of, but quite suites > the current nouvea flow. Move it to the only user in preparation for > fixing a locking bug involving caller and callee. > > Signed-off-by: Christoph

Re: [Nouveau] [PATCH 22/22] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Christoph Hellwig
On Wed, Jul 03, 2019 at 03:01:25PM -0300, Jason Gunthorpe wrote: > Christoph, I guess you didn't mean to send this branch to the mailing > list? > > In any event some of these, like this one, look obvious and I could > still grab a few for hmm.git. > > Let me know what you'd like please > >

Re: [Nouveau] [PATCH 22/22] mm: remove the legacy hmm_pfn_* APIs

2019-07-03 Thread Jason Gunthorpe
On Mon, Jul 01, 2019 at 08:20:20AM +0200, Christoph Hellwig wrote: > Switch the one remaining user in nouveau over to its replacement, > and remove all the wrappers. > > Signed-off-by: Christoph Hellwig > drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- > include/linux/hmm.h|

Re: [Nouveau] [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Ilia Mirkin
On Wed, Jul 3, 2019 at 1:49 PM Ralph Campbell wrote: > On 6/30/19 11:20 PM, Christoph Hellwig wrote: > > hmm_vma_fault is marked as a legacy API to get rid of, but quite suites > > the current nouvea flow. Move it to the only user in preparation for > > I didn't quite parse the phrase "quite

Re: [PATCH 20/22] mm: move hmm_vma_fault to nouveau

2019-07-03 Thread Ralph Campbell
On 6/30/19 11:20 PM, Christoph Hellwig wrote: hmm_vma_fault is marked as a legacy API to get rid of, but quite suites the current nouvea flow. Move it to the only user in preparation for I didn't quite parse the phrase "quite suites the current nouvea flow." s/nouvea/nouveau/ fixing a

Re: [PATCH 19/22] mm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot}

2019-07-03 Thread Ralph Campbell
On 6/30/19 11:20 PM, Christoph Hellwig wrote: We should not have two different error codes for the same condition. In addition this really complicates the code due to the special handling of EAGAIN that drops the mmap_sem due to the FAULT_FLAG_ALLOW_RETRY logic in the core vm. Signed-off-by:

Re: [PATCH 18/22] mm: return valid info from hmm_range_unregister

2019-07-03 Thread Ralph Campbell
On 6/30/19 11:20 PM, Christoph Hellwig wrote: Checking range->valid is trivial and has no meaningful cost, but nicely simplifies the fastpath in typical callers. Also remove the hmm_vma_range_done function, which now is a trivial wrapper around hmm_range_unregister. Signed-off-by: Christoph

[Nouveau] [Bug 111044] Resume up from suspend sometimes freezes system (Optimus/Nouveau)

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111044 --- Comment #6 from Ilia Mirkin --- (In reply to JM9 from comment #5) > I believe all screens (Display Ports) are wired to intel. If you think this > is an intel issue, I can file a bug there, but the nouveau message threw me. The error

[Nouveau] [Bug 111044] Resume up from suspend sometimes freezes system (Optimus/Nouveau)

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=111044 --- Comment #5 from JM9 --- I believe all screens (Display Ports) are wired to intel. If you think this is an intel issue, I can file a bug there, but the nouveau message threw me. -- You are receiving this mail because: You are the assignee

[Nouveau] [Bug 110714] Xorg crashes randomly because of memory leak

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110714 --- Comment #7 from Ilia Mirkin --- (In reply to Peter Draganov from comment #5) > @Ilia Mirkin > Additionally you're not using xf86-video-nouveau. (If you were, you wouldn't > be using glamor.) > I am not sure about this, but here is the log

[Nouveau] [Bug 110714] Xorg crashes randomly because of memory leak

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110714 --- Comment #6 from Karol Herbst --- (In reply to Peter Draganov from comment #4) > The problem persists in xorg-x11-server-Xorg-1.20.5-3.fc30.x86_64: > > [113930.196] (EE) glamor0: GL error: GL_OUT_OF_MEMORY in glTexSubImage > [113930.198]

[Nouveau] [Bug 110714] Xorg crashes randomly because of memory leak

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110714 --- Comment #5 from Peter Draganov --- @Ilia Mirkin Additionally you're not using xf86-video-nouveau. (If you were, you wouldn't be using glamor.) I am not sure about this, but here is the log for nouveau: [ 148.426] (II) modeset(0): [DRI2]

[Nouveau] [Bug 110714] Xorg crashes randomly because of memory leak

2019-07-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110714 Peter Draganov changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|NOTOURBUG