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: [PATCH 0/2] page_count can't be used to decide when wp_page_copy

2021-01-13 Thread Jerome Glisse
On Wed, Jan 13, 2021 at 07:39:36PM -0400, Jason Gunthorpe wrote: > On Wed, Jan 13, 2021 at 04:56:38PM -0500, Jerome Glisse wrote: > > > is a broken model and the way GPU use GUP is less broken then RDMA. In > > GPU driver GUP contract with userspace is that the data the

Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy

2021-01-13 Thread Jerome Glisse
On Fri, Jan 08, 2021 at 08:42:55PM -0400, Jason Gunthorpe wrote: > On Fri, Jan 08, 2021 at 05:43:56PM -0500, Andrea Arcangeli wrote: > > On Fri, Jan 08, 2021 at 02:19:45PM -0400, Jason Gunthorpe wrote: > > > On Fri, Jan 08, 2021 at 12:00:36PM -0500, Andrea Arcangeli wrote: > > > > > The majority

Re: [PATCH 0/1] mm: restore full accuracy in COW page reuse

2021-01-12 Thread Jerome Glisse
On Mon, Jan 11, 2021 at 02:18:13PM -0800, Linus Torvalds wrote: > On Mon, Jan 11, 2021 at 11:19 AM Linus Torvalds > wrote: > > > > On Sun, Jan 10, 2021 at 11:27 PM John Hubbard wrote: > > > IMHO, a lot of the bits in page _refcount are still being wasted (even > > > after GUP_PIN_COUNTING_BIAS

Re: [PATCH 00/14] Small step toward KSM for file back page.

2020-10-08 Thread Jerome Glisse
On Thu, Oct 08, 2020 at 04:43:41PM +0100, Matthew Wilcox wrote: > On Thu, Oct 08, 2020 at 11:30:28AM -0400, Jerome Glisse wrote: > > On Wed, Oct 07, 2020 at 11:09:16PM +0100, Matthew Wilcox wrote: > > > So ... why don't you put a PageKsm page in the page cache? That way you &g

Re: [PATCH 00/14] Small step toward KSM for file back page.

2020-10-08 Thread Jerome Glisse
On Wed, Oct 07, 2020 at 11:09:16PM +0100, Matthew Wilcox wrote: > On Wed, Oct 07, 2020 at 01:54:19PM -0400, Jerome Glisse wrote: > > > For other things (NUMA distribution), we can point to something which > > > isn't a struct page and can be distiguished from a real struc

Re: [PATCH 00/14] Small step toward KSM for file back page.

2020-10-07 Thread Jerome Glisse
On Wed, Oct 07, 2020 at 07:33:16PM +0100, Matthew Wilcox wrote: > On Wed, Oct 07, 2020 at 01:54:19PM -0400, Jerome Glisse wrote: > > On Wed, Oct 07, 2020 at 06:05:58PM +0100, Matthew Wilcox wrote: > > > On Wed, Oct 07, 2020 at 10:48:35AM -0400, Jerome Glisse wrote: > >

Re: [PATCH 00/14] Small step toward KSM for file back page.

2020-10-07 Thread Jerome Glisse
On Wed, Oct 07, 2020 at 06:05:58PM +0100, Matthew Wilcox wrote: > On Wed, Oct 07, 2020 at 10:48:35AM -0400, Jerome Glisse wrote: > > On Wed, Oct 07, 2020 at 04:20:13AM +0100, Matthew Wilcox wrote: > > > On Tue, Oct 06, 2020 at 09:05:49PM -0400, jgli...@redhat.com wrote: &

Re: [PATCH 00/14] Small step toward KSM for file back page.

2020-10-07 Thread Jerome Glisse
On Wed, Oct 07, 2020 at 04:20:13AM +0100, Matthew Wilcox wrote: > On Tue, Oct 06, 2020 at 09:05:49PM -0400, jgli...@redhat.com wrote: > > The present patchset just add mapping argument to the various vfs call- > > backs. It does not make use of that new parameter to avoid regression. > > I am

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: Cache flush issue with page_mapping_file() and swap back shmem page ?

2020-05-28 Thread Jerome Glisse
On Wed, May 27, 2020 at 08:46:22PM -0700, Hugh Dickins wrote: > Hi Jerome, > > On Wed, 27 May 2020, Jerome Glisse wrote: > > So any arch code which uses page_mapping_file() might get the wrong > > answer, this function will return NULL for a swap backed page which >

Cache flush issue with page_mapping_file() and swap back shmem page ?

2020-05-27 Thread Jerome Glisse
So any arch code which uses page_mapping_file() might get the wrong answer, this function will return NULL for a swap backed page which can be a shmem pages. But shmem pages can still be shared among multiple process (and possibly at different virtual addresses if mremap was use). Attached is a

Re: [PATCH v6 2/3] uacce: add uacce driver

2019-10-23 Thread Jerome Glisse
On Wed, Oct 16, 2019 at 07:28:02PM +0200, Jean-Philippe Brucker wrote: [...] > > +static struct uacce_qfile_region * > > +uacce_create_region(struct uacce_queue *q, struct vm_area_struct *vma, > > + enum uacce_qfrt type, unsigned int flags) > > +{ > > + struct uacce_qfile_region

Re: [PATCH 1/1] mm/gup_benchmark: fix MAP_HUGETLB case

2019-10-22 Thread Jerome Glisse
On Tue, Oct 22, 2019 at 11:41:57AM -0700, John Hubbard wrote: > On 10/22/19 10:14 AM, Jerome Glisse wrote: > > On Mon, Oct 21, 2019 at 02:24:35PM -0700, John Hubbard wrote: > >> The MAP_HUGETLB ("-H" option) of gup_benchmark fails: > >> > >> $ sudo

Re: [PATCH 1/1] mm/gup_benchmark: fix MAP_HUGETLB case

2019-10-22 Thread Jerome Glisse
On Mon, Oct 21, 2019 at 02:24:35PM -0700, John Hubbard wrote: > The MAP_HUGETLB ("-H" option) of gup_benchmark fails: > > $ sudo ./gup_benchmark -H > mmap: Invalid argument > > This is because gup_benchmark.c is passing in a file descriptor to > mmap(), but the fd came from opening up the

Re: hmm pud-entry callback locking?

2019-10-07 Thread Jerome Glisse
On Sat, Oct 05, 2019 at 02:29:40PM +0200, Thomas Hellström (VMware) wrote: > Hi, Jerome, > > I was asked by Kirill to try to unify the pagewalk pud_entry and pmd_entry > callbacks. The only user of the pagewalk pud-entry is currently hmm. > > But the pagewalk code call pud_entry only for huge

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-16 Thread Jerome Glisse
On Fri, Aug 16, 2019 at 06:13:55PM +0200, Jan Kara wrote: > On Fri 16-08-19 11:52:20, Jerome Glisse wrote: > > On Fri, Aug 16, 2019 at 05:44:04PM +0200, Jan Kara wrote: > > > On Fri 16-08-19 10:47:21, Vlastimil Babka wrote: > > > > On 8/15/19 3:35 PM, Jan Kara wrote:

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-16 Thread Jerome Glisse
On Fri, Aug 16, 2019 at 05:44:04PM +0200, Jan Kara wrote: > On Fri 16-08-19 10:47:21, Vlastimil Babka wrote: > > On 8/15/19 3:35 PM, Jan Kara wrote: > > >> > > >> So when the GUP user uses MMU notifiers to stop writing to pages whenever > > >> they are writeprotected with page_mkclean(), they

Re: [PATCHv2] mm/migrate: clean up useless code in migrate_vma_collect_pmd()

2019-08-15 Thread Jerome Glisse
On Thu, Aug 15, 2019 at 12:23:44PM -0700, Ralph Campbell wrote: > > On 8/15/19 10:19 AM, Jerome Glisse wrote: > > On Wed, Aug 07, 2019 at 04:41:12PM +0800, Pingfan Liu wrote: > > > Clean up useless 'pfn' variable. > > > > NAK there is a bug see below: > >

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 3/3] mm/migrate: remove the duplicated code migrate_vma_collect_hole()

2019-08-15 Thread Jerome Glisse
On Tue, Aug 06, 2019 at 04:00:11PM +0800, Pingfan Liu wrote: > After the previous patch which sees hole as invalid source, > migrate_vma_collect_hole() has the same code as migrate_vma_collect_skip(). > Removing the duplicated code. NAK this one too given previous NAK. > > Signed-off-by:

Re: [PATCH 2/3] mm/migrate: see hole as invalid source page

2019-08-15 Thread Jerome Glisse
On Tue, Aug 06, 2019 at 04:00:10PM +0800, Pingfan Liu wrote: > MIGRATE_PFN_MIGRATE marks a valid pfn, further more, suitable to migrate. > As for hole, there is no valid pfn, not to mention migration. > > Before this patch, hole has already relied on the following code to be > filtered out. Hence

Re: [PATCHv2] mm/migrate: clean up useless code in migrate_vma_collect_pmd()

2019-08-15 Thread Jerome Glisse
On Wed, Aug 07, 2019 at 04:41:12PM +0800, Pingfan Liu wrote: > Clean up useless 'pfn' variable. NAK there is a bug see below: > > Signed-off-by: Pingfan Liu > Cc: "Jérôme Glisse" > Cc: Andrew Morton > Cc: Mel Gorman > Cc: Jan Kara > Cc: "Kirill A. Shutemov" > Cc: Michal Hocko > Cc: Mike

Re: [PATCH 0/2] A General Accelerator Framework, WarpDrive

2019-08-15 Thread Jerome Glisse
On Wed, Aug 14, 2019 at 05:34:23PM +0800, Zhangfei Gao wrote: > *WarpDrive* is a general accelerator framework for the user application to > access the hardware without going through the kernel in data path. > > WarpDrive is the name for the whole framework. The component in kernel > is called

Re: [PATCH] mm/hmm: Fix bad subpage pointer in try_to_unmap_one

2019-07-16 Thread Jerome Glisse
On Mon, Jul 15, 2019 at 11:14:31PM -0700, John Hubbard wrote: > On 7/15/19 5:38 PM, Ralph Campbell wrote: > > On 7/15/19 4:34 PM, John Hubbard wrote: > > > On 7/15/19 3:00 PM, Andrew Morton wrote: > > > > On Tue, 9 Jul 2019 18:24:57 -0700 Ralph Campbell > > > > wrote: > > > > > > > >  

Re: [PATCH 2/5] mm/hmm: Clean up some coding style and comments

2019-06-06 Thread Jerome Glisse
On Thu, Jun 06, 2019 at 12:41:29PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 06, 2019 at 10:27:43AM -0400, Jerome Glisse wrote: > > On Thu, Jun 06, 2019 at 11:16:44AM -0300, Jason Gunthorpe wrote: > > > On Mon, May 06, 2019 at 04:29:39PM -0700, rcampb...@nvidia.com wrote: &

Re: [PATCH 2/5] mm/hmm: Clean up some coding style and comments

2019-06-06 Thread Jerome Glisse
On Thu, Jun 06, 2019 at 11:16:44AM -0300, Jason Gunthorpe wrote: > On Mon, May 06, 2019 at 04:29:39PM -0700, rcampb...@nvidia.com wrote: > > From: Ralph Campbell > > > > There are no functional changes, just some coding style clean ups and > > minor comment changes. > > > > Signed-off-by: Ralph

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-23 Thread Jerome Glisse
On Thu, May 23, 2019 at 04:10:38PM -0300, Jason Gunthorpe wrote: > > On Thu, May 23, 2019 at 02:24:58PM -0400, Jerome Glisse wrote: > > I can not take mmap_sem in range_register, the READ_ONCE is fine and > > they are no race as we do take a reference on the hmm struct t

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-23 Thread Jerome Glisse
On Thu, May 23, 2019 at 02:55:46PM -0300, Jason Gunthorpe wrote: > On Thu, May 23, 2019 at 01:33:03PM -0400, Jerome Glisse wrote: > > On Thu, May 23, 2019 at 01:34:29PM -0300, Jason Gunthorpe wrote: > > > On Thu, May 23, 2019 at 11:52:08AM -0400, Jerome Glisse wrote: > >

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-23 Thread Jerome Glisse
On Thu, May 23, 2019 at 01:34:29PM -0300, Jason Gunthorpe wrote: > On Thu, May 23, 2019 at 11:52:08AM -0400, Jerome Glisse wrote: > > On Thu, May 23, 2019 at 12:41:49PM -0300, Jason Gunthorpe wrote: > > > On Thu, May 23, 2019 at 11:04:32AM -0400, Jerome Glisse wrote: > >

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-23 Thread Jerome Glisse
On Thu, May 23, 2019 at 12:41:49PM -0300, Jason Gunthorpe wrote: > On Thu, May 23, 2019 at 11:04:32AM -0400, Jerome Glisse wrote: > > On Wed, May 22, 2019 at 08:57:37PM -0300, Jason Gunthorpe wrote: > > > On Wed, May 22, 2019 at 01:48:52PM -0400, Jerome Glisse wrote: > > &g

Re: [PATCH 1/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread Jerome Glisse
On Thu, May 23, 2019 at 12:25:37AM -0700, john.hubb...@gmail.com wrote: > From: John Hubbard > > For infiniband code that retains pages via get_user_pages*(), > release those pages via the new put_user_page(), or > put_user_pages*(), instead of put_page() > > This is a tiny part of the second

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-23 Thread Jerome Glisse
On Wed, May 22, 2019 at 08:57:37PM -0300, Jason Gunthorpe wrote: > On Wed, May 22, 2019 at 01:48:52PM -0400, Jerome Glisse wrote: > > > > > So attached is a rebase on top of 5.2-rc1, i have tested with pingpong > > > > (prefetch and not and different sizes). Seem

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-22 Thread Jerome Glisse
On Wed, May 22, 2019 at 07:39:06PM -0300, Jason Gunthorpe wrote: > On Wed, May 22, 2019 at 06:04:20PM -0400, Jerome Glisse wrote: > > On Wed, May 22, 2019 at 05:12:47PM -0300, Jason Gunthorpe wrote: > > > On Wed, May 22, 2019 at 01:48:52PM -0400, Jerome Glisse wrote: > >

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-22 Thread Jerome Glisse
On Wed, May 22, 2019 at 02:12:31PM -0700, Ralph Campbell wrote: > > On 5/22/19 1:12 PM, Jason Gunthorpe wrote: > > On Wed, May 22, 2019 at 01:48:52PM -0400, Jerome Glisse wrote: > > > > > static void put_per_mm(struct ib_umem_odp *umem_odp) > > > { >

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-22 Thread Jerome Glisse
On Wed, May 22, 2019 at 05:12:47PM -0300, Jason Gunthorpe wrote: > On Wed, May 22, 2019 at 01:48:52PM -0400, Jerome Glisse wrote: > > > static void put_per_mm(struct ib_umem_odp *umem_odp) > > { > > struct ib_ucontext_per_mm *per_mm = umem_odp->per_mm; > >

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-22 Thread Jerome Glisse
On Wed, May 22, 2019 at 04:22:19PM -0300, Jason Gunthorpe wrote: > On Wed, May 22, 2019 at 01:48:52PM -0400, Jerome Glisse wrote: > > > > > +long ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, > > > > +

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-22 Thread Jerome Glisse
On Tue, May 21, 2019 at 09:52:25PM -0300, Jason Gunthorpe wrote: > On Tue, May 21, 2019 at 04:53:22PM -0400, Jerome Glisse wrote: > > On Mon, May 06, 2019 at 04:56:57PM -0300, Jason Gunthorpe wrote: > > > On Thu, Apr 11, 2019 at 02:13:13PM -0400, jgli...@redhat.com wrote: &g

Re: [PATCH v4 0/1] Use HMM for ODP v4

2019-05-21 Thread Jerome Glisse
On Mon, May 06, 2019 at 04:56:57PM -0300, Jason Gunthorpe wrote: > On Thu, Apr 11, 2019 at 02:13:13PM -0400, jgli...@redhat.com wrote: > > From: Jérôme Glisse > > > > Just fixed Kconfig and build when ODP was not enabled, other than that > > this is the same as v3. Here is previous cover letter:

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] mm/dev_pfn: Exclude MEMORY_DEVICE_PRIVATE while computing virtual address

2019-05-20 Thread Jerome Glisse
On Mon, May 20, 2019 at 11:07:38AM +0530, Anshuman Khandual wrote: > On 05/18/2019 03:20 AM, Andrew Morton wrote: > > On Fri, 17 May 2019 16:08:34 +0530 Anshuman Khandual > > wrote: > > > >> The presence of struct page does not guarantee linear mapping for the pfn > >> physical range. Device

Re: [PATCH 0/5] mm/hmm: HMM documentation updates and code fixes

2019-05-13 Thread Jerome Glisse
On Mon, May 13, 2019 at 10:26:59AM -0700, Ralph Campbell wrote: > > > On 5/12/19 8:08 AM, Jerome Glisse wrote: > > On Mon, May 06, 2019 at 04:29:37PM -0700, rcampb...@nvidia.com wrote: > > > From: Ralph Campbell > > > > > > I hit a use after free bug

Re: [PATCH 4/5] mm/hmm: hmm_vma_fault() doesn't always call hmm_range_unregister()

2019-05-12 Thread Jerome Glisse
On Sun, May 12, 2019 at 11:07:24AM -0400, Jerome Glisse wrote: > On Tue, May 07, 2019 at 11:12:14AM -0700, Ralph Campbell wrote: > > > > On 5/7/19 6:15 AM, Souptick Joarder wrote: > > > On Tue, May 7, 2019 at 5:00 AM wrote: > > > > > > > > F

Re: [PATCH 0/5] mm/hmm: HMM documentation updates and code fixes

2019-05-12 Thread Jerome Glisse
On Mon, May 06, 2019 at 04:29:37PM -0700, rcampb...@nvidia.com wrote: > From: Ralph Campbell > > I hit a use after free bug in hmm_free() with KASAN and then couldn't > stop myself from cleaning up a bunch of documentation and coding style > changes. So the first two patches are clean ups, the

Re: [PATCH 4/5] mm/hmm: hmm_vma_fault() doesn't always call hmm_range_unregister()

2019-05-12 Thread Jerome Glisse
On Tue, May 07, 2019 at 11:12:14AM -0700, Ralph Campbell wrote: > > On 5/7/19 6:15 AM, Souptick Joarder wrote: > > On Tue, May 7, 2019 at 5:00 AM wrote: > > > > > > From: Ralph Campbell > > > > > > The helper function hmm_vma_fault() calls hmm_range_register() but is > > > missing a call to

Re: [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig

2019-05-02 Thread Jerome Glisse
On Wed, May 01, 2019 at 12:23:58PM -0700, Guenter Roeck wrote: > On Wed, May 01, 2019 at 02:38:51PM -0400, Jerome Glisse wrote: > > Andrew just the patch that would be nice to get in 5.2 so i can fix > > device driver Kconfig before doing the real update to mm HMM Kconfig > >

Re: [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig

2019-05-01 Thread Jerome Glisse
Andrew just the patch that would be nice to get in 5.2 so i can fix device driver Kconfig before doing the real update to mm HMM Kconfig On Wed, Apr 17, 2019 at 05:11:41PM -0400, jgli...@redhat.com wrote: > From: Jérôme Glisse > > This patch just add 2 new Kconfig that are _not use_ by anyone.

Re: [LSF/MM TOPIC] NUMA, memory hierarchy and device memory

2019-04-25 Thread Jerome Glisse
I see that the schedule is not full yet for the mm track and i would really like to be able to have a discussion on this topic Schedule: https://docs.google.com/spreadsheets/d/1Z1pDL-XeUT1ZwMWrBL8T8q3vtSqZpLPgF3Bzu_jejfk/edit#gid=0 On Fri, Jan 18, 2019 at 12:45:13PM -0500, Jerome Glisse wrote

[LSF/MM] Preliminary agenda ? Anyone ... anyone ? Bueller ?

2019-04-25 Thread Jerome Glisse
Did i miss preliminary agenda somewhere ? In previous year i think there use to be one by now :) Cheers, Jérôme

Re: [PATCH v3 14/28] userfaultfd: wp: handle COW properly for uffd-wp

2019-04-23 Thread Jerome Glisse
On Tue, Apr 23, 2019 at 11:00:30AM +0800, Peter Xu wrote: > On Mon, Apr 22, 2019 at 10:54:02AM -0400, Jerome Glisse wrote: > > On Mon, Apr 22, 2019 at 08:20:10PM +0800, Peter Xu wrote: > > > On Fri, Apr 19, 2019 at 11:02:53AM -0400, J

Re: [PATCH v12 21/31] mm: Introduce find_vma_rcu()

2019-04-22 Thread Jerome Glisse
On Tue, Apr 16, 2019 at 03:45:12PM +0200, Laurent Dufour wrote: > This allows to search for a VMA structure without holding the mmap_sem. > > The search is repeated while the mm seqlock is changing and until we found > a valid VMA. > > While under the RCU protection, a reference is taken on the

Re: [PATCH v12 15/31] mm: introduce __lru_cache_add_active_or_unevictable

2019-04-22 Thread Jerome Glisse
On Tue, Apr 16, 2019 at 03:45:06PM +0200, Laurent Dufour wrote: > The speculative page fault handler which is run without holding the > mmap_sem is calling lru_cache_add_active_or_unevictable() but the vm_flags > is not guaranteed to remain constant. > Introducing

Re: [RESEND PATCH] mm/hmm: Fix initial PFN for hugetlbfs pages

2019-04-22 Thread Jerome Glisse
On Fri, Apr 19, 2019 at 04:35:36PM -0700, rcampb...@nvidia.com wrote: > From: Ralph Campbell > > The mmotm patch [1] adds hugetlbfs support for HMM but the initial > PFN used to fill the HMM range->pfns[] array doesn't properly > compute the starting PFN offset. > This can be tested by running

Re: [PATCH v3 14/28] userfaultfd: wp: handle COW properly for uffd-wp

2019-04-22 Thread Jerome Glisse
On Mon, Apr 22, 2019 at 08:20:10PM +0800, Peter Xu wrote: > On Fri, Apr 19, 2019 at 11:02:53AM -0400, Jerome Glisse wrote: > > [...] > > > > > > + if (uffd_wp_resolve) { > > > > > + /* If the

Re: [PATCH v3 17/28] userfaultfd: wp: support swap and page migration

2019-04-19 Thread Jerome Glisse
On Fri, Apr 19, 2019 at 03:42:20PM +0800, Peter Xu wrote: > On Thu, Apr 18, 2019 at 04:59:07PM -0400, Jerome Glisse wrote: > > On Wed, Mar 20, 2019 at 10:06:31AM +0800, Peter Xu wrote: > > > For either swap and page migration, we all use the bit 2 of the entry to > > >

Re: [PATCH v3 14/28] userfaultfd: wp: handle COW properly for uffd-wp

2019-04-19 Thread Jerome Glisse
On Fri, Apr 19, 2019 at 02:26:50PM +0800, Peter Xu wrote: > On Thu, Apr 18, 2019 at 04:51:15PM -0400, Jerome Glisse wrote: > > On Wed, Mar 20, 2019 at 10:06:28AM +0800, Peter Xu wrote: > > > This allows uffd-wp to support write-protected pages for COW. > > > > &

Re: [PATCH] cifs: fix page reference leak with readv/writev

2019-04-18 Thread Jerome Glisse
On Wed, Apr 10, 2019 at 09:47:01PM -0500, Steve French wrote: > How was this discovered? Does it address a reported user problem? I have spotted it while tracking down how page reference are taken for bio and how they are release. In the current code, once the page are GUPed they are never

Re: [PATCH v3 00/28] userfaultfd: write protection support

2019-04-18 Thread Jerome Glisse
On Tue, Apr 09, 2019 at 02:08:39PM +0800, Peter Xu wrote: > On Wed, Mar 20, 2019 at 10:06:14AM +0800, Peter Xu wrote: > > This series implements initial write protection support for > > userfaultfd. Currently both shmem and hugetlbfs are not supported > > yet, but only anonymous memory. This is

Re: [PATCH v3 25/28] userfaultfd: wp: fixup swap entries in change_pte_range

2019-04-18 Thread Jerome Glisse
On Wed, Mar 20, 2019 at 10:06:39AM +0800, Peter Xu wrote: > In change_pte_range() we do nothing for uffd if the PTE is a swap > entry. That can lead to data mismatch if the page that we are going > to write protect is swapped out when sending the UFFDIO_WRITEPROTECT. > This patch applies/removes

Re: [PATCH v3 17/28] userfaultfd: wp: support swap and page migration

2019-04-18 Thread Jerome Glisse
On Wed, Mar 20, 2019 at 10:06:31AM +0800, Peter Xu wrote: > For either swap and page migration, we all use the bit 2 of the entry to > identify whether this entry is uffd write-protected. It plays a similar > role as the existing soft dirty bit in swap entries but only for keeping > the uffd-wp

Re: [PATCH v3 14/28] userfaultfd: wp: handle COW properly for uffd-wp

2019-04-18 Thread Jerome Glisse
On Wed, Mar 20, 2019 at 10:06:28AM +0800, Peter Xu wrote: > This allows uffd-wp to support write-protected pages for COW. > > For example, the uffd write-protected PTE could also be write-protected > by other usages like COW or zero pages. When that happens, we can't > simply set the write bit

Re: [PATCH v3 04/28] mm: allow VM_FAULT_RETRY for multiple times

2019-04-18 Thread Jerome Glisse
On Wed, Mar 20, 2019 at 10:06:18AM +0800, Peter Xu wrote: > The idea comes from a discussion between Linus and Andrea [1]. > > Before this patch we only allow a page fault to retry once. We > achieved this by clearing the FAULT_FLAG_ALLOW_RETRY flag when doing > handle_mm_fault() the second

Re: [PATCH v3 07/28] userfaultfd: wp: hook userfault handler to write protection fault

2019-04-18 Thread Jerome Glisse
On Wed, Mar 20, 2019 at 10:06:21AM +0800, Peter Xu wrote: > From: Andrea Arcangeli > > There are several cases write protection fault happens. It could be a > write to zero page, swaped page or userfault write protected > page. When the fault happens, there is no way to know if userfault > write

Re: IOMMU Page faults when running DMA transfers from PCIe device

2019-04-18 Thread Jerome Glisse
On Thu, Apr 18, 2019 at 09:37:58AM +, David Laight wrote: > From: Jerome Glisse > > Sent: 16 April 2019 16:33 > ... > > I am no expert but i am guessing your FPGA set the request field in the > > PCIE TLP write packet to 00:00.0 and this might work when IOMMU is off but

Re: [PATCH] mm/hmm: kconfig split HMM address space mirroring from device memory

2019-04-17 Thread Jerome Glisse
On Wed, Apr 17, 2019 at 12:33:35PM -0700, Guenter Roeck wrote: > On Wed, Apr 17, 2019 at 02:26:18PM -0400, Jerome Glisse wrote: > > On Wed, Apr 17, 2019 at 11:21:18AM -0700, Guenter Roeck wrote: > > > On Thu, Apr 11, 2019 at 02:03:26PM -0400, jgli...@redhat.com wrote: > >

Re: [PATCH] mm/hmm: kconfig split HMM address space mirroring from device memory

2019-04-17 Thread Jerome Glisse
On Wed, Apr 17, 2019 at 11:21:18AM -0700, Guenter Roeck wrote: > On Thu, Apr 11, 2019 at 02:03:26PM -0400, jgli...@redhat.com wrote: > > From: Jérôme Glisse > > > > To allow building device driver that only care about address space > > mirroring (like RDMA ODP) on platform that do not have all

Re: IOMMU Page faults when running DMA transfers from PCIe device

2019-04-17 Thread Jerome Glisse
On Wed, Apr 17, 2019 at 04:17:09PM +0200, Patrick Brunner wrote: > Am Dienstag, 16. April 2019, 17:33:07 CEST schrieb Jerome Glisse: > > On Mon, Apr 15, 2019 at 06:04:11PM +0200, Patrick Brunner wrote: > > > Dear all, > > > > > > I'm encountering very nasty p

Re: [PATCH v1 00/15] Keep track of GUPed pages in fs and block

2019-04-16 Thread Jerome Glisse
On Tue, Apr 16, 2019 at 10:28:40PM +0300, Boaz Harrosh wrote: > On 16/04/19 22:12, Dan Williams wrote: > > On Tue, Apr 16, 2019 at 11:59 AM Kent Overstreet > > wrote: > <> > > This all reminds of the failed attempt to teach the block layer to > > operate without pages: > > > >

Re: IOMMU Page faults when running DMA transfers from PCIe device

2019-04-16 Thread Jerome Glisse
On Mon, Apr 15, 2019 at 06:04:11PM +0200, Patrick Brunner wrote: > Dear all, > > I'm encountering very nasty problems regarding DMA transfers from an external > PCIe device to the main memory while the IOMMU is enabled, and I'm running > out > of ideas. I'm not even sure, whether it's a kernel

Re: [PATCH v3 0/1] Use HMM for ODP v3

2019-04-11 Thread Jerome Glisse
On Thu, Apr 11, 2019 at 12:29:43PM +, Leon Romanovsky wrote: > On Wed, Apr 10, 2019 at 11:41:24AM -0400, jgli...@redhat.com wrote: > > From: Jérôme Glisse > > > > Changes since v1/v2 are about rebase and better comments in the code. > > Previous cover letter slightly updated. > > > > > > This

Re: [PATCH] zram: pass down the bvec we need to read into in the work struct

2019-04-10 Thread Jerome Glisse
Adding more Cc and stable (i thought this was 5.1 addition). Note that without this patch on arch/kernel where PAGE_SIZE != 4096 userspace could read random memory through a zram block device (thought userspace probably would have no control on the address being read). On Mon, Apr 08, 2019 at

Re: [PATCH v2] vfio/type1: Limit DMA mappings per container

2019-04-03 Thread Jerome Glisse
On Tue, Apr 02, 2019 at 10:15:38AM -0600, Alex Williamson wrote: > Memory backed DMA mappings are accounted against a user's locked > memory limit, including multiple mappings of the same memory. This > accounting bounds the number of such mappings that a user can create. > However, DMA mappings

Re: [PATCH 6/6] arm64/mm: Enable ZONE_DEVICE

2019-04-03 Thread Jerome Glisse
On Wed, Apr 03, 2019 at 02:58:28PM +0100, Robin Murphy wrote: > [ +Dan, Jerome ] > > On 03/04/2019 05:30, Anshuman Khandual wrote: > > Arch implementation for functions which create or destroy vmemmap mapping > > (vmemmap_populate, vmemmap_free) can comprehend and allocate from inside > > device

Re: [PATCH v2 01/11] mm/hmm: select mmu notifier when selecting HMM

2019-03-29 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 01:33:42PM -0700, John Hubbard wrote: > On 3/25/19 7:40 AM, jgli...@redhat.com wrote: > > From: Jérôme Glisse > > > > To avoid random config build issue, select mmu notifier when HMM is > > selected. In any cases when HMM get selected it will be by users that > > will

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 11:21:00AM -0700, Ira Weiny wrote: > On Thu, Mar 28, 2019 at 09:50:03PM -0400, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 06:18:35PM -0700, John Hubbard wrote: > > > On 3/28/19 6:00 PM, Jerome Glisse wrote: > > > > On Thu, Mar 28, 2019

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 07:11:17PM -0700, John Hubbard wrote: > On 3/28/19 6:50 PM, Jerome Glisse wrote: > [...] > >>> > >>> The hmm_put() is just releasing the reference on the hmm struct. > >>> > >>> Here i feel i am getting contradicting

Re: [PATCH v2 09/11] mm/hmm: allow to mirror vma of a file on a DAX backed filesystem v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 11:04:26AM -0700, Ira Weiny wrote: > On Mon, Mar 25, 2019 at 10:40:09AM -0400, Jerome Glisse wrote: > > From: Jérôme Glisse > > > > HMM mirror is a device driver helpers to mirror range of virtual address. > > It means that the process job

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 07:05:21PM -0700, John Hubbard wrote: > On 3/28/19 6:59 PM, Jerome Glisse wrote: > >>>>>> [...] > >>>>> Indeed I did not realize there is an hmm "pfn" until I saw this > >>>>> function: > >>&

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 09:42:59PM -0400, Jerome Glisse wrote: > On Thu, Mar 28, 2019 at 06:30:26PM -0700, John Hubbard wrote: > > On 3/28/19 6:17 PM, Jerome Glisse wrote: > > > On Thu, Mar 28, 2019 at 09:42:31AM -0700, Ira Weiny wrote: > > >> On Thu, Mar 28, 2019 at

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 06:18:35PM -0700, John Hubbard wrote: > On 3/28/19 6:00 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny wrote: > >> On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard wrote: > >>> On 3/28/19 2:21 PM, Jero

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 06:30:26PM -0700, John Hubbard wrote: > On 3/28/19 6:17 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 09:42:31AM -0700, Ira Weiny wrote: > >> On Thu, Mar 28, 2019 at 04:28:47PM -0700, John Hubbard wrote: > >>> On 3/28/19 4:21 PM, Jero

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 09:42:31AM -0700, Ira Weiny wrote: > On Thu, Mar 28, 2019 at 04:28:47PM -0700, John Hubbard wrote: > > On 3/28/19 4:21 PM, Jerome Glisse wrote: > > > On Thu, Mar 28, 2019 at 03:40:42PM -0700, John Hubbard wrote: > > >> On 3/28/19 3:31 PM, Jerom

Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 09:57:09AM -0700, Ira Weiny wrote: > On Thu, Mar 28, 2019 at 05:39:26PM -0700, John Hubbard wrote: > > On 3/28/19 2:21 PM, Jerome Glisse wrote: > > > On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: > > >> On 3/28/19

Re: [PATCH v2 06/11] mm/hmm: improve driver API to work and wait over a range v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 09:12:21AM -0700, Ira Weiny wrote: > On Mon, Mar 25, 2019 at 10:40:06AM -0400, Jerome Glisse wrote: > > From: Jérôme Glisse > > > > A common use case for HMM mirror is user trying to mirror a range > > and before they could program the

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 04:28:47PM -0700, John Hubbard wrote: > On 3/28/19 4:21 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 03:40:42PM -0700, John Hubbard wrote: > >> On 3/28/19 3:31 PM, Jerome Glisse wrote: > >>> On Thu, Mar 28, 2019 at 03:19:06PM -0700, J

Re: [PATCH v2 10/11] mm/hmm: add helpers for driver to safely take the mmap_sem v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 04:20:37PM -0700, John Hubbard wrote: > On 3/28/19 4:05 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 03:43:33PM -0700, John Hubbard wrote: > >> On 3/28/19 3:40 PM, Jerome Glisse wrote: > >>> On Thu, Mar 28, 2019 at 03:25:39PM -0700, J

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 03:40:42PM -0700, John Hubbard wrote: > On 3/28/19 3:31 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 03:19:06PM -0700, John Hubbard wrote: > >> On 3/28/19 3:12 PM, Jerome Glisse wrote: > >>> On Thu, Mar 28, 2019 at 02:59:50PM -0700, J

Re: [PATCH v2 10/11] mm/hmm: add helpers for driver to safely take the mmap_sem v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 03:43:33PM -0700, John Hubbard wrote: > On 3/28/19 3:40 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 03:25:39PM -0700, John Hubbard wrote: > >> On 3/28/19 3:08 PM, Jerome Glisse wrote: > >>> On Thu, Mar 28, 2019 at 02:41:02PM -0700, J

Re: [PATCH v2 10/11] mm/hmm: add helpers for driver to safely take the mmap_sem v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 03:25:39PM -0700, John Hubbard wrote: > On 3/28/19 3:08 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 02:41:02PM -0700, John Hubbard wrote: > >> On 3/28/19 2:30 PM, Jerome Glisse wrote: > >>> On Thu, Mar 28, 2019 at 01:54:01PM -0700, J

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 03:19:06PM -0700, John Hubbard wrote: > On 3/28/19 3:12 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 02:59:50PM -0700, John Hubbard wrote: > >> On 3/25/19 7:40 AM, jgli...@redhat.com wrote: > >>> From: Jérôme Glisse > >>>

Re: [PATCH v2 07/11] mm/hmm: add default fault flags to avoid the need to pre-fill pfns arrays.

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 02:59:50PM -0700, John Hubbard wrote: > On 3/25/19 7:40 AM, jgli...@redhat.com wrote: > > From: Jérôme Glisse > > > > The HMM mirror API can be use in two fashions. The first one where the HMM > > user coalesce multiple page faults into one request and set flags per pfns

Re: [PATCH v2 10/11] mm/hmm: add helpers for driver to safely take the mmap_sem v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 02:41:02PM -0700, John Hubbard wrote: > On 3/28/19 2:30 PM, Jerome Glisse wrote: > > On Thu, Mar 28, 2019 at 01:54:01PM -0700, John Hubbard wrote: > >> On 3/25/19 7:40 AM, jgli...@redhat.com wrote: > >>> From: Jérôme Glisse > >>> &

Re: [PATCH v2 05/11] mm/hmm: improve and rename hmm_vma_fault() to hmm_range_fault() v2

2019-03-28 Thread Jerome Glisse
On Thu, Mar 28, 2019 at 06:43:51AM -0700, Ira Weiny wrote: > On Mon, Mar 25, 2019 at 10:40:05AM -0400, Jerome Glisse wrote: > > From: Jérôme Glisse > > > > Rename for consistency between code, comments and documentation. Also > > improves the comments on all the possi

  1   2   3   4   5   6   7   8   9   10   >