Re: [PATCH v6 08/13] mm: call pgmap->ops->page_free for DEVICE_GENERIC pages

2021-08-20 Thread Jerome Glisse
On Thu, Aug 19, 2021 at 10:05 PM Christoph Hellwig wrote: > > On Tue, Aug 17, 2021 at 11:44:54AM -0400, Felix Kuehling wrote: > > >> That's a good catch. Existing drivers shouldn't need a page_free > > >> callback if they didn't have one before. That means we need to add a > > >> NULL-pointer

Re: [PATCH v6 02/13] mm: remove extra ZONE_DEVICE struct page refcount

2021-08-20 Thread Jerome Glisse
On Thu, Aug 19, 2021 at 11:00 AM Sierra Guiza, Alejandro (Alex) wrote: > > > On 8/18/2021 2:28 PM, Ralph Campbell wrote: > > On 8/17/21 5:35 PM, Felix Kuehling wrote: > >> Am 2021-08-17 um 8:01 p.m. schrieb Ralph Campbell: > >>> On 8/12/21 11:31 PM, Alex Sierra wrote: > From: Ralph Campbell

Re: [PATCH v6 02/13] mm: remove extra ZONE_DEVICE struct page refcount

2021-08-20 Thread Jerome Glisse
Note that you do not want GUP to succeed on device page, i do not see where that is handled in the new code. On Sun, Aug 15, 2021 at 1:40 PM John Hubbard wrote: > > On 8/15/21 8:37 AM, Christoph Hellwig wrote: > >> diff --git a/include/linux/mm.h b/include/linux/mm.h > >> index

Re: [PATCH 0/9] Add support for SVM atomics in Nouveau

2021-02-09 Thread Jerome Glisse
On Tue, Feb 09, 2021 at 09:35:20AM -0400, Jason Gunthorpe wrote: > On Tue, Feb 09, 2021 at 11:57:28PM +1100, Alistair Popple wrote: > > On Tuesday, 9 February 2021 9:27:05 PM AEDT Daniel Vetter wrote: > > > > > > > > Recent changes to pin_user_pages() prevent the creation of pinned pages > > > >

Re: HMM fence (was Re: [PATCH 00/35] Add HMM-based SVM memory manager to KFD)

2021-01-14 Thread Jerome Glisse
On Thu, Jan 14, 2021 at 02:37:36PM +0100, Christian König wrote: > Am 14.01.21 um 12:52 schrieb Daniel Vetter: > > [SNIP] > > > > I had a new idea, i wanted to think more about it but have not yet, > > > > anyway here it is. Adding a new callback to dma fence which ask the > > > > question can it

Re: [PATCH 00/35] Add HMM-based SVM memory manager to KFD

2021-01-13 Thread Jerome Glisse
On Wed, Jan 13, 2021 at 09:31:11PM +0100, Daniel Vetter wrote: > On Wed, Jan 13, 2021 at 5:56 PM Jerome Glisse wrote: > > On Fri, Jan 08, 2021 at 03:40:07PM +0100, Daniel Vetter wrote: > > > On Thu, Jan 07, 2021 at 11:25:41AM -0500, Felix Kuehling wrote: > > > > Am 2

Re: [PATCH 00/35] Add HMM-based SVM memory manager to KFD

2021-01-13 Thread Jerome Glisse
On Fri, Jan 08, 2021 at 03:40:07PM +0100, Daniel Vetter wrote: > On Thu, Jan 07, 2021 at 11:25:41AM -0500, Felix Kuehling wrote: > > Am 2021-01-07 um 4:23 a.m. schrieb Daniel Vetter: > > > On Wed, Jan 06, 2021 at 10:00:52PM -0500, Felix Kuehling wrote: > > >> This is the first version of our HMM

Re: [PATCH 00/35] Add HMM-based SVM memory manager to KFD

2021-01-13 Thread Jerome Glisse
On Wed, Jan 06, 2021 at 10:00:52PM -0500, Felix Kuehling wrote: > This is the first version of our HMM based shared virtual memory manager > for KFD. There are still a number of known issues that we're working through > (see below). This will likely lead to some pretty significant changes in > MMU

Re: [PATCH 1/2] drm/ttm: rework ttm_tt page limit v2

2020-12-17 Thread Jerome Glisse
On Thu, Dec 17, 2020 at 07:19:07PM +0100, Daniel Vetter wrote: > On Thu, Dec 17, 2020 at 7:09 PM Jerome Glisse wrote: > > > > Adding few folks on cc just to raise awareness and so that i > > could get corrected if i said anything wrong. > > > > On Thu, Dec 17,

Re: [PATCH 1/2] drm/ttm: rework ttm_tt page limit v2

