Re: [PATCH] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-16 Thread Matthew Wilcox
On Fri, Apr 16, 2021 at 11:37:19AM +0200, Peter Enderborg wrote: > diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c > index 6fa761c9cc78..3c1a82b51a6f 100644 > --- a/fs/proc/meminfo.c > +++ b/fs/proc/meminfo.c > @@ -16,6 +16,7 @@ > #ifdef CONFIG_CMA > #include > #endif > +#include > #includ

Re: [PATCH] drm/amd/amdgpu/amdgpu_drv.c: Replace drm_modeset_lock_all with drm_modeset_lock

2021-04-22 Thread Matthew Wilcox
} > > - drm_modeset_unlock_all(drm_dev); > - I might remove the {} around ret = -EBUSY, but this is good. Reviewed-by: Matthew Wilcox (Oracle) ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v5 3/9] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks

2021-08-13 Thread Matthew Wilcox
On Fri, Aug 13, 2021 at 06:51:05PM +0300, Andy Shevchenko wrote: > On Fri, Aug 13, 2021 at 09:17:11AM -0600, Jim Cromie wrote: > > +int param_set_dyndbg(const char *instr, const struct kernel_param *kp) > > +{ > > + unsigned long inbits; > > + int rc, i, chgct = 0, totct = 0; > > + char query

Re: [PATCH] drm/ttm: stop warning on TT shrinker failure

2021-03-22 Thread Matthew Wilcox
On Mon, Mar 22, 2021 at 02:49:27PM +0100, Daniel Vetter wrote: > On Sun, Mar 21, 2021 at 03:18:28PM +0100, Christian König wrote: > > Am 20.03.21 um 14:17 schrieb Daniel Vetter: > > > On Sat, Mar 20, 2021 at 10:04 AM Christian König > > > wrote: > > > > Am 19.03.21 um 20:06 schrieb Daniel Vetter:

Re: [PATCH 1/2] mm: replace BUG_ON in vm_insert_page with a return of an error

2021-02-03 Thread Matthew Wilcox
On Tue, Feb 02, 2021 at 04:31:33PM -0800, Suren Baghdasaryan wrote: > Replace BUG_ON(vma->vm_flags & VM_PFNMAP) in vm_insert_page with > WARN_ON_ONCE and returning an error. This is to ensure users of the > vm_insert_page that set VM_PFNMAP are notified of the wrong flag usage > and get an indicati

Re: [PATCH v3 2/2] dmabuf: Add dmabuf inode number to /proc/*/fdinfo

2021-02-07 Thread Matthew Wilcox
On Fri, Feb 05, 2021 at 02:23:20AM +, Kalesh Singh wrote: > +DMA Buffer files > + > + > +:: > + > + pos:0 > + flags: 04002 > + mnt_id: 9 > + dmabuf_inode_no: 63107 inode_nr would be better than inode_no. But even better would be to match stat(2) and just ca

Re: [PATCH v5 1/8] mm: Remove special swap entry functions

2021-03-09 Thread Matthew Wilcox
On Tue, Mar 09, 2021 at 11:14:58PM +1100, Alistair Popple wrote: > -static inline struct page *migration_entry_to_page(swp_entry_t entry) > -{ > - struct page *p = pfn_to_page(swp_offset(entry)); > - /* > - * Any use of migration entries may only occur while the > - * correspondin

Re: make alloc_anon_inode more useful

2021-03-09 Thread Matthew Wilcox
On Tue, Mar 09, 2021 at 04:53:39PM +0100, Christoph Hellwig wrote: > this series first renames the existing alloc_anon_inode to > alloc_anon_inode_sb to clearly mark it as requiring a superblock. > > It then adds a new alloc_anon_inode that works on the anon_inode > file system super block, thus r

Re: [PATCH] fb_defio: Remove custom address_space_operations

2021-03-10 Thread Matthew Wilcox
On Wed, Mar 10, 2021 at 06:38:07PM +, William Kucharski wrote: > Looks good, just one super minor nit inline. > > @@ -228,13 +202,6 @@ void fb_deferred_io_cleanup(struct fb_info *info) > > > > BUG_ON(!fbdefio); > > cancel_delayed_work_sync(&info->deferred_work); > > - > > - /* clear

Re: [PATCH 00/53] Get rid of UTF-8 chars that can be mapped as ASCII

2021-05-10 Thread Matthew Wilcox
On Mon, May 10, 2021 at 02:16:16PM +0100, Edward Cree wrote: > On 10/05/2021 12:55, Mauro Carvalho Chehab wrote: > > The main point on this series is to replace just the occurrences > > where ASCII represents the symbol equally well > > > - U+2014 ('—'): EM DASH > Em dash is not the same thing

Re: [PATCH] drivers/video/fbdev/core/fbmem.c: add pointer judgment

2021-05-19 Thread Matthew Wilcox
On Wed, May 19, 2021 at 08:00:28PM +0800, songqiang wrote: > Signed-off-by: songqiang > --- You need to explain: - Why you think this patch is needed - Did you observe a problem at runtime? - Is this the output from some checking tool? - Why this is the right way to address the problem

Re: [PATCH v2 1/8] mm: slab: provide krealloc_array()

2020-11-03 Thread Matthew Wilcox
On Mon, Nov 02, 2020 at 04:20:30PM +0100, Bartosz Golaszewski wrote: > +Chunks allocated with `kmalloc` can be resized with `krealloc`. Similarly > +to `kmalloc_array`: a helper for resising arrays is provided in the form of > +`krealloc_array`. Is there any reason you chose to `do_this` instead o

Re: [PATCH v1 1/3] mm: split vm_normal_pages for LRU and non-LRU handling

2022-03-10 Thread Matthew Wilcox
On Thu, Mar 10, 2022 at 11:26:31AM -0600, Alex Sierra wrote: > @@ -606,7 +606,7 @@ static void print_bad_pte(struct vm_area_struct *vma, > unsigned long addr, > * PFNMAP mappings in order to support COWable mappings. > * > */ > -struct page *vm_normal_page(struct vm_area_struct *vma, unsigne

Re: [PATCH v12 1/6] drm: Add arch arm64 for drm_clflush_virt_range

2022-02-25 Thread Matthew Wilcox
On Fri, Feb 25, 2022 at 06:42:37PM +, Tvrtko Ursulin wrote: > Matthew, what do you think fix for this build warning on h8300 and s390 > should be? Or perhaps a build environment issue with kernel test robot? I'd suggest this should do the job: +++ b/include/linux/cacheflush.h @@ -4,6 +4,8 @@

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Matthew Wilcox
On Mon, Feb 28, 2022 at 12:10:24PM -0800, Linus Torvalds wrote: > We can do > > typeof(pos) pos > > in the 'for ()' loop, and never use __iter at all. > > That means that inside the for-loop, we use a _different_ 'pos' than outside. Then we can never use -Wshadow ;-( I'd love to be abl

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Matthew Wilcox
On Mon, Feb 28, 2022 at 12:37:15PM -0800, Linus Torvalds wrote: > On Mon, Feb 28, 2022 at 12:16 PM Matthew Wilcox wrote: > > > > Then we can never use -Wshadow ;-( I'd love to be able to turn it on; > > it catches real bugs. > > Oh, we already can never use -W

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-01 Thread Matthew Wilcox
up is ... I'll take a look at the rest of cleaning this up soon. >From 28ffe35d56223d4242b915832299e5acc926737e Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Tue, 1 Mar 2022 13:47:07 -0500 Subject: [PATCH] wait: Parameterize the return variable to ___wait_event()

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 04:15:33AM +0200, Jarkko Sakkinen wrote: > Sometimes you might want to use MAP_POPULATE to ask a device driver to > initialize the device memory in some specific manner. SGX driver can use > this to request more memory by issuing ENCLS[EAUG] x86 opcode for each > page in the

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 05:21:11AM +0200, Jarkko Sakkinen wrote: > On Sun, Mar 06, 2022 at 02:57:55AM +0000, Matthew Wilcox wrote: > > On Sun, Mar 06, 2022 at 04:15:33AM +0200, Jarkko Sakkinen wrote: > > > Sometimes you might want to use MAP_POPULATE to ask a device driver to &g

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 06:11:21AM +0200, Jarkko Sakkinen wrote: > On Sun, Mar 06, 2022 at 03:52:12AM +0000, Matthew Wilcox wrote: > > On Sun, Mar 06, 2022 at 05:21:11AM +0200, Jarkko Sakkinen wrote: > > > On Sun, Mar 06, 2022 at 02:57:55AM +0000, Matthew Wilcox wrote: > >

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 06:25:52AM +0200, Jarkko Sakkinen wrote: > > Are you deliberately avoiding the question? I'm not asking about > > implementation. I'm asking about the semantics of MAP_POPULATE with > > your driver. > > No. I just noticed a bug in the guard from your comment that I wanted

Re: [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-06 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 07:32:04AM +0200, Jarkko Sakkinen wrote: > For device memory (aka VM_IO | VM_PFNMAP) MAP_POPULATE does nothing. Allow > to use that for initializing the device memory by providing a new callback > f_ops->populate() for the purpose. As I said, NAK.

Re: [PATCH RFC 1/3] mm: Add f_ops->populate()

2022-03-06 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 07:02:57PM +0200, Jarkko Sakkinen wrote: > So can I conclude from this that in general having populate available for > device memory is something horrid, or just the implementation path? You haven't even attempted to explain what the problem is you're trying to solve. You'

Re: [PATCH RFC v2] mm: Add f_ops->populate()

2022-03-07 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 03:41:54PM -0800, Dave Hansen wrote: > In short: page faults stink. The core kernel has lots of ways of > avoiding page faults like madvise(MADV_WILLNEED) or mmap(MAP_POPULATE). > But, those only work on normal RAM that the core mm manages. > > SGX is weird. SGX memory i

Re: [PATCH v1 00/12] MEMORY_DEVICE_COHERENT for CPU-accessible coherent device memory

2021-10-12 Thread Matthew Wilcox
On Tue, Oct 12, 2021 at 11:39:57AM -0700, Andrew Morton wrote: > Because I must ask: if this feature is for one single computer which > presumably has a custom kernel, why add it to mainline Linux? I think in particular patch 2 deserves to be merged because it removes a ton of cruft from every cal

Re: [PATCH v1 1/2] ext4/xfs: add page refcount helper

2021-10-14 Thread Matthew Wilcox
il. > > Signed-off-by: Ralph Campbell > Signed-off-by: Alex Sierra > Reviewed-by: Christoph Hellwig > Acked-by: Theodore Ts'o > Acked-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle)

Re: [PATCH v1 2/2] mm: remove extra ZONE_DEVICE struct page refcount

2021-10-14 Thread Matthew Wilcox
not being used (gup, compaction, > migration, etc.). Clean up the code so the reference count doesn't need to > be treated specially for ZONE_DEVICE. > > Signed-off-by: Ralph Campbell > Signed-off-by: Alex Sierra > Reviewed-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle)

Re: [PATCH v1 2/2] mm: remove extra ZONE_DEVICE struct page refcount

2021-10-14 Thread Matthew Wilcox
It would probably help if you cc'd Dan on this. As far as I know he's the only person left who cares about GUP on DAX. On Thu, Oct 14, 2021 at 02:06:34PM -0300, Jason Gunthorpe wrote: > On Thu, Oct 14, 2021 at 10:39:28AM -0500, Alex Sierra wrote: > > From: Ralph Campbell > > > > ZONE_DEVICE st

Re: [PATCH v1 2/2] mm: remove extra ZONE_DEVICE struct page refcount

2021-10-16 Thread Matthew Wilcox
On Sat, Oct 16, 2021 at 12:44:50PM -0300, Jason Gunthorpe wrote: > Assuming changing FSDAX is hard.. How would DAX people feel about just > deleting the PUD/PMD support until it can be done with compound pages? I think there are customers who would find that an unacceptable answer :-)

Re: BoF at LPC: Documenting the Heterogeneous Memory Model Architecture

2021-09-23 Thread Matthew Wilcox
On Thu, Sep 23, 2021 at 04:25:08PM -0400, Felix Kuehling wrote: > Change of plan: Instead of a BoF, this is now a session in the "GPU/media/AI > buffer management and interop MC" micro conference. Thank you Daniel Stone > for making that happen. > https://linuxplumbersconf.org/event/11/contribution

Phyr Starter

2022-01-10 Thread Matthew Wilcox
TLDR: I want to introduce a new data type: struct phyr { phys_addr_t addr; size_t len; }; and use it to replace bio_vec as well as using it to replace the array of struct pages used by get_user_pages() and friends. --- There are two distinct problems I want to address: doing I/O

Re: Phyr Starter

2022-01-10 Thread Matthew Wilcox
On Mon, Jan 10, 2022 at 08:41:26PM -0400, Jason Gunthorpe wrote: > On Mon, Jan 10, 2022 at 07:34:49PM +0000, Matthew Wilcox wrote: > > > Finally, it may be possible to stop using scatterlist to describe the > > input to the DMA-mapping operation. We may be able to get struct &g

Re: Phyr Starter

2022-01-11 Thread Matthew Wilcox
On Tue, Jan 11, 2022 at 12:40:10PM +0100, Thomas Zimmermann wrote: > Hi > > Am 10.01.22 um 20:34 schrieb Matthew Wilcox: > > TLDR: I want to introduce a new data type: > > > > struct phyr { > > phys_addr_t addr; > > size_t len; > > }

Re: Phyr Starter

2022-01-11 Thread Matthew Wilcox
On Tue, Jan 11, 2022 at 12:17:18AM -0800, John Hubbard wrote: > Zooming in on the pinning aspect for a moment: last time I attempted to > convert O_DIRECT callers from gup to pup, I recall wanting very much to > record, in each bio_vec, whether these pages were acquired via FOLL_PIN, > or some non-

Re: Phyr Starter

2022-01-11 Thread Matthew Wilcox
On Tue, Jan 11, 2022 at 11:01:42AM -0400, Jason Gunthorpe wrote: > On Tue, Jan 11, 2022 at 04:32:56AM +0000, Matthew Wilcox wrote: > > On Mon, Jan 10, 2022 at 08:41:26PM -0400, Jason Gunthorpe wrote: > > > On Mon, Jan 10, 2022 at 07:34:49PM +0000, Matthew Wilcox wrote: > >

Re: Phyr Starter

2022-01-11 Thread Matthew Wilcox
On Tue, Jan 11, 2022 at 04:21:59PM -0400, Jason Gunthorpe wrote: > On Tue, Jan 11, 2022 at 06:33:57PM +0000, Matthew Wilcox wrote: > > > > Then we are we using get_user_phyr() at all if we are just storing it > > > in a sg? > > > > I did consider just implemen

Re: Phyr Starter

2022-01-12 Thread Matthew Wilcox
On Tue, Jan 11, 2022 at 06:53:06PM -0400, Jason Gunthorpe wrote: > IOMMU is not common in those cases, it is slow. > > So you end up with 16 bytes per entry then another 24 bytes in the > entirely redundant scatter list. That is now 40 bytes/page for typical > HPC case, and I can't see that being

Re: [PATCH] mm/pgtable: Drop pgtable_t variable from pte_fn_t functions

2019-05-02 Thread Matthew Wilcox
On Thu, May 02, 2019 at 06:48:46PM +0530, Anshuman Khandual wrote: > Drop the pgtable_t variable from all implementation for pte_fn_t as none of > them use it. apply_to_pte_range() should stop computing it as well. Should > help us save some cycles. You didn't add Martin Schwidefsky for some reaso

Re: [PATCH] mm/pgtable: Drop pgtable_t variable from pte_fn_t functions

2019-05-06 Thread Matthew Wilcox
On Thu, May 02, 2019 at 04:14:57PM +0200, Martin Schwidefsky wrote: > On Thu, 2 May 2019 06:46:23 -0700 > Matthew Wilcox wrote: > > > On Thu, May 02, 2019 at 06:48:46PM +0530, Anshuman Khandual wrote: > > > Drop the pgtable_t variable from all implementation for pt

Re: [Intel-gfx] [PATCH 1/3] treewide: Lift switch variables out of switches

2019-01-24 Thread Matthew Wilcox
On Wed, Jan 23, 2019 at 04:17:30PM +0200, Jani Nikula wrote: > Can't have: > > switch (i) { > int j; > case 0: > /* ... */ > } > > because it can't be turned into: > > switch (i) { > int j = 0; /* not valid C */ > case 0: >

Re: [PATCHv2 1/9] mm: Introduce new vm_insert_range and vm_insert_range_buggy API

2019-02-08 Thread Matthew Wilcox
On Thu, Feb 07, 2019 at 09:19:47PM +0530, Souptick Joarder wrote: > Just thought to take opinion for documentation before placing it in v3. > Does it looks fine ? > > +/** > + * __vm_insert_range - insert range of kernel pages into user vma > + * @vma: user vma to map to > + * @pages: pointer to a

[PATCH] Build etnaviv on non-ARM architectures

2019-01-09 Thread Matthew Wilcox
I wanted to test-compile etnaviv on x86 after making a tree-wide change to it. Unfortunately, Kconfig has a bad dependency, so I couldn't. Signed-off-by: Matthew Wilcox diff --git a/drivers/gpu/drm/etnaviv/Kconfig b/drivers/gpu/drm/etnaviv/Kconfig index 041a77e400d4..342591a1084e 100644

[PATCH] etnaviv mailing list is moderated

2019-01-09 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox diff --git a/MAINTAINERS b/MAINTAINERS index 32d76a90..44888eb121d8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5141,7 +5141,7 @@ DRM DRIVERS FOR VIVANTE GPU IP M: Lucas Stach R: Russell King R: Christian Gmeiner -L: etna

[PATCH 08/34] drm: Remove linked lists for lessees

2019-02-22 Thread Matthew Wilcox
These are already tracked in the XArray so we do not need to also keep a doubly-linked list. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_auth.c | 4 +-- drivers/gpu/drm/drm_lease.c | 58 ++--- include/drm/drm_auth.h | 4 +-- 3 files changed, 30

[PATCH 25/34] drm/i915: Convert vgpus_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/gvt/display.c | 5 +++-- drivers/gpu/drm/i915/gvt/gvt.c | 4 +--- drivers/gpu/drm/i915/gvt/gvt.h | 5 +++-- drivers/gpu/drm/i915/gvt/kvmgt.c| 2 +- drivers/gpu/drm/i915/gvt/sched_policy.c | 2 +- drivers

[PATCH 09/34] drm: Convert ctx_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_context.c | 42 +++ include/drm/drm_device.h | 2 +- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index 506663c69b0a

[PATCH 21/34] drm/i915: Convert get_page to XArray

2019-02-22 Thread Matthew Wilcox
This initially seemed like an ideal use-case for the store_range functionality, but there's no easy way to determine where we were relative to the base of the entry. So this is a straightforward conversion which doesn't even touch the locking. Signed-off-by: Matthew Wilcox --- drive

[PATCH 05/34] drm: Convert syncobj_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_syncobj.c | 64 +++ include/drm/drm_file.h| 6 ++-- 2 files changed, 22 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index db30a0e89db8

[PATCH 20/34] drm/i915: Convert page_track_tree to XArray

2019-02-22 Thread Matthew Wilcox
No locking changes. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/gvt/gvt.h| 2 +- drivers/gpu/drm/i915/gvt/page_track.c | 6 +++--- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b

[PATCH 02/34] drm: Convert aux_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_dp_aux_dev.c | 41 +--- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 0e4f25d63fd2..393a32976900 100644 --- a/drivers/gpu

[PATCH 04/34] drm: Convert object_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 23 +++ drivers/gpu/drm/drm_gem.c | 67 +++ drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 12 ++-- drivers/gpu/drm/i915/i915_debugfs.c | 20 +++--- drivers/gpu

[PATCH 29/34] drm/vc4: Convert perfmon IDR to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- drivers/gpu/drm/vc4/vc4_perfmon.c | 33 +++ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 4f87b03f837d

[PATCH 00/34] Convert DRM to XArray

2019-02-22 Thread Matthew Wilcox
dr_replace() has no exact equivalent. Some users relied on its exact semantics of only storing if the entry was non-NULL, but all users of idr_replace() were able to use xa_store(). - The family of radix tree gang lookup functions have been replaced with xa_extract(). Matthew Wi

[PATCH 34/34] drm/vmwgfx: Convert res_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 +-- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 31 ++-- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 03/34] drm: Convert object_name_idr to XArray

2019-02-22 Thread Matthew Wilcox
Leave the object_name_lock in place for now as I'm not certain it can be removed safely. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_debugfs.c | 19 ++- drivers/gpu/drm/drm_gem.c | 11 +-- include/drm/drm_device.h | 2 +- 3 files change

[PATCH 30/34] drm/sis: Convert object_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/sis/sis_drv.c | 4 +--- drivers/gpu/drm/sis/sis_drv.h | 2 +- drivers/gpu/drm/sis/sis_mm.c | 17 - 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c

[PATCH 14/34] drm/amdgpu: Convert pasid_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 66 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 12 ++--- 3 files changed, 29 insertions(+), 52 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 01/34] drm: Convert drm_minors_idr to XArray

2019-02-22 Thread Matthew Wilcox
Divide all the indices by 64 to save memory. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_drv.c | 49 ++- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 12e5e2be7890

[PATCH 17/34] drm/etnaviv: Convert fence_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 +--- drivers/gpu/drm/etnaviv/etnaviv_gpu.c| 5 ++--- drivers/gpu/drm/etnaviv/etnaviv_gpu.h| 3 ++- drivers/gpu/drm/etnaviv/etnaviv_sched.c | 8 4 files changed, 9 insertions(+), 11

[PATCH 28/34] drm/tegra: Convert contexts IDR to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/tegra/drm.c | 35 ++- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 4b70ce664c41..5daa414cc2cf 100644 --- a/drivers/gpu/drm/tegra

[PATCH 33/34] drm/vmwgfx: Convert base IDR to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/vmwgfx/ttm_object.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.c b/drivers/gpu/drm/vmwgfx/ttm_object.c index 36990b80e790..8f394b94060b 100644 --- a

[PATCH 19/34] drm/i915: Convert spt_tree to XArray

2019-02-22 Thread Matthew Wilcox
A straightforward conversion. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/gvt/gtt.c | 18 -- drivers/gpu/drm/i915/gvt/gtt.h | 2 +- drivers/gpu/drm/i915/i915_drv.h | 1 + 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt

[PATCH 16/34] drm/amdkfd: Convert alloc_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 32 +++- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd

[PATCH 27/34] drm/qxl: Convert surf_id_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/qxl/qxl_cmd.c | 60 --- drivers/gpu/drm/qxl/qxl_drv.h | 3 +- drivers/gpu/drm/qxl/qxl_kms.c | 5 +-- 3 files changed, 23 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu

[PATCH 15/34] drm/amdkfd: Convert event_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 71 ++--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 2 files changed, 30 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd

[PATCH 31/34] drm/vgem: Convert fence_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/vgem/vgem_drv.h | 3 +-- drivers/gpu/drm/vgem/vgem_fence.c | 43 +-- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.h b/drivers/gpu/drm/vgem/vgem_drv.h index

[PATCH 24/34] drm/i915: Convert metrics_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_perf.c | 39 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index

[PATCH 06/34] drm: Convert magic_map to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_auth.c | 18 -- include/drm/drm_auth.h | 5 ++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 1669c42c40ed..268189e9e2e0 100644 --- a

[PATCH 07/34] drm: Convert lessee_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_auth.c | 3 +-- drivers/gpu/drm/drm_lease.c | 15 ++- include/drm/drm_auth.h | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index

[PATCH 26/34] drm/qxl: Convert release_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/qxl/qxl_drv.h | 3 +- drivers/gpu/drm/qxl/qxl_kms.c | 3 +- drivers/gpu/drm/qxl/qxl_release.c | 54 +-- 3 files changed, 25 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers

[PATCH 22/34] drm/i915: Convert object_idr to IDA

2019-02-22 Thread Matthew Wilcox
I suspect dmabuf_obj_list_head and object_ids should be combined into a single xarray, but that's a job for later. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/gvt/dmabuf.c | 7 +++ drivers/gpu/drm/i915/gvt/gvt.h| 2 +- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 3 files ch

[PATCH 10/34] drm: Convert tile_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/drm_connector.c | 27 +++ drivers/gpu/drm/drm_mode_config.c | 3 +-- include/drm/drm_mode_config.h | 12 ++-- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c

[PATCH 13/34] drm/amdgpu: Convert ctx_handles to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 42 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 4 +-- 4 files changed, 19 insertions

[PATCH 18/34] drm/i915: Convert handles_vma to XArray

2019-02-22 Thread Matthew Wilcox
Straightforward conversion. Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_context.c | 12 +--- drivers/gpu/drm/i915/i915_gem_context.h | 4 ++-- drivers/gpu/drm/i915/i915_gem_execbuffer.c| 6

[PATCH 23/34] drm/i915: Convert context_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/i915/i915_debugfs.c | 32 - drivers/gpu/drm/i915/i915_drv.h | 4 ++-- drivers/gpu/drm/i915/i915_gem_context.c | 31 ++-- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a

[PATCH 32/34] drm/via: Convert object_idr to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/via/via_drv.h | 2 +- drivers/gpu/drm/via/via_map.c | 4 +--- drivers/gpu/drm/via/via_mm.c | 11 +-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h index

[PATCH 11/34] drm: Convert crtc_idr to XArray

2019-02-22 Thread Matthew Wilcox
the stack and reparenting it afterwards. Signed-off-by: Matthew Wilcox --- Documentation/gpu/todo.rst| 3 - drivers/gpu/drm/drm_auth.c| 4 +- drivers/gpu/drm/drm_lease.c | 136 ++ drivers/gpu/drm/drm_mode_config.c | 3 +- drive

[PATCH 12/34] drm/agp: Convert bo_list_handles to XArray

2019-02-22 Thread Matthew Wilcox
Signed-off-by: Matthew Wilcox --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 22 - drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 -- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/drivers

Re: [PATCH 11/34] drm: Convert crtc_idr to XArray

2019-02-25 Thread Matthew Wilcox
On Fri, Feb 22, 2019 at 10:40:14AM +0100, Daniel Vetter wrote: > On Thu, Feb 21, 2019 at 10:41:41AM -0800, Matthew Wilcox wrote: > > - Rename it to 'objects', as requested in todo.rst > > Yay, thanks! > > > - Also convert leases IDR to XArray as the two are oc

Re: [PATCH 01/34] drm: Convert drm_minors_idr to XArray

2019-02-25 Thread Matthew Wilcox
On Fri, Feb 22, 2019 at 10:11:14AM +0100, Daniel Vetter wrote: > On Thu, Feb 21, 2019 at 10:41:21AM -0800, Matthew Wilcox wrote: > > Divide all the indices by 64 to save memory. > > > > Signed-off-by: Matthew Wilcox > > Pretty sure this goes boom. Our char device

Re: [PATCH 00/34] Convert DRM to XArray

2019-02-25 Thread Matthew Wilcox
On Fri, Feb 22, 2019 at 10:54:21AM +0100, Daniel Vetter wrote: > > - idr_alloc() returned -ENOSPC, radix_tree_insert() returned -EEXIST. > >xa_insert() and xa_alloc() return -EBUSY. > > I think this will upset a few of our tests. Just written some more for > drm-lease at least, and those chec

Re: [PATCH 02/34] drm: Convert aux_idr to XArray

2019-02-26 Thread Matthew Wilcox
On Mon, Feb 25, 2019 at 07:57:33PM +0200, Ville Syrjälä wrote: > On Thu, Feb 21, 2019 at 10:41:23AM -0800, Matthew Wilcox wrote: > > @@ -49,8 +49,7 @@ struct drm_dp_aux_dev { > > > > #define DRM_AUX_MINORS 256 > > #define AUX_MAX_OFFSET (1 << 2

Re: [PATCH 13/34] drm/amdgpu: Convert ctx_handles to XArray

2019-02-26 Thread Matthew Wilcox
On Mon, Feb 25, 2019 at 04:59:55PM +, Koenig, Christian wrote: > Am 25.02.19 um 17:39 schrieb Matthew Wilcox: > > On Mon, Feb 25, 2019 at 05:07:24PM +0100, Christian König wrote: > >>> -#define AMDGPU_VM_MAX_NUM_CTX4096 > >>

Re: [PATCH 13/34] drm/amdgpu: Convert ctx_handles to XArray

2019-02-26 Thread Matthew Wilcox
On Mon, Feb 25, 2019 at 05:07:24PM +0100, Christian König wrote: > > -#define AMDGPU_VM_MAX_NUM_CTX 4096 > > +#define AMDGPU_VM_CTX_LIMITXA_LIMIT(0, 4095) > > IIRC we actually use 0 as reserved context value in some places. That's OK; the ALLOC1 preven

Re: [PATCH 12/34] drm/agp: Convert bo_list_handles to XArray

2019-02-26 Thread Matthew Wilcox
On Mon, Feb 25, 2019 at 05:06:18PM +0100, Christian König wrote: > In this one there is a typo in the subject line. Thanks, I'll fix it. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: linux-next: build failure after merge of the drm-misc tree

2019-04-02 Thread Matthew Wilcox
On Tue, Apr 02, 2019 at 09:56:08PM +0800, Qiang Yu wrote: > On Tue, Apr 2, 2019 at 7:26 PM Matthew Wilcox wrote: > > > > On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote: > > > Thanks, patch is: > > > Reviewed-by: Qiang Yu > > > > This look

Re: linux-next: build failure after merge of the drm-misc tree

2019-04-02 Thread Matthew Wilcox
On Tue, Apr 02, 2019 at 10:50:06AM +1100, Stephen Rothwell wrote: > +++ b/drivers/gpu/drm/lima/lima_ctx.c > @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct > lima_ctx_mgr *mgr, u32 *id) > goto err_out0; > } > > - err = xa_alloc(&mgr->handles,

Re: linux-next: build failure after merge of the drm-misc tree

2019-04-02 Thread Matthew Wilcox
On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote: > Thanks, patch is: > Reviewed-by: Qiang Yu This looks like a fairly naive conversion from the old IDR API to the XArray API. You should be able to remove mgr->lock entirely, relying on the xa_lock for synchronising free and get. If you

Re: [PATCH 1/3] drivers/gpu/drm/via: convert put_page() to put_user_page*()

2019-07-22 Thread Matthew Wilcox
On Mon, Jul 22, 2019 at 11:53:54AM -0700, John Hubbard wrote: > On 7/22/19 2:33 AM, Christoph Hellwig wrote: > > On Sun, Jul 21, 2019 at 09:30:10PM -0700, john.hubb...@gmail.com wrote: > >>for (i = 0; i < vsg->num_pages; ++i) { > >>if (NULL != (page = vsg->pages[i]))

Re: Report in unix_stream_read_generic()

2022-02-15 Thread Matthew Wilcox
On Wed, Feb 16, 2022 at 01:17:03PM +0900, Byungchul Park wrote: > [7.013330] === > [7.013331] DEPT: Circular dependency has been detected. > [7.013332] 5.17.0-rc1-00014-gcf3441bb2012 #2 Tainted: GW > [7.01]

Re: Report 1 in ext4 and journal based on v5.17-rc1

2022-02-17 Thread Matthew Wilcox
On Thu, Feb 17, 2022 at 08:10:03PM +0900, Byungchul Park wrote: > [7.009608] === > [7.009613] DEPT: Circular dependency has been detected. > [7.009614] 5.17.0-rc1-00014-g8a599299c0cb-dirty #30 Tainted: GW > [7.009616] -

Re: [PATCH 00/16] DEPT(Dependency Tracker)

2022-02-17 Thread Matthew Wilcox
On Thu, Feb 17, 2022 at 12:00:05PM -0500, Steven Rostedt wrote: > On Thu, 17 Feb 2022 10:51:09 -0500 > "Theodore Ts'o" wrote: > > > I know that you're trying to help us, but this tool needs to be far > > better than Lockdep before we should think about merging it. Even if > > it finds 5% more po

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-25 Thread Matthew Wilcox
On Wed, May 25, 2022 at 03:20:06PM -0700, Andrew Morton wrote: > On Wed, 25 May 2022 23:07:35 +0100 Jessica Clarke wrote: > > > This is i386, so an unsigned long is 32-bit, but i_blocks is a blkcnt_t > > i.e. a u64, which makes the shift without a cast of the LHS fishy. > > Ah, of course, thanks

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Matthew Wilcox
On Thu, May 26, 2022 at 11:48:32AM +0300, Dan Carpenter wrote: > On Thu, May 26, 2022 at 02:16:34AM +0100, Matthew Wilcox wrote: > > Bizarre this started showing up now. The recent patch was: > > > > - info->alloced += compound_nr(page); > > - inod

Re: [PATCH] drm/amdkfd: Add SVM API support capability bits

2022-03-30 Thread Matthew Wilcox
On Wed, Mar 30, 2022 at 04:24:20PM -0500, Alex Sierra wrote: > From: Philip Yang > > SVMAPISupported property added to HSA_CAPABILITY, the value match > HSA_CAPABILITY defined in Thunk spec: > > SVMAPISupported: it will not be supported on older kernels that don't > have HMM or on systems with G

Re: [Bug 215807] Bad page state in process systemd-udevd

2022-04-12 Thread Matthew Wilcox
On Tue, Apr 12, 2022 at 02:08:04PM -0700, Andrew Morton wrote: > hm, that's my third `bad page' report in three emails. But I'm not > seeing a pattern - this one might be a DRM thing. I noticed it was an order-9 page and was set to take responsibility for it, but it's clearly not a filesystem pag

Re: [PATCH v3 0/4] drm: Use full allocated minor range for DRM

2022-09-06 Thread Matthew Wilcox
On Tue, Sep 06, 2022 at 04:01:13PM +0200, Michał Winiarski wrote: > 64 DRM device nodes is not enough for everyone. > Upgrade it to ~512K (which definitely is more than enough). > > To allow testing userspace support for >64 devices, add additional DRM > modparam (skip_legacy_minors) which causes

Re: [PATCH v4 1/3] drm: Use XArray instead of IDR for minors

2022-09-06 Thread Matthew Wilcox
ne in IRQ context. > > Signed-off-by: Michał Winiarski > Suggested-by: Matthew Wilcox I have a few questions, but I like where you're going. > @@ -98,21 +98,18 @@ static struct drm_minor **drm_minor_get_slot(struct > drm_device *dev, > static void drm_minor_alloc_re

Re: [PATCH v8 07/15] mm/gup: migrate device coherent pages when pinning instead of failing

2022-07-11 Thread Matthew Wilcox
On Mon, Jul 11, 2022 at 03:35:42PM +0200, David Hildenbrand wrote: > > + /* > > +* Device coherent pages are managed by a driver and should not > > +* be pinned indefinitely as it prevents the driver moving the > > +* page. So when trying to pin with FO

Re: [PATCH] mm: Fix a null ptr deref with CONFIG_DEBUG_VM enabled in wp_page_reuse

2022-07-27 Thread Matthew Wilcox
On Wed, Jul 27, 2022 at 03:14:07PM -0400, Zack Rusin wrote: > From: Zack Rusin > > Write page faults on last references might not have a valid page anymore. > wp_page_reuse has always dealt with that scenario by making > sure the page isn't null (or the reference was shared) before doing > anythi

  1   2   3   >