Re: Regression on linux-next (next-20240228)

2024-03-05 Thread Matthew Wilcox
On Tue, Mar 05, 2024 at 06:49:16AM +, Borah, Chaitanya Kumar wrote: > Issue is still seen with the following changes > > void put_pages_list(struct list_head *pages) > > folio_batch_init(); > list_for_each_entry(folio, pages, lru) { > - if

Re: Regression on linux-next (next-20240228)

2024-03-04 Thread Matthew Wilcox
On Mon, Mar 04, 2024 at 10:03:13AM +, Borah, Chaitanya Kumar wrote: > > Could you try putting the two: > > > > - list_del(>lru); > > > > statements back in and see if that fixes it? > > That seems to fix it. > > if (!folio_put_testzero(folio)) > +

Re: Regression on linux-next (next-20240228)

2024-03-03 Thread Matthew Wilcox
` > commit ac7130117e8860081be88149061b5abb654d5759 > Author: Matthew Wilcox (Oracle) mailto:wi...@infradead.org > Date:   Tue Feb 27 17:42:41 2024 + > >     mm: use free_unref_folios() in put_pages_list() > >     Break up the list of folios into batches here so that the folios

Re: [PATCH 2/2] xfs: disable large folio support in xfile_create

2024-01-11 Thread Matthew Wilcox
On Thu, Jan 11, 2024 at 02:00:53PM -0800, Andrew Morton wrote: > On Wed, 10 Jan 2024 12:04:51 -0800 "Darrick J. Wong" > wrote: > > > > > Fixing this will require a bit of an API change, and prefeably sorting > > > > out > > > > the hwpoison story for pages vs folio and where it is placed in

Re: disable large folios for shmem file used by xfs xfile

2024-01-10 Thread Matthew Wilcox
On Wed, Jan 10, 2024 at 05:28:22PM +0200, Joonas Lahtinen wrote: > Quoting Joonas Lahtinen (2024-01-10 17:20:24) > > However we specifically pass "huge=within_size" to vfs_kern_mount when > > creating a private mount of tmpfs for the purpose of i915 created > > allocations. > > > > Older hardware

Re: disable large folios for shmem file used by xfs xfile

2024-01-10 Thread Matthew Wilcox
On Wed, Jan 10, 2024 at 10:21:07AM +0100, Christoph Hellwig wrote: > Hi all, > > Darrick reported that the fairly new XFS xfile code blows up when force > enabling large folio for shmem. This series fixes this quickly by disabling > large folios for this particular shmem file for now until it

[Intel-gfx] [PATCH] i915: Limit the length of an sg list to the requested length

2023-09-19 Thread Matthew Wilcox (Oracle)
functions may also have been affected. Clamp the length of the last entry in the sg list to be the expected length. Signed-off-by: Matthew Wilcox (Oracle) Fixes: 0b62af28f249 ("i915: convert shmem_sg_free_table() to use a folio_batch") Cc: sta...@vger.kernel.org # 6.5.x L

Re: [Intel-gfx] [REGRESSION] [BISECTED] Panic in gen8_ggtt_insert_entries() with v6.5

2023-09-19 Thread Matthew Wilcox
On Tue, Sep 19, 2023 at 08:11:47PM +0200, Oleksandr Natalenko wrote: > I can confirm this one fixes the issue for me on T460s laptop. Thank you! Yay! > Should you submit it, please add: > > Fixes: 0b62af28f2 ("i915: convert shmem_sg_free_table() to use a folio_batch") Thanks for collecting all

Re: [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Panic in gen8_ggtt_insert_entries() with v6.5

2023-09-19 Thread Matthew Wilcox
On Tue, Sep 19, 2023 at 04:12:46PM -, Patchwork wrote: > -:7: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line > (possible unwrapped commit description?) > #7: > > Andrzej asked me to try to revert commits 0b62af28f249, e0b72c14d8dc and > > 1e0877d58b1e, and reverting those

Re: [Intel-gfx] [REGRESSION] [BISECTED] Panic in gen8_ggtt_insert_entries() with v6.5

2023-09-19 Thread Matthew Wilcox
On Tue, Sep 19, 2023 at 04:43:41PM +0100, Matthew Wilcox wrote: > Could I ask you to try this patch? I'll follow up with another patch > later because I think I made another assumption that may not be valid. Ah, no, never mind. I thought we could start in the middle of a folio, but we

Re: [Intel-gfx] [REGRESSION] [BISECTED] Panic in gen8_ggtt_insert_entries() with v6.5

2023-09-19 Thread Matthew Wilcox
On Tue, Sep 19, 2023 at 10:26:42AM +0200, Oleksandr Natalenko wrote: > Andrzej asked me to try to revert commits 0b62af28f249, e0b72c14d8dc and > 1e0877d58b1e, and reverting those fixed the i915 crash for me. The > e0b72c14d8dc and 1e0877d58b1e commits look like just prerequisites, so I >

Re: [Intel-gfx] [PATCH v6 1/4] drm: Use XArray instead of IDR for minors

2023-08-29 Thread Matthew Wilcox
On Tue, Aug 29, 2023 at 02:35:34PM -0400, James Zhu wrote: > > On 2023-08-29 14:33, Matthew Wilcox wrote: > > On Tue, Aug 29, 2023 at 01:34:22PM -0400, James Zhu wrote: > > > > > > @@ -1067,7 +1055,7 @@ static void drm_core_exit(void) > > > > > &g

Re: [Intel-gfx] [PATCH v6 1/4] drm: Use XArray instead of IDR for minors

2023-08-29 Thread Matthew Wilcox
On Tue, Aug 29, 2023 at 01:34:22PM -0400, James Zhu wrote: > > > > @@ -1067,7 +1055,7 @@ static void drm_core_exit(void) > > > > unregister_chrdev(DRM_MAJOR, "drm"); > > > > debugfs_remove(drm_debugfs_root); > > > > drm_sysfs_destroy(); > > > > -

Re: [Intel-gfx] [PATCH 03/13] scatterlist: Add sg_set_folio()

2023-07-30 Thread Matthew Wilcox
On Sun, Jul 30, 2023 at 09:57:06PM +0800, Zhu Yanjun wrote: > > 在 2023/7/30 19:18, Matthew Wilcox 写道: > > On Sun, Jul 30, 2023 at 07:01:26PM +0800, Zhu Yanjun wrote: > > > Does the following function have folio version? > > > > > > " >

Re: [Intel-gfx] [PATCH 03/13] scatterlist: Add sg_set_folio()

2023-07-30 Thread Matthew Wilcox
On Sun, Jul 30, 2023 at 07:01:26PM +0800, Zhu Yanjun wrote: > Does the following function have folio version? > > " > int sg_alloc_append_table_from_pages(struct sg_append_table *sgt_append, > struct page **pages, unsigned int n_pages, unsigned int offset, > unsigned

[Intel-gfx] [PATCH 10/13] mm: Remove struct pagevec

2023-06-21 Thread Matthew Wilcox (Oracle)
All users are now converted to use the folio_batch so we can get rid of this data structure. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagevec.h | 63 +++-- mm/swap.c | 18 ++-- 2 files changed, 13 insertions(+), 68

[Intel-gfx] [PATCH 13/13] mm: Remove unnecessary pagevec includes

2023-06-21 Thread Matthew Wilcox (Oracle)
These files no longer need pagevec.h, mostly due to function declarations being moved out of it. Signed-off-by: Matthew Wilcox (Oracle) --- mm/fadvise.c| 1 - mm/memory_hotplug.c | 1 - mm/migrate.c| 1 - mm/readahead.c | 1 - mm/swap_state.c | 1 - 5 files changed, 5

[Intel-gfx] [PATCH 11/13] mm: Rename invalidate_mapping_pagevec to mapping_try_invalidate

2023-06-21 Thread Matthew Wilcox (Oracle)
We don't use pagevecs for the LRU cache any more, and we don't know that the failed invalidations were due to the folio being in an LRU cache. So rename it to be more accurate. Signed-off-by: Matthew Wilcox (Oracle) --- mm/fadvise.c | 16 +++- mm/internal.h | 4 ++-- mm

[Intel-gfx] [PATCH 08/13] i915: Convert i915_gpu_error to use a folio_batch

2023-06-21 Thread Matthew Wilcox (Oracle)
Remove one of the last remaining users of pagevec. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/gpu/drm/i915/i915_gpu_error.c | 50 +-- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 12/13] mm: Remove references to pagevec

2023-06-21 Thread Matthew Wilcox (Oracle)
Most of these should just refer to the LRU cache rather than the data structure used to implement the LRU cache. Signed-off-by: Matthew Wilcox (Oracle) --- mm/huge_memory.c| 2 +- mm/khugepaged.c | 6 +++--- mm/ksm.c| 6 +++--- mm/memory.c | 6 +++--- mm

[Intel-gfx] [PATCH 09/13] net: Convert sunrpc from pagevec to folio_batch

2023-06-21 Thread Matthew Wilcox (Oracle)
Remove the last usage of pagevecs. There is a slight change here; we now free the folio_batch as soon as it fills up instead of freeing the folio_batch when we try to add a page to a full batch. This should have no effect in practice. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux

[Intel-gfx] [PATCH 06/13] mm: Remove check_move_unevictable_pages()

2023-06-21 Thread Matthew Wilcox (Oracle)
All callers have now been converted to call check_move_unevictable_folios(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/swap.h | 1 - mm/vmscan.c | 17 - 2 files changed, 18 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index

[Intel-gfx] [PATCH 04/13] i915: Convert shmem_sg_free_table() to use a folio_batch

2023-06-21 Thread Matthew Wilcox (Oracle)
-by: Matthew Wilcox (Oracle) --- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 55 +-- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c index 33d5d5178103..8f1633c3fb93 100644

[Intel-gfx] [PATCH 02/13] mm: Add __folio_batch_release()

2023-06-21 Thread Matthew Wilcox (Oracle)
This performs the same role as __pagevec_release(), ie skipping the check for batch length of 0. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagevec.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index

[Intel-gfx] [PATCH 00/13] Remove pagevecs

2023-06-21 Thread Matthew Wilcox (Oracle)
We're almost done with the pagevec -> folio_batch conversion. Finish the job. Matthew Wilcox (Oracle) (13): afs: Convert pagevec to folio_batch in afs_extend_writeback() mm: Add __folio_batch_release() scatterlist: Add sg_set_folio() i915: Convert shmem_sg_free_table() to

[Intel-gfx] [PATCH 05/13] drm: Convert drm_gem_put_pages() to use a folio_batch

2023-06-21 Thread Matthew Wilcox (Oracle)
Remove a few hidden compound_head() calls by converting the returned page to a folio once and using the folio APIs. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/gpu/drm/drm_gem.c | 68 ++- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git

[Intel-gfx] [PATCH 01/13] afs: Convert pagevec to folio_batch in afs_extend_writeback()

2023-06-21 Thread Matthew Wilcox (Oracle)
Removes a folio->page->folio conversion for each folio that's involved. More importantly, removes one of the last few uses of a pagevec. Signed-off-by: Matthew Wilcox (Oracle) --- fs/afs/write.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/afs/w

[Intel-gfx] [PATCH 07/13] pagevec: Rename fbatch_count()

2023-06-21 Thread Matthew Wilcox (Oracle)
This should always have been called folio_batch_count(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagevec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index 42aad53e382e..3a9d29dd28a3 100644

[Intel-gfx] [PATCH 03/13] scatterlist: Add sg_set_folio()

2023-06-21 Thread Matthew Wilcox (Oracle)
. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/scatterlist.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index ec46d8e8e49d..77df3d7b18a6 100644 --- a/include/linux/scatterlist.h +++ b/include/linux

Re: [Intel-gfx] [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-02-02 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote: > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > > + /* > > > + * Flags, see mm.h. > > > + * WARNING! Do not modify directly. > > > + * Use {init|reset|set|clear|mod}_vm_flags() functions instead. >

Re: [Intel-gfx] [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-02-02 Thread Matthew Wilcox
On Thu, Jan 26, 2023 at 04:50:59PM +0200, Mike Rapoport wrote: > On Thu, Jan 26, 2023 at 11:17:09AM +0200, Mike Rapoport wrote: > > On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > > > +/* Use when VMA is not part of the VMA tree and needs no locking */ > > > +static inline

Re: [Intel-gfx] [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-02-02 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > +/* Use when VMA is not part of the VMA tree and needs no locking */ > +static inline void init_vm_flags(struct vm_area_struct *vma, > + unsigned long flags) > +{ > + vma->vm_flags = flags;

Re: [Intel-gfx] [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-07 Thread Matthew Wilcox
On Sun, Nov 06, 2022 at 04:51:39PM +0200, Oded Gabbay wrote: > I tried executing the following code in a dummy driver I wrote: You don't need to write a dummy driver; you can write test-cases entirely in userspace. Just add them to lib/test_xarray.c and then make -C tools/testing/radix-tree/ >

Re: [Intel-gfx] [PATCH] drm/i915/userptr: restore probe_range behaviour

2022-10-25 Thread Matthew Wilcox
a_range() iterating over stuff outside the range we care > > about. Fix this by storing the end value separately. > > > > Testcase: igt@gem_userptr_blits@probe > > Fixes: f683b9d61319 ("i915: use the VMA iterator") > > Reported-by: kernel test robot > >

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

2022-09-06 Thread Matthew Wilcox
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_release(stru

Re: [Intel-gfx] i915: crash with 5.19-rc2

2022-08-10 Thread Matthew Wilcox
On Wed, Aug 10, 2022 at 08:55:32AM -0700, Hugh Dickins wrote: > This is not a bug in zram or i915, but what Matthew fixes in > https://lore.kernel.org/lkml/20220730042518.1264767-1-wi...@infradead.org/ Thanks for tracking that down, Hugh. Nice to know it's a crash rather than a data corruption.

Re: [Intel-gfx] [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

Re: [Intel-gfx] [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.

Re: [Intel-gfx] [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: [Intel-gfx] [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

Re: [Intel-gfx] [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: [Intel-gfx] [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 t

Re: [Intel-gfx] [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

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

2022-03-01 Thread Matthew Wilcox
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() Macros should not refer

Re: [Intel-gfx] [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 -Wshado

Re: [Intel-gfx] [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

Re: [Intel-gfx] [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: [Intel-gfx] [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

Re: [Intel-gfx] [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

Re: [Intel-gfx] Missing DPPLL case on i7-1165G7

2021-01-04 Thread Matthew Wilcox
On Tue, Dec 29, 2020 at 04:41:31PM +0200, Imre Deak wrote: > Hi, > > On Mon, Dec 21, 2020 at 04:07:58AM +, Matthew Wilcox wrote: > > > > At boot, > > > > [2.787995] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon > > [2.788001] i915

[Intel-gfx] Missing DPPLL case on i7-1165G7

2020-12-20 Thread Matthew Wilcox
At boot, [2.787995] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon [2.788001] i915 :00:02.0: [drm] *ERROR* LSPCON init failed on port E [2.790752] [ cut here ] [2.790753] Missing case (clock == 539440) [2.790790] WARNING: CPU: 0 PID: 159

Re: [Intel-gfx] [RFC] MAINTAINERS tag for cleanup robot

2020-11-22 Thread Matthew Wilcox
On Sun, Nov 22, 2020 at 06:46:46AM -0800, Tom Rix wrote: > > On 11/21/20 7:23 PM, Matthew Wilcox wrote: > > On Sat, Nov 21, 2020 at 08:50:58AM -0800, t...@redhat.com wrote: > >> The fixer review is > >> https://reviews.llvm.org/D91789 > >> > >> A

Re: [Intel-gfx] [RFC] MAINTAINERS tag for cleanup robot

2020-11-21 Thread Matthew Wilcox
On Sat, Nov 21, 2020 at 08:50:58AM -0800, t...@redhat.com wrote: > The fixer review is > https://reviews.llvm.org/D91789 > > A run over allyesconfig for x86_64 finds 62 issues, 5 are false positives. > The false positives are caused by macros passed to other macros and by > some macro expansions

Re: [Intel-gfx] [PATCH 04/65] mm: Extract might_alloc() debug check

2020-10-23 Thread Matthew Wilcox
On Fri, Oct 23, 2020 at 02:21:15PM +0200, Daniel Vetter wrote: > Note that unlike fs_reclaim_acquire/release gfpflags_allow_blocking > does not consult the PF_MEMALLOC flags. But there is no flag > equivalent for GFP_NOWAIT, hence this check can't go wrong due to > memalloc_no*_save/restore

Re: [Intel-gfx] [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Matthew Wilcox
On Tue, Oct 13, 2020 at 11:44:29AM -0700, Dan Williams wrote: > On Fri, Oct 9, 2020 at 12:52 PM wrote: > > > > From: Ira Weiny > > > > The kmap() calls in this FS are localized to a single thread. To avoid > > the over head of global PKRS updates use the new kmap_thread() call. > > > > Cc:

Re: [Intel-gfx] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Matthew Wilcox
On Mon, Oct 12, 2020 at 12:53:54PM -0700, Ira Weiny wrote: > On Mon, Oct 12, 2020 at 05:44:38PM +0100, Matthew Wilcox wrote: > > On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > > > kmap_atomic() is always preferred over kmap()/kmap_thread(). > > > k

Re: [Intel-gfx] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Matthew Wilcox
On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > kmap_atomic() is always preferred over kmap()/kmap_thread(). > kmap_atomic() is _much_ more lightweight since its TLB invalidation is > always CPU-local and never broadcast. > > So, basically, unless you *must* sleep while the mapping

Re: [Intel-gfx] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-09 Thread Matthew Wilcox
On Fri, Oct 09, 2020 at 02:34:34PM -0700, Eric Biggers wrote: > On Fri, Oct 09, 2020 at 12:49:57PM -0700, ira.we...@intel.com wrote: > > The kmap() calls in this FS are localized to a single thread. To avoid > > the over head of global PKRS updates use the new kmap_thread() call. > > > > @@

Re: [Intel-gfx] [PATCH 3/6] drm/i915: use vmap in shmem_pin_map

2020-09-22 Thread Matthew Wilcox
On Tue, Sep 22, 2020 at 04:39:06PM +0200, Christoph Hellwig wrote: > On Tue, Sep 22, 2020 at 12:21:44PM +0100, Matthew Wilcox wrote: > > Actually, vfree() will work today; I cc'd you on a documentation update > > to make it clear that this is permitted. > > vfree calls _

Re: [Intel-gfx] [PATCH 3/6] drm/i915: use vmap in shmem_pin_map

2020-09-22 Thread Matthew Wilcox
On Tue, Sep 22, 2020 at 08:22:49AM +0200, Christoph Hellwig wrote: > On Mon, Sep 21, 2020 at 08:11:57PM +0100, Matthew Wilcox wrote: > > This is awkward. I'd like it if we had a vfree() variant which called > > put_page() instead of __free_pages(). I'd like it even more

Re: [Intel-gfx] [PATCH 3/6] drm/i915: use vmap in shmem_pin_map

2020-09-21 Thread Matthew Wilcox
On Fri, Sep 18, 2020 at 06:37:21PM +0200, Christoph Hellwig wrote: > void shmem_unpin_map(struct file *file, void *ptr) > { > + long i = shmem_npages(file); > + > mapping_clear_unevictable(file->f_mapping); > - __shmem_unpin_map(file, ptr, shmem_npte(file)); > + vunmap(ptr); >

Re: [Intel-gfx] [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Matthew Wilcox
On Sat, Sep 19, 2020 at 10:18:54AM -0700, Linus Torvalds wrote: > On Sat, Sep 19, 2020 at 2:50 AM Thomas Gleixner wrote: > > > > this provides a preemptible variant of kmap_atomic & related > > interfaces. This is achieved by: > > Ack. This looks really nice, even apart from the new capability.

Re: [Intel-gfx] [patch 00/13] preempt: Make preempt count unconditional

2020-09-16 Thread Matthew Wilcox
On Mon, Sep 14, 2020 at 11:55:24PM +0200, Thomas Gleixner wrote: > But just look at any check which uses preemptible(), especially those > which check !preemptible(): hmm. +++ b/include/linux/preempt.h @@ -180,7 +180,9 @@ do { \ #define preempt_enable_no_resched()

Re: [Intel-gfx] [PATCH v2 0/8] Return head pages from find_*_entry

2020-09-15 Thread Matthew Wilcox
On Tue, Sep 15, 2020 at 06:23:27PM +0530, Naresh Kamboju wrote: > While running kselftest mincore tests the following kernel BUG reported on the > linux next-20200915 tag on x86_64, i386 and arm64. https://lore.kernel.org/linux-mm/20200914112738.gm6...@casper.infradead.org/

Re: [Intel-gfx] [PATCH v2 3/8] mm: Optimise madvise WILLNEED

2020-09-14 Thread Matthew Wilcox
On Mon, Sep 14, 2020 at 12:17:07PM -0400, Qian Cai wrote: > Reverting the "Return head pages from find_*_entry" patchset [1] up to this > patch fixed the issue that LTP madvise06 test [2] would trigger endless soft- > lockups below. It does not help after applied patches fixed other separate >

Re: [Intel-gfx] [mm] 2037ab69a5: BUG:KASAN:null-ptr-deref_in_t

2020-09-14 Thread Matthew Wilcox
On Mon, Sep 14, 2020 at 04:55:45PM +0800, kernel test robot wrote: > Greeting, > > FYI, we noticed the following commit (built with gcc-9): > > commit: 2037ab69a5cd8afe58347135010f6160ea368dd0 ("mm: Convert find_get_entry > to return the head page") Thank you! diff --git a/mm/swap_state.c

Re: [Intel-gfx] [PATCH v2 7/8] mm/shmem: Return head page from find_lock_entry

2020-09-11 Thread Matthew Wilcox
On Thu, Sep 10, 2020 at 07:33:17PM +0100, Matthew Wilcox (Oracle) wrote: > Convert shmem_getpage_gfp() (the only remaining caller of > find_lock_entry()) to cope with a head page being returned instead of > the subpage for the index. This version was buggy. Apparently I was to

[Intel-gfx] [PATCH v2 2/8] mm: Use find_get_incore_page in memcontrol

2020-09-10 Thread Matthew Wilcox (Oracle)
The current code does not protect against swapoff of the underlying swap device, so this is a bug fix as well as a worthwhile reduction in code complexity. Signed-off-by: Matthew Wilcox (Oracle) --- mm/memcontrol.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions

[Intel-gfx] [PATCH v2 3/8] mm: Optimise madvise WILLNEED

2020-09-10 Thread Matthew Wilcox (Oracle)
Instead of calling find_get_entry() for every page index, use an XArray iterator to skip over NULL entries, and avoid calling get_page(), because we only want the swap entries. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Johannes Weiner --- mm/madvise.c | 21 - 1 file

[Intel-gfx] [PATCH v2 6/8] mm: Convert find_get_entry to return the head page

2020-09-10 Thread Matthew Wilcox (Oracle)
There are only four callers remaining of find_get_entry(). get_shadow_from_swap_cache() only wants to see shadow entries and doesn't care about which page is returned. Push the find_subpage() call into find_lock_entry(), find_get_incore_page() and pagecache_get_page(). Signed-off-by: Matthew

[Intel-gfx] [PATCH v2 4/8] proc: Optimise smaps for shmem entries

2020-09-10 Thread Matthew Wilcox (Oracle)
Avoid bumping the refcount on pages when we're only interested in the swap entries. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Johannes Weiner --- fs/proc/task_mmu.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index

[Intel-gfx] [PATCH v2 7/8] mm/shmem: Return head page from find_lock_entry

2020-09-10 Thread Matthew Wilcox (Oracle)
Convert shmem_getpage_gfp() (the only remaining caller of find_lock_entry()) to cope with a head page being returned instead of the subpage for the index. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 9 + mm/filemap.c| 25

[Intel-gfx] [PATCH v2 5/8] i915: Use find_lock_page instead of find_lock_entry

2020-09-10 Thread Matthew Wilcox (Oracle)
i915 does not want to see value entries. Switch it to use find_lock_page() instead, and remove the export of find_lock_entry(). Move find_lock_entry() and find_get_entry() to mm/internal.h to discourage any future use. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Johannes Weiner

[Intel-gfx] [PATCH v2 1/8] mm: Factor find_get_incore_page out of mincore_page

2020-09-10 Thread Matthew Wilcox (Oracle)
Provide this functionality from the swap cache. It's useful for more than just mincore(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/swap.h | 7 +++ mm/mincore.c | 28 ++-- mm/swap_state.c | 32 3 files

[Intel-gfx] [PATCH v2 0/8] Return head pages from find_*_entry

2020-09-10 Thread Matthew Wilcox (Oracle)
thp_valid_index() to thp_contains() - Fix thp_contains() for hugetlbfs and swapcache - Add find_lock_head() wrapper around pagecache_get_page() Matthew Wilcox (Oracle) (8): mm: Factor find_get_incore_page out of mincore_page mm: Use find_get_incore_page in memcontrol mm: Optimise madvise

[Intel-gfx] [PATCH v2 8/8] mm: Add find_lock_head

2020-09-10 Thread Matthew Wilcox (Oracle)
Add a new FGP_HEAD flag which avoids calling find_subpage() and add a convenience wrapper for it. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 32 ++-- mm/filemap.c| 9 ++--- 2 files changed, 32 insertions(+), 9 deletions

Re: [Intel-gfx] [PATCH 2/8] mm: Use find_get_swap_page in memcontrol

2020-08-27 Thread Matthew Wilcox
On Wed, Aug 26, 2020 at 10:20:02AM -0400, Johannes Weiner wrote: > The refactor makes sense to me, but the name is confusing. We're not > looking for a swap page, we're primarily looking for a file page in > the page cache mapping that's handed in. Only in the special case > where it's a shmem

Re: [Intel-gfx] [PATCH 6/8] mm: Convert find_get_entry to return the head page

2020-08-26 Thread Matthew Wilcox
On Wed, Aug 26, 2020 at 11:09:25AM -0400, Johannes Weiner wrote: > On Wed, Aug 19, 2020 at 07:48:48PM +0100, Matthew Wilcox (Oracle) wrote: > > There are only three callers remaining of find_get_entry(). > > find_get_swap_page() is happy to get the head page instead of the s

Re: [Intel-gfx] [PATCH 2/8] mm: Use find_get_swap_page in memcontrol

2020-08-26 Thread Matthew Wilcox
On Wed, Aug 26, 2020 at 10:20:02AM -0400, Johannes Weiner wrote: > On Wed, Aug 19, 2020 at 07:48:44PM +0100, Matthew Wilcox (Oracle) wrote: > > + return find_get_swap_page(vma->vm_file->f_mapping, > > + linear_page_index(vma, addr)); > > The

Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for Return head pages from find_get_entry and find_lock_entry (rev2)

2020-08-19 Thread Matthew Wilcox
On Wed, Aug 19, 2020 at 07:29:24PM -, Patchwork wrote: > == Series Details == > > Series: Return head pages from find_get_entry and find_lock_entry (rev2) > URL : https://patchwork.freedesktop.org/series/80818/ > State : failure > > == Summary == > > CALLscripts/checksyscalls.sh >

Re: [Intel-gfx] [PATCH 1/8] mm: Factor find_get_swap_page out of mincore_page

2020-08-19 Thread Matthew Wilcox
On Wed, Aug 19, 2020 at 07:48:43PM +0100, Matthew Wilcox (Oracle) wrote: > Provide this functionality from the swap cache. It's useful for > more than just mincore(). The build bot showed I was missing this for some configs: diff --git a/mm/swap_state.c b/mm/swap_state.c index 986b4e

Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for Return head pages from find_get_entry and find_lock_entry

2020-08-19 Thread Matthew Wilcox
On Wed, Aug 19, 2020 at 07:06:17PM -, Patchwork wrote: > CC mm/swap_state.o > mm/swap_state.c: In function ‘find_get_swap_page’: > mm/swap_state.c:435:7: error: implicit declaration of function > ‘shmem_mapping’; did you mean ‘page_mapping’? > [-Werror=implicit-function-declaration] >

Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for Return head pages from find_get_entry and find_lock_entry

2020-08-19 Thread Matthew Wilcox
On Wed, Aug 19, 2020 at 07:06:17PM -, Patchwork wrote: > == Series Details == > > Series: Return head pages from find_get_entry and find_lock_entry > URL : https://patchwork.freedesktop.org/series/80818/ > State : failure > > == Summary == > > CALLscripts/checksyscalls.sh > CALL

[Intel-gfx] [PATCH 8/8] mm: Hoist find_subpage call further up in pagecache_get_page

2020-08-19 Thread Matthew Wilcox (Oracle)
This avoids a call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 6594baae7cd2..8c354277108d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1667,7 +1667,6

[Intel-gfx] [PATCH 2/8] mm: Use find_get_swap_page in memcontrol

2020-08-19 Thread Matthew Wilcox (Oracle)
The current code does not protect against swapoff of the underlying swap device, so this is a bug fix as well as a worthwhile reduction in code complexity. Signed-off-by: Matthew Wilcox (Oracle) --- mm/memcontrol.c | 25 ++--- 1 file changed, 2 insertions(+), 23 deletions

[Intel-gfx] [PATCH 4/8] proc: Optimise smaps for shmem entries

2020-08-19 Thread Matthew Wilcox (Oracle)
Avoid bumping the refcount on pages when we're only interested in the swap entries. Signed-off-by: Matthew Wilcox (Oracle) --- fs/proc/task_mmu.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 5066b0251ed8..e42d9e5e9a3c

[Intel-gfx] [PATCH 5/8] i915: Use find_lock_page instead of find_lock_entry

2020-08-19 Thread Matthew Wilcox (Oracle)
i915 does not want to see value entries. Switch it to use find_lock_page() instead, and remove the export of find_lock_entry(). Signed-off-by: Matthew Wilcox (Oracle) --- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 4 ++-- mm/filemap.c | 1 - 2 files changed, 2

[Intel-gfx] [PATCH 0/8] Return head pages from find_get_entry and find_lock_entry

2020-08-19 Thread Matthew Wilcox (Oracle)
callers do is find the head page, which we just threw away. As part of auditing all the callers, I found some misuses of the APIs and some plain inefficiencies that I've fixed. The diffstat is unflattering, but I added more kernel-doc. Matthew Wilcox (Oracle) (8): mm: Factor find_get_swap_page out

[Intel-gfx] [PATCH 6/8] mm: Convert find_get_entry to return the head page

2020-08-19 Thread Matthew Wilcox (Oracle)
There are only three callers remaining of find_get_entry(). find_get_swap_page() is happy to get the head page instead of the subpage. Add find_subpage() calls to find_lock_entry() and pagecache_get_page() to avoid auditing all their callers. Signed-off-by: Matthew Wilcox (Oracle) --- include

[Intel-gfx] [PATCH 7/8] mm: Return head page from find_lock_entry

2020-08-19 Thread Matthew Wilcox (Oracle)
Convert the one caller of find_lock_entry() to cope with a head page being returned instead of the subpage for the index. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 12 mm/filemap.c| 25 +++-- mm/shmem.c | 15

[Intel-gfx] [PATCH 3/8] mm: Optimise madvise WILLNEED

2020-08-19 Thread Matthew Wilcox (Oracle)
Instead of calling find_get_entry() for every page index, use an XArray iterator to skip over NULL entries, and avoid calling get_page(), because we only want the swap entries. Signed-off-by: Matthew Wilcox (Oracle) --- mm/madvise.c | 21 - 1 file changed, 12 insertions

[Intel-gfx] [PATCH 1/8] mm: Factor find_get_swap_page out of mincore_page

2020-08-19 Thread Matthew Wilcox (Oracle)
Provide this functionality from the swap cache. It's useful for more than just mincore(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/swap.h | 7 +++ mm/mincore.c | 28 ++-- mm/swap_state.c | 31 +++ 3 files

Re: [Intel-gfx] [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Matthew Wilcox
On Thu, Jun 25, 2020 at 03:40:44PM +0200, Jan Kara wrote: > On Thu 25-06-20 12:42:09, Matthew Wilcox wrote: > > Why are DMA pinned pages still on the LRU list at all? I never got an > > answer to this that made sense to me. By definition, a page which is > > pinned for

Re: [Intel-gfx] [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-25 Thread Matthew Wilcox
On Wed, Jun 24, 2020 at 08:14:17PM +0100, Chris Wilson wrote: > A side effect of the LRU shrinker not being dma aware is that we will > often attempt to perform direct reclaim on the persistent group of dma > pages while continuing to use the dma HW (an issue as the HW may already > be actively

Re: [Intel-gfx] improve use_mm / unuse_mm v2

2020-04-16 Thread Matthew Wilcox
On Thu, Apr 16, 2020 at 07:31:55AM +0200, Christoph Hellwig wrote: > this series improves the use_mm / unuse_mm interface by better > documenting the assumptions, and my taking the set_fs manipulations > spread over the callers into the core API. I appreciate all the work you're doing here. Do

Re: [Intel-gfx] [PATCH] kernel-doc: rename the kernel-doc directive 'functions' to 'specific'

2019-10-15 Thread Matthew Wilcox
On Wed, Oct 16, 2019 at 08:03:24AM +0800, Changbin Du wrote: > On Tue, Oct 15, 2019 at 04:54:39AM -0700, Matthew Wilcox wrote: > > On Tue, Oct 15, 2019 at 11:25:53AM +0200, Thomas Zimmermann wrote: > > > > My preference would be to use 'symbols'. I tried to come up wi

Re: [Intel-gfx] [PATCH] kernel-doc: rename the kernel-doc directive 'functions' to 'specific'

2019-10-15 Thread Matthew Wilcox
On Tue, Oct 15, 2019 at 11:25:53AM +0200, Thomas Zimmermann wrote: > > My preference would be to use 'symbols'. I tried to come up with something > > but 'symbols' is better than anything I came up with. > > Maybe 'interfaces' or 'artifacts'. The term 'symbols' is just as > imprecise as

Re: [Intel-gfx] [PATCH] kernel-doc: rename the kernel-doc directive 'functions' to 'specific'

2019-10-14 Thread Matthew Wilcox
On Mon, Oct 14, 2019 at 08:48:48PM +, tim.b...@sony.com wrote: > > > > -Original Message- > > From: Jani Nikula on October 13, 2019 11:00 PM > > On Sun, 13 Oct 2019, Changbin Du wrote: > > > The 'functions' directive is not only for functions, but also works for > > >

Re: [Intel-gfx] [PATCH 00/34] put_user_pages(): miscellaneous call sites

2019-08-02 Thread Matthew Wilcox
On Fri, Aug 02, 2019 at 02:41:46PM +0200, Jan Kara wrote: > On Fri 02-08-19 11:12:44, Michal Hocko wrote: > > On Thu 01-08-19 19:19:31, john.hubb...@gmail.com wrote: > > [...] > > > 2) Convert all of the call sites for get_user_pages*(), to > > > invoke put_user_page*(), instead of put_page().

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

2019-05-03 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 implementat

  1   2   3   >