2020-12-17 Thread Jerome Glisse
Adding few folks on cc just to raise awareness and so that i could get corrected if i said anything wrong. On Thu, Dec 17, 2020 at 04:45:55PM +0100, Daniel Vetter wrote: > On Thu, Dec 17, 2020 at 4:36 PM Christian König > wrote: > > Am 17.12.20 um 16:26 schrieb Daniel Vetter: > > > On Thu, Dec

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-22 Thread Jerome Glisse
On Mon, Jun 22, 2020 at 08:46:17AM -0300, Jason Gunthorpe wrote: > On Fri, Jun 19, 2020 at 04:31:47PM -0400, Jerome Glisse wrote: > > Not doable as page refcount can change for things unrelated to GUP, with > > John changes we can identify GUP and we could potentialy copy GUPed p

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-19 Thread Jerome Glisse
On Fri, Jun 19, 2020 at 10:43:20PM +0200, Daniel Vetter wrote: > On Fri, Jun 19, 2020 at 10:10 PM Jerome Glisse wrote: > > > > On Fri, Jun 19, 2020 at 03:18:49PM -0300, Jason Gunthorpe wrote: > > > On Fri, Jun 19, 2020 at 02:09:35PM -0400, Jerome Glisse wrote: > >

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-19 Thread Jerome Glisse
On Fri, Jun 19, 2020 at 04:55:38PM -0300, Jason Gunthorpe wrote: > On Fri, Jun 19, 2020 at 03:48:49PM -0400, Felix Kuehling wrote: > > Am 2020-06-19 um 2:18 p.m. schrieb Jason Gunthorpe: > > > On Fri, Jun 19, 2020 at 02:09:35PM -0400, Jerome Glisse wrote: > > >> On F

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-19 Thread Jerome Glisse
On Fri, Jun 19, 2020 at 03:18:49PM -0300, Jason Gunthorpe wrote: > On Fri, Jun 19, 2020 at 02:09:35PM -0400, Jerome Glisse wrote: > > On Fri, Jun 19, 2020 at 02:23:08PM -0300, Jason Gunthorpe wrote: > > > On Fri, Jun 19, 2020 at 06:19:41PM +0200, Daniel Vetter wrote: > >

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-19 Thread Jerome Glisse
On Fri, Jun 19, 2020 at 03:30:32PM -0400, Felix Kuehling wrote: > > Am 2020-06-19 um 3:11 p.m. schrieb Alex Deucher: > > On Fri, Jun 19, 2020 at 2:09 PM Jerome Glisse wrote: > >> On Fri, Jun 19, 2020 at 02:23:08PM -0300, Jason Gunthorpe wrote: > >>> On Fri,

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-19 Thread Jerome Glisse
On Thu, Jun 11, 2020 at 07:35:35PM -0400, Felix Kuehling wrote: > Am 2020-06-11 um 10:15 a.m. schrieb Jason Gunthorpe: > > On Thu, Jun 11, 2020 at 10:34:30AM +0200, Daniel Vetter wrote: > >>> I still have my doubts about allowing fence waiting from within shrinkers. > >>> IMO ideally they should

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-19 Thread Jerome Glisse
On Fri, Jun 19, 2020 at 02:23:08PM -0300, Jason Gunthorpe wrote: > On Fri, Jun 19, 2020 at 06:19:41PM +0200, Daniel Vetter wrote: > > > The madness is only that device B's mmu notifier might need to wait > > for fence_B so that the dma operation finishes. Which in turn has to > > wait for device

Re: [GIT PULL] Please pull hmm changes

2019-12-05 Thread Jerome Glisse
On Tue, Dec 03, 2019 at 02:42:12AM +, Jason Gunthorpe wrote: > On Sat, Nov 30, 2019 at 10:23:31AM -0800, Linus Torvalds wrote: > > On Sat, Nov 30, 2019 at 10:03 AM Linus Torvalds > > wrote: > > > > > > I'll try to figure the code out, but my initial reaction was "yeah, > > > not in my VM". >

Re: [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-12-04 Thread Jerome Glisse
On Tue, Dec 03, 2019 at 11:19:43AM -0800, Niranjan Vishwanathapura wrote: > On Tue, Nov 26, 2019 at 06:32:52PM +, Jason Gunthorpe wrote: > > On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote: > > > On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: &

Re: [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Jerome Glisse
On Mon, Nov 25, 2019 at 01:24:18PM +, Jason Gunthorpe wrote: > On Sun, Nov 24, 2019 at 01:12:47PM -0800, Niranjan Vishwanathapura wrote: > > > > > > Using a temporary range is the pattern from nouveau, is it really > > > > > necessary in this driver? > > > > > > > > Yah, not required. In my

Re: [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Jerome Glisse
On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: [...] > > +static int > > +i915_range_fault(struct i915_svm *svm, struct hmm_range *range) > > +{ > > + long ret; > > + > > + range->default_flags =

Re: [PATCH v4 04/23] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-13 Thread Jerome Glisse
On Wed, Nov 13, 2019 at 02:00:06PM -0800, Dan Williams wrote: > On Wed, Nov 13, 2019 at 11:23 AM Dan Williams > wrote: > > > > On Tue, Nov 12, 2019 at 8:27 PM John Hubbard wrote: > > > > > > An upcoming patch changes and complicates the refcounting and > > > especially the "put page" aspects of

Re: [PATCH v4 04/23] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-13 Thread Jerome Glisse
On Tue, Nov 12, 2019 at 08:26:51PM -0800, John Hubbard wrote: > An upcoming patch changes and complicates the refcounting and > especially the "put page" aspects of it. In order to keep > everything clean, refactor the devmap page release routines: > > * Rename put_devmap_managed_page() to

Re: Proposal to report GPU private memory allocations with sysfs nodes [plain text version]

2019-11-12 Thread Jerome Glisse
On Tue, Nov 12, 2019 at 10:17:10AM -0800, Yiwei Zhang wrote: > Hi folks, > > What do you think about: > > For the sysfs approach, I'm assuming the upstream vendors still need > > to provide a pair of UMD and KMD, and this ioctl to label the BO is > > kept as driver private ioctl. Then will each

Re: [PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier

2019-11-08 Thread Jerome Glisse
On Thu, Nov 07, 2019 at 10:33:02PM -0800, Christoph Hellwig wrote: > On Thu, Nov 07, 2019 at 08:06:08PM +, Jason Gunthorpe wrote: > > > > > > enum mmu_range_notifier_event { > > > MMU_NOTIFY_RELEASE, > > > }; > > > > > > ...assuming that we stay with "mmu_range_notifier" as a core name for

Re: [PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier

2019-11-07 Thread Jerome Glisse
On Fri, Nov 08, 2019 at 12:32:25AM +, Jason Gunthorpe wrote: > On Thu, Nov 07, 2019 at 04:04:08PM -0500, Jerome Glisse wrote: > > On Thu, Nov 07, 2019 at 08:11:06PM +, Jason Gunthorpe wrote: > > > On Wed, Nov 06, 2019 at 09:08:07PM -0500, J

Re: [PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier

2019-11-07 Thread Jerome Glisse
On Thu, Nov 07, 2019 at 08:11:06PM +, Jason Gunthorpe wrote: > On Wed, Nov 06, 2019 at 09:08:07PM -0500, Jerome Glisse wrote: > > > > > > > Extra credit: IMHO, this clearly deserves to all be in a new > > > mmu_range_notifier.h > > > header file,

Re: [PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier

2019-11-06 Thread Jerome Glisse
On Wed, Nov 06, 2019 at 04:23:21PM -0800, John Hubbard wrote: > On 10/28/19 1:10 PM, Jason Gunthorpe wrote: [...] > > /** > > * enum mmu_notifier_event - reason for the mmu notifier callback > > @@ -32,6 +34,9 @@ struct mmu_notifier_range; > > * access flags). User should soft dirty the

Re: [PATCH v2 12/18] mm/gup: track FOLL_PIN pages

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 02:49:18PM -0800, John Hubbard wrote: > On 11/4/19 10:52 AM, Jerome Glisse wrote: > > On Sun, Nov 03, 2019 at 01:18:07PM -0800, John Hubbard wrote: > >> Add tracking of pages that were pinned via FOLL_PIN. > >> > >> As mentioned in the

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 12:33:09PM -0800, David Rientjes wrote: > > > On Sun, 3 Nov 2019, John Hubbard wrote: > > > Introduce pin_user_pages*() variations of get_user_pages*() calls, > > and also pin_longterm_pages*() variations. > > > > These variants all set FOLL_PIN, which is also

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 12:09:05PM -0800, John Hubbard wrote: > Jason, a question for you at the bottom. > > On 11/4/19 11:52 AM, Jerome Glisse wrote: > ... > >> CASE 3: ODP > >> --- > >> RDMA hardware with page faulting support. Here, a well-writ

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 11:30:32AM -0800, John Hubbard wrote: > On 11/4/19 11:18 AM, Jerome Glisse wrote: > > On Mon, Nov 04, 2019 at 11:04:38AM -0800, John Hubbard wrote: > >> On 11/4/19 9:33 AM, Jerome Glisse wrote: > >> ... > >>> > >>> Fe

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 11:04:38AM -0800, John Hubbard wrote: > On 11/4/19 9:33 AM, Jerome Glisse wrote: > ... > > > > Few nitpick belows, nonetheless: > > > > Reviewed-by: Jérôme Glisse > > [...] > >> + > >> +CASE 3: ODP > &g

Re: [PATCH v2 12/18] mm/gup: track FOLL_PIN pages

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:18:07PM -0800, John Hubbard wrote: > Add tracking of pages that were pinned via FOLL_PIN. > > As mentioned in the FOLL_PIN documentation, callers who effectively set > FOLL_PIN are required to ultimately free such pages via put_user_page(). > The effect is similar to

Re: [PATCH v2 09/18] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:18:04PM -0800, John Hubbard wrote: > Convert drm/via to use the new pin_user_pages_fast() call, which sets > FOLL_PIN. Setting FOLL_PIN is now required for code that requires > tracking of pinned pages, and therefore for any code that calls > put_user_page(). > >

Re: [PATCH v2 08/18] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:18:03PM -0800, John Hubbard wrote: > Convert process_vm_access to use the new pin_user_pages_remote() > call, which sets FOLL_PIN. Setting FOLL_PIN is now required for > code that requires tracking of pinned pages. > > Also, release the pages via put_user_page*(). > >

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:18:00PM -0800, John Hubbard wrote: > Introduce pin_user_pages*() variations of get_user_pages*() calls, > and also pin_longterm_pages*() variations. > > These variants all set FOLL_PIN, which is also introduced, and > thoroughly documented. > > The pin_longterm*()

Re: [PATCH v2 03/18] goldish_pipe: rename local pin_user_pages() routine

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:17:58PM -0800, John Hubbard wrote: > 1. Avoid naming conflicts: rename local static function from > "pin_user_pages()" to "pin_goldfish_pages()". > > An upcoming patch will introduce a global pin_user_pages() > function. > > Reviewed-by: Ira Weiny > Signed-off-by:

Re: [PATCH v2 02/18] mm/gup: factor out duplicate code from four routines

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:17:57PM -0800, John Hubbard wrote: > There are four locations in gup.c that have a fair amount of code > duplication. This means that changing one requires making the same > changes in four places, not to mention reading the same code four > times, and wondering if there

Re: [PATCH v2 01/18] mm/gup: pass flags arg to __gup_device_* functions

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:17:56PM -0800, John Hubbard wrote: > A subsequent patch requires access to gup flags, so > pass the flags argument through to the __gup_device_* > functions. > > Also placate checkpatch.pl by shortening a nearby line. > > Reviewed-by: Ira Weiny > Cc: Kirill A.

Re: Proposal to report GPU private memory allocations with sysfs nodes [plain text version]

2019-10-28 Thread Jerome Glisse
On Fri, Oct 25, 2019 at 11:35:32AM -0700, Yiwei Zhang wrote: > Hi folks, > > This is the plain text version of the previous email in case that was > considered as spam. > > --- Background --- > On the downstream Android, vendors used to report GPU private memory > allocations with debugfs nodes

Re: [PATCH hmm 00/15] Consolidate the mmu notifier interval_tree and locking

2019-10-23 Thread Jerome Glisse
On Mon, Oct 21, 2019 at 07:06:00PM +, Jason Gunthorpe wrote: > On Mon, Oct 21, 2019 at 02:40:41PM -0400, Jerome Glisse wrote: > > On Tue, Oct 15, 2019 at 03:12:27PM -0300, Jason Gunthorpe wrote: > > > From: Jason Gunthorpe > > > > > > 8 of the mmu_notifie

Re: [PATCH hmm 00/15] Consolidate the mmu notifier interval_tree and locking

2019-10-23 Thread Jerome Glisse
On Wed, Oct 23, 2019 at 11:32:16AM +0200, Christian König wrote: > Am 23.10.19 um 11:08 schrieb Daniel Vetter: > > On Tue, Oct 22, 2019 at 03:01:13PM +, Jason Gunthorpe wrote: > > > On Tue, Oct 22, 2019 at 09:57:35AM +0200, Daniel Vetter wrote: > > > > > > > > The unusual bit in all of this

Re: [PATCH hmm 02/15] mm/mmu_notifier: add an interval tree notifier

2019-10-21 Thread Jerome Glisse
On Mon, Oct 21, 2019 at 07:24:53PM +, Jason Gunthorpe wrote: > On Mon, Oct 21, 2019 at 03:11:57PM -0400, Jerome Glisse wrote: > > > Since that reader is not locked we need release semantics here to > > > ensure the unlocked reader sees a fully initinalized mmu_notifier_mm

Re: [PATCH hmm 15/15] mm/hmm: remove hmm_mirror and related

2019-10-21 Thread Jerome Glisse
On Mon, Oct 21, 2019 at 06:57:42PM +, Jason Gunthorpe wrote: > On Mon, Oct 21, 2019 at 02:38:24PM -0400, Jerome Glisse wrote: > > On Tue, Oct 15, 2019 at 03:12:42PM -0300, Jason Gunthorpe wrote: > > > From: Jason Gunthorpe > > > > > > The only two us

Re: [PATCH hmm 02/15] mm/mmu_notifier: add an interval tree notifier

2019-10-21 Thread Jerome Glisse
On Mon, Oct 21, 2019 at 06:54:25PM +, Jason Gunthorpe wrote: > On Mon, Oct 21, 2019 at 02:30:56PM -0400, Jerome Glisse wrote: > > > > +/** > > > + * mmu_range_read_retry - End a read side critical section against a VA > > > range > > > + * mrn: The

Re: [PATCH hmm 00/15] Consolidate the mmu notifier interval_tree and locking

2019-10-21 Thread Jerome Glisse
On Tue, Oct 15, 2019 at 03:12:27PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > 8 of the mmu_notifier using drivers (i915_gem, radeon_mn, umem_odp, hfi1, > scif_dma, vhost, gntdev, hmm) drivers are using a common pattern where > they only use invalidate_range_start/end and

Re: [PATCH hmm 15/15] mm/hmm: remove hmm_mirror and related

2019-10-21 Thread Jerome Glisse
On Tue, Oct 15, 2019 at 03:12:42PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > The only two users of this are now converted to use mmu_range_notifier, > delete all the code and update hmm.rst. I guess i should point out that the reasons for hmm_mirror and hmm was for: 1) Maybe

Re: [PATCH hmm 03/15] mm/hmm: allow hmm_range to be used with a mmu_range_notifier or hmm_mirror

2019-10-21 Thread Jerome Glisse
On Tue, Oct 15, 2019 at 03:12:30PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > hmm_mirror's handling of ranges does not use a sequence count which > results in this bug: > > CPU0 CPU1 >

Re: [PATCH hmm 01/15] mm/mmu_notifier: define the header pre-processor parts even if disabled

2019-10-21 Thread Jerome Glisse
On Tue, Oct 15, 2019 at 03:12:28PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > Now that we have KERNEL_HEADER_TEST all headers are generally compile > tested, so relying on makefile tricks to avoid compiling code that depends > on CONFIG_MMU_NOTIFIER is more annoying. > > Instead

Re: [PATCH hmm 04/15] mm/hmm: define the pre-processor related parts of hmm.h even if disabled

2019-10-21 Thread Jerome Glisse
On Tue, Oct 15, 2019 at 03:12:31PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > Only the function calls are stubbed out with static inlines that always > fail. This is the standard way to write a header for an optional component > and makes it easier for drivers that only optionally

Re: [PATCH hmm 02/15] mm/mmu_notifier: add an interval tree notifier

2019-10-21 Thread Jerome Glisse
On Tue, Oct 15, 2019 at 03:12:29PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > Of the 13 users of mmu_notifiers, 8 of them use only > invalidate_range_start/end() and immediately intersect the > mmu_notifier_range with some kind of internal list of VAs. 4 use an > interval tree

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-16 Thread Jerome Glisse
On Fri, Aug 16, 2019 at 11:31:45AM -0300, Jason Gunthorpe wrote: > On Fri, Aug 16, 2019 at 02:26:25PM +0200, Michal Hocko wrote: > > On Fri 16-08-19 09:19:06, Jason Gunthorpe wrote: > > > On Fri, Aug 16, 2019 at 10:10:29AM +0200, Michal Hocko wrote: > > > > On Thu 15-08-19 17:13:23, Jason

Re: [PATCH] mm/hmm: hmm_range_fault handle pages swapped out

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 08:52:56PM +, Yang, Philip wrote: > hmm_range_fault may return NULL pages because some of pfns are equal to > HMM_PFN_NONE. This happens randomly under memory pressure. The reason is > for swapped out page pte path, hmm_vma_handle_pte doesn't update fault > variable

Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 08:41:33PM +, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 04:33:06PM -0400, Jerome Glisse wrote: > > > So nor HMM nor driver should dereference the struct page (i do not > > think any iommu driver would either), > > Er, they do technical

Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 01:12:22PM -0700, Dan Williams wrote: > On Thu, Aug 15, 2019 at 12:44 PM Jerome Glisse wrote: > > > > On Thu, Aug 15, 2019 at 12:36:58PM -0700, Dan Williams wrote: > > > On Thu, Aug 15, 2019 at 11:07 AM Jerome Glisse wrote: > > > > &

Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 12:36:58PM -0700, Dan Williams wrote: > On Thu, Aug 15, 2019 at 11:07 AM Jerome Glisse wrote: > > > > On Wed, Aug 14, 2019 at 07:48:28AM -0700, Dan Williams wrote: > > > On Wed, Aug 14, 2019 at 6:28 AM Jason Gunthorpe wrote: > > > > &

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 03:01:59PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 01:39:22PM -0400, Jerome Glisse wrote: > > On Thu, Aug 15, 2019 at 02:35:57PM -0300, Jason Gunthorpe wrote: > > > On Thu, Aug 15, 2019 at 06:25:16PM +0200, Daniel Vetter wrote: > > &

Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk

2019-08-15 Thread Jerome Glisse
On Wed, Aug 14, 2019 at 07:48:28AM -0700, Dan Williams wrote: > On Wed, Aug 14, 2019 at 6:28 AM Jason Gunthorpe wrote: > > > > On Wed, Aug 14, 2019 at 09:38:54AM +0200, Christoph Hellwig wrote: > > > On Tue, Aug 13, 2019 at 06:36:33PM -0700, Dan Williams wrote: > > > > Section alignment

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 07:42:07PM +0200, Michal Hocko wrote: > On Thu 15-08-19 13:56:31, Jason Gunthorpe wrote: > > On Thu, Aug 15, 2019 at 06:00:41PM +0200, Michal Hocko wrote: > > > > > > AFAIK 'GFP_NOWAIT' is characterized by the lack of __GFP_FS and > > > > __GFP_DIRECT_RECLAIM.. > > > > > >

Re: [Nouveau] [PATCH] nouveau/hmm: map pages after migration

2019-08-15 Thread Jerome Glisse
On Tue, Aug 13, 2019 at 05:58:52PM -0400, Jerome Glisse wrote: > On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: > > When memory is migrated to the GPU it is likely to be accessed by GPU > > code soon afterwards. Instead of waiting for a GPU fault, map the >

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 02:35:57PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 06:25:16PM +0200, Daniel Vetter wrote: > > > I'm not really well versed in the details of our userptr, but both > > amdgpu and i915 wait for the gpu to complete from > > invalidate_range_start. Jerome has

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 07:21:47PM +0200, Daniel Vetter wrote: > On Thu, Aug 15, 2019 at 7:16 PM Jason Gunthorpe wrote: > > > > On Thu, Aug 15, 2019 at 12:32:38PM -0400, Jerome Glisse wrote: > > > On Thu, Aug 15, 2019 at 12:10:28PM -0300, Jason Gunthorpe wrote: > >

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 01:56:31PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 06:00:41PM +0200, Michal Hocko wrote: > > > > AFAIK 'GFP_NOWAIT' is characterized by the lack of __GFP_FS and > > > __GFP_DIRECT_RECLAIM.. > > > > > > This matches the existing test in __need_fs_reclaim() -

Re: [PATCH 2/5] kernel.h: Add non_block_start/end()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 12:10:28PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 04:43:38PM +0200, Daniel Vetter wrote: > > > You have to wait for the gpu to finnish current processing in > > invalidate_range_start. Otherwise there's no point to any of this > > really. So the

Re: [PATCH] nouveau/hmm: map pages after migration

2019-08-13 Thread Jerome Glisse
On Wed, Aug 07, 2019 at 08:02:14AM -0700, Ralph Campbell wrote: > When memory is migrated to the GPU it is likely to be accessed by GPU > code soon afterwards. Instead of waiting for a GPU fault, map the > migrated memory into the GPU page tables with the same access permissions > as the source

Re: [PATCH 9/9] mm: remove the MIGRATE_PFN_WRITE flag

2019-07-30 Thread Jerome Glisse
On Tue, Jul 30, 2019 at 07:46:33AM +0200, Christoph Hellwig wrote: > On Mon, Jul 29, 2019 at 07:30:44PM -0400, Jerome Glisse wrote: > > On Mon, Jul 29, 2019 at 05:28:43PM +0300, Christoph Hellwig wrote: > > > The MIGRATE_PFN_WRITE is only used locally in migrate_vma_collect_pmd,

Re: [PATCH 9/9] mm: remove the MIGRATE_PFN_WRITE flag

2019-07-29 Thread Jerome Glisse
On Mon, Jul 29, 2019 at 04:42:01PM -0700, Ralph Campbell wrote: > > On 7/29/19 7:28 AM, Christoph Hellwig wrote: > > The MIGRATE_PFN_WRITE is only used locally in migrate_vma_collect_pmd, > > where it can be replaced with a simple boolean local variable. > > > > Signed-off-by: Christoph Hellwig

Re: [PATCH 1/9] mm: turn migrate_vma upside down

2019-07-29 Thread Jerome Glisse
On Mon, Jul 29, 2019 at 05:28:35PM +0300, Christoph Hellwig wrote: > There isn't any good reason to pass callbacks to migrate_vma. Instead > we can just export the three steps done by this function to drivers and > let them sequence the operation without callbacks. This removes a lot > of

Re: [PATCH 9/9] mm: remove the MIGRATE_PFN_WRITE flag

2019-07-29 Thread Jerome Glisse
On Mon, Jul 29, 2019 at 05:28:43PM +0300, Christoph Hellwig wrote: > The MIGRATE_PFN_WRITE is only used locally in migrate_vma_collect_pmd, > where it can be replaced with a simple boolean local variable. > > Signed-off-by: Christoph Hellwig NAK that flag is useful, for instance a anonymous vma

Re: [PATCH] drm/nouveau/svm: Convert to use hmm_range_fault()

2019-06-17 Thread Jerome Glisse
On Sat, Jun 08, 2019 at 12:14:50AM +0530, Souptick Joarder wrote: > Hi Jason, > > On Tue, May 21, 2019 at 12:27 AM Souptick Joarder > wrote: > > > > Convert to use hmm_range_fault(). > > > > Signed-off-by: Souptick Joarder > > Would you like to take it through your new hmm tree or do I > need

Re: [PATCH 4/4] mm, notifier: Add a lockdep map for invalidate_range_start

2019-05-21 Thread Jerome Glisse
On Tue, May 21, 2019 at 06:00:36PM +0200, Daniel Vetter wrote: > On Tue, May 21, 2019 at 5:41 PM Jerome Glisse wrote: > > > > On Mon, May 20, 2019 at 11:39:45PM +0200, Daniel Vetter wrote: > > > This is a similar idea to the fs_reclaim fake lockdep lock. It's >

Re: [PATCH 1/4] mm: Check if mmu notifier callbacks are allowed to fail

2019-05-21 Thread Jerome Glisse
On Mon, May 20, 2019 at 11:39:42PM +0200, Daniel Vetter wrote: > Just a bit of paranoia, since if we start pushing this deep into > callchains it's hard to spot all places where an mmu notifier > implementation might fail when it's not allowed to. > > Inspired by some confusion we had discussing

Re: [PATCH 4/4] mm, notifier: Add a lockdep map for invalidate_range_start

2019-05-21 Thread Jerome Glisse
On Mon, May 20, 2019 at 11:39:45PM +0200, Daniel Vetter wrote: > This is a similar idea to the fs_reclaim fake lockdep lock. It's > fairly easy to provoke a specific notifier to be run on a specific > range: Just prep it, and then munmap() it. > > A bit harder, but still doable, is to provoke the

Re: [PATCH 3/4] mm, notifier: Catch sleeping/blocking for !blockable

2019-05-21 Thread Jerome Glisse
On Mon, May 20, 2019 at 11:39:44PM +0200, Daniel Vetter wrote: > We need to make sure implementations don't cheat and don't have a > possible schedule/blocking point deeply burried where review can't > catch it. > > I'm not sure whether this is the best way to make sure all the > might_sleep()

Re: [PATCH 1/2] mm/hmm: support automatic NUMA balancing

2019-05-13 Thread Jerome Glisse
On Mon, May 13, 2019 at 02:27:20PM -0700, Andrew Morton wrote: > On Fri, 10 May 2019 19:53:23 + "Kuehling, Felix" > wrote: > > > From: Philip Yang > > > > While the page is migrating by NUMA balancing, HMM failed to detect this > > condition and still return the old page. Application will

Re: [PATCH 2/2] mm/hmm: Only set FAULT_FLAG_ALLOW_RETRY for non-blocking

2019-05-13 Thread Jerome Glisse
t expecting it too ? Cheers, Jérôme > > Thanks, >   Felix > > On 2019-05-10 4:14 p.m., Jerome Glisse wrote: > > [CAUTION: External Email] > > > > On Fri, May 10, 2019 at 07:53:24PM +, Kuehling, Felix wrote: > >> Don't set this flag by default in

Re: [PATCH 1/2] mm/hmm: support automatic NUMA balancing

2019-05-10 Thread Jerome Glisse
On Fri, May 10, 2019 at 07:53:23PM +, Kuehling, Felix wrote: > From: Philip Yang > > While the page is migrating by NUMA balancing, HMM failed to detect this > condition and still return the old page. Application will use the new > page migrated, but driver pass the old page physical address

Re: [PATCH 2/2] mm/hmm: Only set FAULT_FLAG_ALLOW_RETRY for non-blocking

2019-05-10 Thread Jerome Glisse
On Fri, May 10, 2019 at 07:53:24PM +, Kuehling, Felix wrote: > Don't set this flag by default in hmm_vma_do_fault. It is set > conditionally just a few lines below. Setting it unconditionally > can lead to handle_mm_fault doing a non-blocking fault, returning > -EBUSY and unlocking mmap_sem

Re: [PATCH] drm/nouveau: Fix DEVICE_PRIVATE dependencies

2019-04-17 Thread Jerome Glisse
On Wed, Apr 17, 2019 at 10:26:32PM +0800, Yue Haibing wrote: > From: YueHaibing > > During randconfig builds, I occasionally run into an invalid configuration > > WARNING: unmet direct dependencies detected for DEVICE_PRIVATE > Depends on [n]: ARCH_HAS_HMM_DEVICE [=n] && ZONE_DEVICE [=n] >

Re: [PATCH 2/9] mm: Add an apply_to_pfn_range interface

2019-04-17 Thread Jerome Glisse
On Wed, Apr 17, 2019 at 09:15:52AM +, Thomas Hellstrom wrote: > On Tue, 2019-04-16 at 10:46 -0400, Jerome Glisse wrote: > > On Sat, Apr 13, 2019 at 08:34:02AM +, Thomas Hellstrom wrote: > > > Hi, Jérôme > > > > > > On Fri, 2019-04-12 at 17:07 -0400,

Re: [PATCH 2/9] mm: Add an apply_to_pfn_range interface

2019-04-16 Thread Jerome Glisse
On Sat, Apr 13, 2019 at 08:34:02AM +, Thomas Hellstrom wrote: > Hi, Jérôme > > On Fri, 2019-04-12 at 17:07 -0400, Jerome Glisse wrote: > > On Fri, Apr 12, 2019 at 04:04:18PM +, Thomas Hellstrom wrote: > > > This is basically apply_to_page_range with added functio

Re: [PATCH 2/9] mm: Add an apply_to_pfn_range interface

2019-04-12 Thread Jerome Glisse
On Fri, Apr 12, 2019 at 04:04:18PM +, Thomas Hellstrom wrote: > This is basically apply_to_page_range with added functionality: > Allocating missing parts of the page table becomes optional, which > means that the function can be guaranteed not to error if allocation > is disabled. Also

Re: [PATCH v6 7/8] mm/mmu_notifier: pass down vma and reasons why mmu notifier is happening v2

2019-04-11 Thread Jerome Glisse
On Thu, Apr 11, 2019 at 03:21:08PM +, Weiny, Ira wrote: > > On Wed, Apr 10, 2019 at 04:41:57PM -0700, Ira Weiny wrote: > > > On Tue, Mar 26, 2019 at 12:47:46PM -0400, Jerome Glisse wrote: > > > > From: Jérôme Glisse > > > > > > > > CPU page

Re: [PATCH v6 7/8] mm/mmu_notifier: pass down vma and reasons why mmu notifier is happening v2

2019-04-11 Thread Jerome Glisse
On Wed, Apr 10, 2019 at 04:41:57PM -0700, Ira Weiny wrote: > On Tue, Mar 26, 2019 at 12:47:46PM -0400, Jerome Glisse wrote: > > From: Jérôme Glisse > > > > CPU page table update can happens for many reasons, not only as a result > > of a syscall (munmap(), mp

Re: [PATCH v6 0/8] mmu notifier provide context informations

2019-04-10 Thread Jerome Glisse
On Tue, Apr 09, 2019 at 03:08:55PM -0700, Andrew Morton wrote: > On Tue, 26 Mar 2019 12:47:39 -0400 jgli...@redhat.com wrote: > > > From: Jérôme Glisse > > > > (Andrew this apply on top of my HMM patchset as otherwise you will have > > conflict with changes to mm/hmm.c) > > > > Changes since

Re: [PATCH v6 0/8] mmu notifier provide context informations

2019-04-09 Thread Jerome Glisse
Andrew anything blocking this for 5.2 ? Should i ask people (ie the end user of this) to re-ack v6 (it is the same as previous version just rebase and dropped kvm bits). On Tue, Mar 26, 2019 at 12:47:39PM -0400, jgli...@redhat.com wrote: > From: Jérôme Glisse > > (Andrew this apply on top of

Re: [RFC PATCH Xilinx Alveo 0/6] Xilinx PCIe accelerator driver

2019-04-03 Thread Jerome Glisse
On Fri, Mar 29, 2019 at 06:09:18PM -0700, Ronan KERYELL wrote: > I am adding linux-f...@vger.kernel.org, since this is why I missed this > thread in the first place... > > On Fri, 29 Mar 2019 14:56:17 +1000, Dave Airlie > > said: > Dave> On Thu, 28 Mar 2019 at 10:14, Sonal Santan >

Re: [RFC PATCH RESEND 3/3] mm: Add write-protect and clean utilities for address space ranges

2019-03-21 Thread Jerome Glisse
On Thu, Mar 21, 2019 at 08:29:31PM +, Thomas Hellstrom wrote: > On Thu, 2019-03-21 at 10:12 -0400, Jerome Glisse wrote: > > On Thu, Mar 21, 2019 at 01:22:41PM +, Thomas Hellstrom wrote: > > > Add two utilities to a) write-protect and b) clean all ptes > > >

Re: [RFC PATCH RESEND 0/3] mm modifications / helpers for emulated GPU coherent memory

2019-03-21 Thread Jerome Glisse
On Thu, Mar 21, 2019 at 07:51:16PM +, Thomas Hellstrom wrote: > Hi, Jérôme, > > Thanks for commenting. I have a couple of questions / clarifications > below. > > On Thu, 2019-03-21 at 09:46 -0400, Jerome Glisse wrote: > > On Thu, Mar 21, 2019 at 01:22:22PM +

Re: [RFC PATCH RESEND 2/3] mm: Add an apply_to_pfn_range interface

2019-03-21 Thread Jerome Glisse
On Thu, Mar 21, 2019 at 07:59:35PM +, Thomas Hellstrom wrote: > On Thu, 2019-03-21 at 09:52 -0400, Jerome Glisse wrote: > > On Thu, Mar 21, 2019 at 01:22:35PM +, Thomas Hellstrom wrote: > > > This is basically apply_to_page_range with added functionality: > > &g

Re: [RFC PATCH RESEND 3/3] mm: Add write-protect and clean utilities for address space ranges

2019-03-21 Thread Jerome Glisse
On Thu, Mar 21, 2019 at 01:22:41PM +, Thomas Hellstrom wrote: > Add two utilities to a) write-protect and b) clean all ptes pointing into > a range of an address space > The utilities are intended to aid in tracking dirty pages (either > driver-allocated system memory or pci device memory). >

Re: [RFC PATCH RESEND 2/3] mm: Add an apply_to_pfn_range interface

2019-03-21 Thread Jerome Glisse
On Thu, Mar 21, 2019 at 01:22:35PM +, Thomas Hellstrom wrote: > This is basically apply_to_page_range with added functionality: > Allocating missing parts of the page table becomes optional, which > means that the function can be guaranteed not to error if allocation > is disabled. Also

Re: [RFC PATCH RESEND 0/3] mm modifications / helpers for emulated GPU coherent memory

2019-03-21 Thread Jerome Glisse
On Thu, Mar 21, 2019 at 01:22:22PM +, Thomas Hellstrom wrote: > Resending since last series was sent through a mis-configured SMTP server. > > Hi, > This is an early RFC to make sure I don't go too far in the wrong direction. > > Non-coherent GPUs that can't directly see contents in

Re: [RFC][PATCH 0/5 v2] DMA-BUF Heaps (destaging ION)

2019-03-15 Thread Jerome Glisse
On Tue, Mar 05, 2019 at 12:54:28PM -0800, John Stultz wrote: > Here is a initial RFC of the dma-buf heaps patchset Andrew and I > have been working on which tries to destage a fair chunk of ION > functionality. > > The patchset implements per-heap devices which can be opened > directly and then

Re: [PATCH v5 0/9] mmu notifier provide context informations

2019-02-19 Thread Jerome Glisse
On Tue, Feb 19, 2019 at 01:19:09PM -0800, Dan Williams wrote: > On Tue, Feb 19, 2019 at 12:58 PM Jerome Glisse wrote: > > > > On Tue, Feb 19, 2019 at 12:40:37PM -0800, Dan Williams wrote: > > > On Tue, Feb 19, 2019 at 12:30 PM Jerome Glisse wrote: > > > > &

Re: [PATCH v5 0/9] mmu notifier provide context informations

2019-02-19 Thread Jerome Glisse
On Tue, Feb 19, 2019 at 12:40:37PM -0800, Dan Williams wrote: > On Tue, Feb 19, 2019 at 12:30 PM Jerome Glisse wrote: > > > > On Tue, Feb 19, 2019 at 12:15:55PM -0800, Dan Williams wrote: > > > On Tue, Feb 19, 2019 at 12:04 PM wrote: > > > > > > >

Re: [PATCH v5 0/9] mmu notifier provide context informations

2019-02-19 Thread Jerome Glisse
On Tue, Feb 19, 2019 at 12:15:55PM -0800, Dan Williams wrote: > On Tue, Feb 19, 2019 at 12:04 PM wrote: > > > > From: Jérôme Glisse > > > > Since last version [4] i added the extra bits needed for the change_pte > > optimization (which is a KSM thing). Here i am not posting users of > > this,

Re: [PATCH v4 0/9] mmu notifier provide context informations

2019-02-11 Thread Jerome Glisse
On Fri, Feb 01, 2019 at 10:02:30PM +0100, Jan Kara wrote: > On Thu 31-01-19 11:10:06, Jerome Glisse wrote: > > > > Andrew what is your plan for this ? I had a discussion with Peter Xu > > and Andrea about change_pte() and kvm. Today the change_pte() kvm > > optimizat

Re: [PATCH v8 3/7] mm, devm_memremap_pages: Fix shutdown handling

2019-02-11 Thread Jerome Glisse
On Sun, Feb 10, 2019 at 12:09:08PM +0100, Krzysztof Grygiencz wrote: > Dear Sir, > > I'm using ArchLinux distribution. After kernel upgrade form 4.19.14 to > 4.19.15 my X environment stopped working. I have AMD HD3300 (RS780D) > graphics card. I have bisected kernel and found a failing commit: >

  1   2   3   4   5   6   7   8   9   10   >