Re: [PATCH v12 00/31] Speculative page faults

2019-04-23 Thread Matthew Wilcox
On Tue, Apr 23, 2019 at 12:47:07PM +0200, Michal Hocko wrote: > On Mon 22-04-19 14:29:16, Michel Lespinasse wrote: > [...] > > I want to add a note about mmap_sem. In the past there has been > > discussions about replacing it with an interval lock, but these never > > went anywhere because, mostly,

Re: [PATCH v12 07/31] mm: make pte_unmap_same compatible with SPF

2019-04-23 Thread Matthew Wilcox
On Tue, Apr 16, 2019 at 03:44:58PM +0200, Laurent Dufour wrote: > +static inline vm_fault_t pte_unmap_same(struct vm_fault *vmf) > { > - int same = 1; > + int ret = 0; Surely 'ret' should be of type vm_fault_t? > + ret = VM_FAULT_RETRY; ... this should have thrown a

Re: [PATCH v4 10/25] nvdimm: Add driver for OpenCAPI Persistent Memory

2020-03-28 Thread Matthew Wilcox
On Fri, Mar 27, 2020 at 06:11:47PM +1100, Alastair D'Silva wrote: > +static struct mutex minors_idr_lock; > +static struct idr minors_idr; ... > + mutex_lock(&minors_idr_lock); > + minor = idr_alloc(&minors_idr, ocxlpmem, 0, NUM_MINORS, GFP_KERNEL); > + mutex_unlock(&minors_idr_lock); .

Re: [PATCH v4 10/25] nvdimm: Add driver for OpenCAPI Persistent Memory

2020-03-28 Thread Matthew Wilcox
On Sat, Mar 28, 2020 at 07:56:17PM -0700, Matthew Wilcox wrote: > On Fri, Mar 27, 2020 at 06:11:47PM +1100, Alastair D'Silva wrote: > > +static struct mutex minors_idr_lock; > > +static struct idr minors_idr; > ... > > + mutex_lock(&minors_idr_lock); >

Re: [PATCH 6/6] exec: open code copy_string_kernel

2020-04-06 Thread Matthew Wilcox
On Mon, Apr 06, 2020 at 02:03:12PM +0200, Christoph Hellwig wrote: > + int len = strnlen(arg, MAX_ARG_STRLEN) + 1 /* terminating null */; If you end up doing another version of this, it's a terminating NUL, not null. I almost wonder if we shouldn't have #define TERMINATING_NUL 1 in

Re: [PATCH v2 00/27] Add support for OpenCAPI SCM devices

2019-12-02 Thread Matthew Wilcox
On Tue, Dec 03, 2019 at 02:46:28PM +1100, Alastair D'Silva wrote: > This series adds support for OpenCAPI SCM devices, exposing Could we _not_ introduce yet another term for persistent memory?

Re: [PATCH v2 00/27] Add support for OpenCAPI SCM devices

2019-12-03 Thread Matthew Wilcox
On Tue, Dec 03, 2019 at 03:01:17PM +1100, Alastair D'Silva wrote: > On Mon, 2019-12-02 at 19:50 -0800, Matthew Wilcox wrote: > > On Tue, Dec 03, 2019 at 02:46:28PM +1100, Alastair D'Silva wrote: > > > This series adds support for OpenCAPI SCM devices, exposing > >

Re: [PATCH] powerpc: add support for folded p4d page tables

2019-12-09 Thread Matthew Wilcox
On Mon, Dec 09, 2019 at 06:46:36PM +0100, Christophe Leroy wrote: > > > Le 09/12/2019 à 16:09, Mike Rapoport a écrit : > > From: Mike Rapoport > > > > Implement primitives necessary for the 4th level folding, add walks of p4d > > level where appropriate and replace 5level-fixup.h with pgtable-n

Re: [PATCH 10/28] mm: only allow page table mappings for built-in zsmalloc

2020-04-08 Thread Matthew Wilcox
On Wed, Apr 08, 2020 at 05:12:03PM +0200, Peter Zijlstra wrote: > On Wed, Apr 08, 2020 at 08:01:00AM -0700, Randy Dunlap wrote: > > Hi, > > > > On 4/8/20 4:59 AM, Christoph Hellwig wrote: > > > diff --git a/mm/Kconfig b/mm/Kconfig > > > index 36949a9425b8..614cc786b519 100644 > > > --- a/mm/Kconfi

Re: [PATCH v2 1/4] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2020-04-13 Thread Matthew Wilcox
On Mon, Apr 13, 2020 at 10:53:00PM +1000, Nicholas Piggin wrote: > vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. > Whether or not a vmap is huge depends on the architecture details, > alignments, boot options, etc., which the caller can not be expected > to know. Therefore H

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-13 Thread Matthew Wilcox
On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: > +static int vmap_pages_range_noflush(unsigned long start, unsigned long end, > + pgprot_t prot, struct page **pages, > + unsigned int page_shift) > +{ > + if (page_

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-04-14 Thread Matthew Wilcox
On Tue, Apr 14, 2020 at 02:28:35PM +0200, Christophe Leroy wrote: > Le 13/04/2020 à 15:41, Matthew Wilcox a écrit : > > On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: > > > +static int vmap_pages_range_noflush(unsigned long start, unsign

Re: [PATCH 03/12] mm: reorder includes after introduction of linux/pgtable.h

2020-05-12 Thread Matthew Wilcox
On Tue, May 12, 2020 at 09:44:13PM +0300, Mike Rapoport wrote: > diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h > index a093cd45ec79..701a05090141 100644 > --- a/arch/alpha/kernel/proto.h > +++ b/arch/alpha/kernel/proto.h > @@ -2,8 +2,6 @@ > #include > #include > > -#inclu

Re: [PATCH 08/12] mm: pgtable: add shortcuts for accessing kernel PMD and PTE

2020-05-12 Thread Matthew Wilcox
On Tue, May 12, 2020 at 09:44:18PM +0300, Mike Rapoport wrote: > +++ b/include/linux/pgtable.h > @@ -28,6 +28,24 @@ > #define USER_PGTABLES_CEILING0UL > #endif > > +/* FIXME: */ Fix you what? Add documentation? > +static inline pmd_t *pmd_off(struct mm_struct *mm, unsigned long va) >

Re: [PATCH v7 1/4] gpiolib: Pass bitmaps, not integer arrays, to get/set array

2018-09-02 Thread Matthew Wilcox
> +++ b/drivers/auxdisplay/hd44780.c > @@ -62,17 +62,12 @@ static void hd44780_strobe_gpio(struct hd44780 *hd) > /* write to an LCD panel register in 8 bit GPIO mode */ > static void hd44780_write_gpio8(struct hd44780 *hd, u8 val, unsigned int rs) > { > - int values[10]; /* for DATA[0-7], RS

Re: [PATCH] Documentation: fix spelling mistake, EACCESS -> EACCES

2018-10-26 Thread Matthew Wilcox
On Fri, Oct 26, 2018 at 08:20:12PM +0200, Miguel Ojeda wrote: > On Fri, Oct 26, 2018 at 7:27 PM Colin King wrote: > > > > From: Colin Ian King > > > > Trivial fix to a spelling mistake of the error access name EACCESS, > > rename to EACCES > > ? It is not a typo, it is the name of the error (POS

Re: [LKP] dad4f140ed [ 7.709376] WARNING:suspicious_RCU_usage

2018-11-18 Thread Matthew Wilcox
On Mon, Nov 19, 2018 at 09:08:20AM +0800, kernel test robot wrote: > Greetings, > > 0day kernel testing robot got the below dmesg and the first bad commit is Umm. I don't see a 'suspicious RCU usage' message in here. I see a lot of vmalloc warnings ... ? > [7.699777] swapper: vmalloc: allo

Re: [LKP] dad4f140ed [ 7.709376] WARNING:suspicious_RCU_usage

2018-11-19 Thread Matthew Wilcox
On Sun, Nov 18, 2018 at 05:19:04PM -0800, Matthew Wilcox wrote: > On Mon, Nov 19, 2018 at 09:08:20AM +0800, kernel test robot wrote: > > Greetings, > > > > 0day kernel testing robot got the below dmesg and the first bad commit is > > Umm. I don't see a 'susp

Re: dad4f140ed ("Merge branch 'xarray' of .."): Mem-Info:

2018-11-23 Thread Matthew Wilcox
On Sat, Nov 24, 2018 at 09:20:38AM +0800, kernel test robot wrote: > Greetings, > > 0day kernel testing robot got the below dmesg and the first bad commit is > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > commit dad4f140edaa3f6bb452b6913d41af1ffd672e45 I think

Re: [PATCH RFC 7/7] mm: better document PG_reserved

2018-12-05 Thread Matthew Wilcox
On Wed, Dec 05, 2018 at 01:28:51PM +0100, David Hildenbrand wrote: > I don't see a reason why we have to document "Some of them might not even > exist". If there is a user, we should document it. E.g. for balloon > drivers we now use PG_offline to indicate that a page might currently > not be backe

Re: [PATCH RFC 7/7] mm: better document PG_reserved

2018-12-05 Thread Matthew Wilcox
On Wed, Dec 05, 2018 at 04:05:12PM +0100, David Hildenbrand wrote: > On 05.12.18 15:35, Matthew Wilcox wrote: > > On Wed, Dec 05, 2018 at 01:28:51PM +0100, David Hildenbrand wrote: > >> I don't see a reason why we have to document "Some of them might not even > &g

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-11 Thread Matthew Wilcox
On Thu, Jul 11, 2019 at 11:25:44PM +, Hoan Tran OS wrote: > In NUMA layout which nodes have memory ranges that span across other nodes, > the mm driver can detect the memory node id incorrectly. > > For example, with layout below > Node 0 address: > Node 1 address: 111

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Matthew Wilcox
On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: > Should alloc_gigantic_page() be made available as an interface for general > use in the kernel. The test module here uses very similar implementation from > HugeTLB to allocate a PUD aligned memory block. Similar for mm_alloc() wh

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Matthew Wilcox
On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: > On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: > >> Should alloc_gigantic_page() be made available as an interface for general > >>

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Matthew Wilcox
On Sat, Jan 12, 2019 at 03:56:38PM +0530, Anshuman Khandual wrote: > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > __GFP_ZERO) and using it for allocating page table pages. Except that's not true. > +++ b/arch/x86/mm/pgtable.c > @@ -13,19 +13,17 @@ phys_addr_t phys

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-12 Thread Matthew Wilcox
On Sat, Jan 12, 2019 at 02:49:29PM +0100, Christophe Leroy wrote: > As far as I can see, > > #define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT) > > So what's the difference between: > > (GFP_KERNEL_ACCOUNT | __GFP_ZERO) & ~__GFP_ACCOUNT > > and > > (GFP_KERNEL | __GFP_ZERO) & ~__GFP_ACCOU

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Matthew Wilcox
On Wed, Jan 16, 2019 at 07:57:03AM +0100, Michal Hocko wrote: > On Wed 16-01-19 11:51:32, Anshuman Khandual wrote: > > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > > __GFP_ZERO) and using it for allocating page table pages. This causes some > > code duplication whic

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Matthew Wilcox
On Wed, Jan 16, 2019 at 06:42:22PM +0530, Anshuman Khandual wrote: > On 01/16/2019 06:00 PM, Matthew Wilcox wrote: > > On Wed, Jan 16, 2019 at 07:57:03AM +0100, Michal Hocko wrote: > >> On Wed 16-01-19 11:51:32, Anshuman Khandual wrote: > >>> All architecture

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Matthew Wilcox
On Wed, Jan 16, 2019 at 02:47:16PM +0100, Christophe Leroy wrote: > Le 16/01/2019 à 14:18, Matthew Wilcox a écrit : > > I disagree with your objective. Making more code common is a great idea, > > but this patch is too unambitious. We should be heading towards one or >

Re: [PATCH v3 1/2] mm: add probe_user_read()

2019-02-07 Thread Matthew Wilcox
On Wed, Jan 16, 2019 at 04:59:27PM +, Christophe Leroy wrote: > v3: Moved 'Returns:" comment after description. > Explained in the commit log why the function is defined static inline > > v2: Added "Returns:" comment and removed probe_user_address() The correct spelling is 'Return:', n

[PATCH 13/26] ppc: Convert mmu context allocation to new IDA API

2018-06-21 Thread Matthew Wilcox
ida_alloc_range is the perfect fit for this use case. Eliminates a custom spinlock, a call to ida_pre_get and a local check for the allocated ID exceeding a maximum. Signed-off-by: Matthew Wilcox --- arch/powerpc/mm/mmu_context_book3s64.c | 44 +++--- 1 file changed, 4

[PATCH 15/26] ppc: Convert vas ID allocation to new IDA API

2018-06-21 Thread Matthew Wilcox
Removes a custom spinlock and simplifies the code. Signed-off-by: Matthew Wilcox --- arch/powerpc/platforms/powernv/vas-window.c | 26 - 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms

Re: [PATCH 13/26] ppc: Convert mmu context allocation to new IDA API

2018-06-21 Thread Matthew Wilcox
On Fri, Jun 22, 2018 at 12:15:11PM +1000, Nicholas Piggin wrote: > On Thu, 21 Jun 2018 14:28:22 -0700 > Matthew Wilcox wrote: > > static int alloc_context_id(int min_id, int max_id) ... > > - spin_lock(&mmu_context_lock); > > - err = ida_get_new_above(&

Re: [PATCH 15/26] ppc: Convert vas ID allocation to new IDA API

2018-07-05 Thread Matthew Wilcox
On Thu, Jun 21, 2018 at 02:28:24PM -0700, Matthew Wilcox wrote: > Removes a custom spinlock and simplifies the code. I took a closer look at this patch as part of fixing the typo *ahem*. The original code is buggy at the limit: - if (winid > VAS_WINDOWS_PER_CHIP) { -

Re: [PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Matthew Wilcox
On Fri, Jul 27, 2018 at 09:48:17PM +1000, Nicholas Piggin wrote: > The page table fragment allocator uses the main page refcount racily > with respect to speculative references. A customer observed a BUG due > to page table page refcount underflow in the fragment allocator. This > can be caused by

Re: [PATCH resend] powerpc/64s: fix page table fragment refcount race vs speculative references

2018-07-27 Thread Matthew Wilcox
On Sat, Jul 28, 2018 at 12:29:06AM +1000, Nicholas Piggin wrote: > On Fri, 27 Jul 2018 06:41:56 -0700 > Matthew Wilcox wrote: > > > On Fri, Jul 27, 2018 at 09:48:17PM +1000, Nicholas Piggin wrote: > > > The page table fragment allocator uses the main page refcount raci

Re: [PATCH v3 00/27] Add support for OpenCAPI Persistent Memory devices

2020-02-23 Thread Matthew Wilcox
On Mon, Feb 24, 2020 at 03:34:07PM +1100, Alastair D'Silva wrote: > V3: > - Rebase against next/next-20200220 > - Move driver to arch/powerpc/platforms/powernv, we now expect this > driver to go upstream via the powerpc tree That's rather the opposite direction of normal; mostly drivers li

Re: Support for multiple MSI interrupts on MPC8377

2011-11-04 Thread Matthew Wilcox
> powerpc. I think there's an ARM or MIPS architecture that implements support for it ... the x86 support was never merged. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operatin

Re: [PATCH 00/14] DMA-mapping framework redesign preparation

2011-12-23 Thread Matthew Wilcox
es. I really think this wants to be a separate function. dma_alloc_coherent is for allocating memory to be shared between the kernel and a driver; we already have dma_map_sg for mapping userspace I/O as an alternative interface. This feels like it's something different again rat

Re: [RFC PATCH] PCI-E broken on PPC (regression)

2010-01-28 Thread Matthew Wilcox
hitectures. Yes, having it under drivers/pci/ somewhere would be a big improvement, that way we'd actually see it when trying to do cleanups and wouldn't accidentally break your architectures. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, loo

Re: [PATCH 1/3] mpt2sas: remove the use of writeq, since writeq is not atomic

2011-05-17 Thread Matthew Wilcox
you have suggested > will not solve this issue. > If we are sure that writeq() is atomic across all architecture, we can use it > safely. As we have seen issue on ppc64, we are not confident to use > "writeq" call. So have you told the powerpc people that they have a broken

Re: Next May 11 : BUG during scsi initialization

2009-05-11 Thread Matthew Wilcox
000c7d03e30] [c0008534] syscall_exit+0x0/0x40 > Instruction dump: > 7f84e378 e87e8020 38c604d0 e8e902ea 4827fced 6000 2fbf 80bd0004 > 409e0010 e8de8028 38e0 480c 38df04d0 7fa4eb78 811d0008 > ---[ end trace f725820a6fa9dbb7 ]--- > /init: line 21:63 Seg

Re: Next May 11 : BUG during scsi initialization

2009-05-11 Thread Matthew Wilcox
On Mon, May 11, 2009 at 05:34:07PM +0530, Sachin Sant wrote: > Matthew Wilcox wrote: >> On Mon, May 11, 2009 at 05:16:10PM +0530, Sachin Sant wrote: >> >>> Today's Next tree failed to boot on a Power6 box with following BUG : >> >> This doesn't actu

Re: Next May 11 : BUG during scsi initialization

2009-05-11 Thread Matthew Wilcox
On Mon, May 11, 2009 at 09:49:55PM +0530, Sachin Sant wrote: > Yeah so the problem seems to be with SLQB. I was able to boot Next 11 with > SLUB on the same machine. Is it 100% reproducable with SLQB? Our errors were fairly hard to tickle on demand. -- Matthew

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-26 Thread Matthew Wilcox
On Mon, Aug 26, 2019 at 08:07:13AM +0530, Anshuman Khandual wrote: > On 08/09/2019 07:22 PM, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: > >> On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > >>> On Fri, Aug 09, 2019

Re: [Bisected] PowerMac G5 fails booting kernel 6.6-rc3 (BUG: Unable to handle kernel data access at 0xfeffbb62ffec65fe)

2023-10-05 Thread Matthew Wilcox
On Fri, Oct 06, 2023 at 08:11:12AM +0700, Bagas Sanjaya wrote: > Matthew Wilcox, did you miss this regression report? You should look into it > since it is (apparently) cause by a commit of yours. No, I didn't miss it. I'm simply choosing to work on other things. All this reg

Re: [PATCH v2] powerpc/mm: Avoid calling arch_enter/leave_lazy_mmu() in set_ptes

2023-10-27 Thread Matthew Wilcox
On Tue, Oct 24, 2023 at 08:06:04PM +0530, Aneesh Kumar K.V wrote: > ptep++; > - pte = __pte(pte_val(pte) + (1UL << PTE_RPN_SHIFT)); > addr += PAGE_SIZE; > + /* > + * increment the pfn. > + */ > + pte = pfn_pte

Re: [PATCH v6 00/33] Split ptdesc from struct page

2023-06-28 Thread Matthew Wilcox
On Wed, Jun 28, 2023 at 09:41:18AM +0200, David Hildenbrand wrote: > I'm not a friend of these "overlays"; it all only really makes sense to me > once we actually allocate the descriptors dynamically. Maybe some of the > existing/ongoing conversions were different (that's why I was asking for the >

Re: [PATCH 1/2] mm: remove arguments of show_mem()

2023-06-29 Thread Matthew Wilcox
On Thu, Jun 29, 2023 at 06:43:56PM +0800, Kefeng Wang wrote: > Directly call __show_mem(0, NULL, MAX_NR_ZONES - 1) in show_mem() > to remove the arguments of show_mem(). Do you mean, "All callers of show_mem() pass 0 and NULL, so we can remove the two arguments"?

Re: [PATCH v4 20/36] powerpc: Implement the new page table range API

2023-07-10 Thread Matthew Wilcox
On Sat, Mar 18, 2023 at 09:19:04AM +, Christophe Leroy wrote: > void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, > pte_t pte, unsigned int nr) > { > pgprot_t prot; > unsigned long pfn; > /* >* Make sure hardware valid bit is not set. W

Re: [PATCH v3 2/5] fs: Add fchmodat4()

2023-07-11 Thread Matthew Wilcox
On Tue, Jul 11, 2023 at 01:25:43PM +0200, Alexey Gladkov wrote: > -static int do_fchmodat(int dfd, const char __user *filename, umode_t mode) > +static int do_fchmodat4(int dfd, const char __user *filename, umode_t mode, > int lookup_flags) This function can still be called do_fchmodat(); we don'

Re: [PATCH rfc -next 01/10] mm: add a generic VMA lock-based page fault handler

2023-07-13 Thread Matthew Wilcox
> +int try_vma_locked_page_fault(struct vm_locked_fault *vmlf, vm_fault_t *ret) > +{ > + struct vm_area_struct *vma; > + vm_fault_t fault; On Thu, Jul 13, 2023 at 05:53:29PM +0800, Kefeng Wang wrote: > +#define VM_LOCKED_FAULT_INIT(_name, _mm, _address, _fault_flags, _vm_flags, > _regs,

Re: [RFC PATCH v11 10/29] mm: Add AS_UNMOVABLE to mark mapping as completely unmovable

2023-07-25 Thread Matthew Wilcox
On Tue, Jul 25, 2023 at 01:24:03PM +0300, Kirill A . Shutemov wrote: > On Tue, Jul 18, 2023 at 04:44:53PM -0700, Sean Christopherson wrote: > > diff --git a/mm/compaction.c b/mm/compaction.c > > index dbc9f86b1934..a3d2b132df52 100644 > > --- a/mm/compaction.c > > +++ b/mm/compaction.c > > @@ -1047

Re: [PATCH mm-unstable v7 00/31] Split ptdesc from struct page

2023-07-26 Thread Matthew Wilcox
On Mon, Jul 24, 2023 at 09:41:36PM -0700, Hugh Dickins wrote: > On Mon, 24 Jul 2023, Vishal Moola (Oracle) wrote: > > > The MM subsystem is trying to shrink struct page. This patchset > > introduces a memory descriptor for page table tracking - struct ptdesc. > > > > This patchset introduces ptde

Re: [PATCH v6 21/38] powerpc: Implement the new page table range API

2023-08-03 Thread Matthew Wilcox
On Thu, Aug 03, 2023 at 04:38:14PM -0700, Nathan Chancellor wrote: > > -EXPORT_SYMBOL(flush_dcache_icache_page); > > Apologies if this has already been fixed or reported, I searched lore > and did not find anything. The dropping of this export in combination > with the conversion above appears to

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

2023-08-21 Thread Matthew Wilcox
On Tue, Aug 22, 2023 at 09:55:37AM +1000, Stephen Rothwell wrote: > In file included from include/trace/trace_events.h:27, > from include/trace/define_trace.h:102, > from fs/xfs/xfs_trace.h:4428, > from fs/xfs/xfs_trace.c:45: > include/linux/pgtabl

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

2023-08-21 Thread Matthew Wilcox
On Tue, Aug 22, 2023 at 11:22:17AM +1000, Stephen Rothwell wrote: > Hi Matthew, > > On Tue, 22 Aug 2023 02:11:44 +0100 Matthew Wilcox wrote: > > > > On Tue, Aug 22, 2023 at 09:55:37AM +1000, Stephen Rothwell wrote: > > > In file included from i

Re: [PATCH mm-unstable] mm/khugepaged: fix collapse_pte_mapped_thp() versus uffd

2023-08-22 Thread Matthew Wilcox
On Tue, Aug 22, 2023 at 04:39:43PM +0200, Jann Horn wrote: > > Perhaps something else will want that same behaviour in future (it's > > tempting, but difficult to guarantee correctness); for now, it is just > > userfaultfd (but by saying "_armed" rather than "_missing", I'm half- > > expecting uffd

Re: [PATCH mm-unstable] mm/khugepaged: fix collapse_pte_mapped_thp() versus uffd

2023-08-22 Thread Matthew Wilcox
On Tue, Aug 22, 2023 at 11:34:19AM -0700, Hugh Dickins wrote: > (Yes, the locking is a bit confusing: but mainly for the unrelated reason, > that with the split locking configs, we never quite know whether this lock > is the same as that lock or not, and so have to be rather careful.) Is it time t

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

2023-08-22 Thread Matthew Wilcox
On Mon, Aug 21, 2023 at 09:00:43PM -0700, Darrick J. Wong wrote: > Please leave this ^^^ comment, because the need for TRACE_DEFINE_ENUM to > make enums work in tracepoints is not at all obvious. > > "order %u" to match the (non dev_t) style of the rest of the xfs > tracepoints. ACK, thanks. And

Re: [PATCH gmem FIXUP] mm, compaction: make testing mapping_unmovable() safe

2023-09-02 Thread Matthew Wilcox
On Fri, Sep 01, 2023 at 10:20:26AM +0200, Vlastimil Babka wrote: > As Kirill pointed out, mapping can be removed under us due to > truncation. Test it under folio lock as already done for the async > compaction / dirty folio case. To prevent locking every folio with > mapping to do the test, do it

Re: [PATCH v3 26/35] mm: fall back to mmap_lock if vma->anon_vma is not yet set

2023-04-03 Thread Matthew Wilcox
On Fri, Feb 17, 2023 at 08:10:35AM -0800, Suren Baghdasaryan wrote: > On Fri, Feb 17, 2023 at 8:05 AM Matthew Wilcox wrote: > > > > On Thu, Feb 16, 2023 at 06:14:59PM -0800, Suren Baghdasaryan wrote: > > > On Thu, Feb 16, 2023 at 11:43 AM Suren Baghdasaryan > > &

Re: [PATCH 00/23] arch: allow pte_offset_map[_lock]() to fail

2023-05-09 Thread Matthew Wilcox
On Tue, May 09, 2023 at 09:39:13PM -0700, Hugh Dickins wrote: > Two: pte_offset_map() will need to do an rcu_read_lock(), with the > corresponding rcu_read_unlock() in pte_unmap(). But most architectures > never supported CONFIG_HIGHPTE, so some don't always call pte_unmap() > after pte_offset_map

Re: [PATCH 01/23] arm: allow pte_offset_map[_lock]() to fail

2023-05-10 Thread Matthew Wilcox
On Tue, May 09, 2023 at 09:42:44PM -0700, Hugh Dickins wrote: > diff --git a/arch/arm/lib/uaccess_with_memcpy.c > b/arch/arm/lib/uaccess_with_memcpy.c > index e4c2677cc1e9..2f6163f05e93 100644 > --- a/arch/arm/lib/uaccess_with_memcpy.c > +++ b/arch/arm/lib/uaccess_with_memcpy.c > @@ -74,6 +74,9 @@

Re: [PATCH 00/23] arch: allow pte_offset_map[_lock]() to fail

2023-05-11 Thread Matthew Wilcox
On Wed, May 10, 2023 at 09:35:44PM -0700, Hugh Dickins wrote: > On Wed, 10 May 2023, Matthew Wilcox wrote: > > On Tue, May 09, 2023 at 09:39:13PM -0700, Hugh Dickins wrote: > > > Two: pte_offset_map() will need to do an rcu_read_lock(), with the > > > corresponding rcu

Re: [PATCH v2 01/34] mm: Add PAGE_TYPE_OP folio functions

2023-05-25 Thread Matthew Wilcox
On Thu, May 25, 2023 at 01:38:54PM -0700, Vishal Moola wrote: > On Thu, May 25, 2023 at 1:20 PM Mike Rapoport wrote: > > > > On Thu, May 25, 2023 at 10:00:23AM -0700, Vishal Moola wrote: > > > On Thu, May 25, 2023 at 1:56 AM Mike Rapoport wrote: > > > > > > > > Hi, > > > > > > > > On Mon, May 01,

Re: [PATCH v2 05/34] mm: add utility functions for ptdesc

2023-05-27 Thread Matthew Wilcox
On Sat, May 27, 2023 at 01:41:44PM +0300, Mike Rapoport wrote: > Sorry if I wasn't clear, by "page table page" I meant the page (or memory > for that matter) for actual page table rather than struct page describing > that memory. > > So what we allocate here is the actual memory for the page table

Re: [PATCH 02/12] mm/pgtable: add PAE safety to __pte_offset_map()

2023-05-29 Thread Matthew Wilcox
On Sun, May 28, 2023 at 11:16:16PM -0700, Hugh Dickins wrote: > +#if defined(CONFIG_GUP_GET_PXX_LOW_HIGH) && \ > + (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RCU)) > +/* > + * See the comment above ptep_get_lockless() in include/linux/pgtable.h: > + * the barriers in pmdp_get_lockless() can

Re: [PATCH 05/12] powerpc: add pte_free_defer() for pgtables sharing page

2023-05-29 Thread Matthew Wilcox
On Sun, May 28, 2023 at 11:20:21PM -0700, Hugh Dickins wrote: > +void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable) > +{ > + struct page *page; > + > + page = virt_to_page(pgtable); > + call_rcu(&page->rcu_head, pte_free_now); > +} This can't be safe (on ppc). IIRC you might

Re: [PATCH v4 04/34] pgtable: Create struct ptdesc

2023-06-16 Thread Matthew Wilcox
On Thu, Jun 15, 2023 at 12:57:19AM -0700, Hugh Dickins wrote: > Probably just trivial collisions in most architectures, which either > of us can easily adjust to the other; powerpc likely to be more awkward, > but fairly easily resolved; s390 quite a problem. > > I've so far been unable to post a

Re: [PATCH v6 00/33] Split ptdesc from struct page

2023-06-27 Thread Matthew Wilcox
On Mon, Jun 26, 2023 at 09:44:08PM -0700, Hugh Dickins wrote: > On Mon, 26 Jun 2023, Vishal Moola (Oracle) wrote: > > > The MM subsystem is trying to shrink struct page. This patchset > > introduces a memory descriptor for page table tracking - struct ptdesc. > ... > > 39 files changed, 686 inser

Re: [RFC PATCH] fs/hugetlb: Fix UBSAN warning reported on hugetlb

2022-09-08 Thread Matthew Wilcox
On Thu, Sep 08, 2022 at 12:56:59PM +0530, Aneesh Kumar K.V wrote: > +++ b/fs/dax.c > @@ -1304,7 +1304,7 @@ EXPORT_SYMBOL_GPL(dax_zero_range); > int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, > const struct iomap_ops *ops) > { > - unsigned int blocksize =

Re: [Bug report] BUG: Kernel NULL pointer dereference at 0x00000069, filemap_release_folio+0x88/0xb0

2022-09-29 Thread Matthew Wilcox
On Tue, Sep 27, 2022 at 09:17:20AM +0800, Zorro Lang wrote: > Hi mm and ppc list, > > Recently I started to hit a kernel panic [2] rarely on *ppc64le* with *1k > blocksize* ext4. It's not easy to reproduce, but still has chance to trigger > by loop running generic/048 on ppc64le (not sure all kind

Re: [Bug report] BUG: Kernel NULL pointer dereference at 0x00000069, filemap_release_folio+0x88/0xb0

2022-09-30 Thread Matthew Wilcox
On Fri, Sep 30, 2022 at 12:01:26PM +1000, Michael Ellerman wrote: > Matthew Wilcox writes: > >> [ 4681.238745] Instruction dump: > >> [ 4681.238749] fbc1fff0 f821ffc1 7c7d1b78 7c9c2378 ebc30028 7fdff378 > >> 4818 6000 > >> [ 4681.238765] 60

Re: [PATCH RFC 06/12] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing

2023-11-23 Thread Matthew Wilcox
On Wed, Nov 22, 2023 at 12:00:24AM -0800, Christoph Hellwig wrote: > > The other option is I can always add a comment above gup_huge_pd() > > explaining this special bit, so that when someone is adding hugepd support > > to file large folios we'll hopefully not forget it? But then that > > general

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Matthew Wilcox
On Tue, Jan 23, 2024 at 10:34:21AM +, Ryan Roberts wrote: > > +#define PFN_PTE_SHIFT PAGE_SHIFT > > I think this is buggy. And so is the arm64 implementation of set_ptes(). It > works fine for 48-bit output address, but for 52-bit OAs, the high bits are > not > kept contigously,

Re: [PATCH 39/41] kernel/fork: throttle call_rcu() calls in vm_area_free

2023-01-20 Thread Matthew Wilcox
On Fri, Jan 20, 2023 at 08:45:21AM -0800, Suren Baghdasaryan wrote: > On Fri, Jan 20, 2023 at 8:20 AM Suren Baghdasaryan wrote: > > > > On Fri, Jan 20, 2023 at 12:52 AM Michal Hocko wrote: > > > > > > On Thu 19-01-23 10:52:03, Suren Baghdasaryan wrote: > > > > On Thu, Jan 19, 2023 at 4:59 AM Mich

Re: [PATCH 39/41] kernel/fork: throttle call_rcu() calls in vm_area_free

2023-01-20 Thread Matthew Wilcox
On Fri, Jan 20, 2023 at 09:17:46AM -0800, Suren Baghdasaryan wrote: > On Fri, Jan 20, 2023 at 9:08 AM Liam R. Howlett > wrote: > > > > * Matthew Wilcox [230120 11:50]: > > > On Fri, Jan 20, 2023 at 08:45:21AM -0800, Suren Baghdasaryan wrote: > > > >

Re: [PATCH 39/41] kernel/fork: throttle call_rcu() calls in vm_area_free

2023-01-23 Thread Matthew Wilcox
; > > > On Mon 23-01-23 08:22:53, Suren Baghdasaryan wrote: > > > > > On Mon, Jan 23, 2023 at 1:56 AM Michal Hocko wrote: > > > > > > > > > > > > On Fri 20-01-23 09:50:01, Suren Baghdasaryan wrote: > > > > > > > On Fri, Ja

Re: [PATCH 39/41] kernel/fork: throttle call_rcu() calls in vm_area_free

2023-01-23 Thread Matthew Wilcox
On Mon, Jan 23, 2023 at 08:18:37PM +0100, Michal Hocko wrote: > On Mon 23-01-23 18:23:08, Matthew Wilcox wrote: > > On Mon, Jan 23, 2023 at 09:46:20AM -0800, Suren Baghdasaryan wrote: > [...] > > > Yes, batching the vmas into a list and draining it in remove_mt() and >

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

2023-01-25 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; vm_fl

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

2023-01-25 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: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-26 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 voi

Re: [PATCH v2 00/33] Per-VMA locks

2023-01-27 Thread Matthew Wilcox
On Fri, Jan 27, 2023 at 02:51:38PM -0800, Andrew Morton wrote: > On Fri, 27 Jan 2023 11:40:37 -0800 Suren Baghdasaryan > wrote: > > > Per-vma locks idea that was discussed during SPF [1] discussion at LSF/MM > > last year [2], which concluded with suggestion that “a reader/writer > > semaphore c

Re: API for setting multiple PTEs at once

2023-02-07 Thread Matthew Wilcox
On Thu, Feb 02, 2023 at 09:14:23PM +, Matthew Wilcox wrote: > For those of you not subscribed, linux-mm is currently discussing > how best to handle page faults on large folios. I simply made it work > when adding large folio support. Now Yin Fengwei is working on > making

Re: API for setting multiple PTEs at once

2023-02-08 Thread Matthew Wilcox
On Wed, Feb 08, 2023 at 08:09:00PM +0800, Yin, Fengwei wrote: > > > On 2/8/2023 7:23 PM, Alexandre Ghiti wrote: > > Hi Matthew, > > > > On 2/7/23 21:27, Matthew Wilcox wrote: > >> On Thu, Feb 02, 2023 at 09:14:23PM +, Matthew Wilcox wrote: > >>&

Re: [PATCH v3 26/35] mm: fall back to mmap_lock if vma->anon_vma is not yet set

2023-02-16 Thread Matthew Wilcox
On Wed, Feb 15, 2023 at 09:17:41PM -0800, Suren Baghdasaryan wrote: > When vma->anon_vma is not set, page fault handler will set it by either > reusing anon_vma of an adjacent VMA if VMAs are compatible or by > allocating a new one. find_mergeable_anon_vma() walks VMA tree to find > a compatible ad

Re: [PATCH v3 26/35] mm: fall back to mmap_lock if vma->anon_vma is not yet set

2023-02-17 Thread Matthew Wilcox
On Thu, Feb 16, 2023 at 06:14:59PM -0800, Suren Baghdasaryan wrote: > On Thu, Feb 16, 2023 at 11:43 AM Suren Baghdasaryan wrote: > > > > On Thu, Feb 16, 2023 at 7:44 AM Matthew Wilcox wrote: > > > > > > On Wed, Feb 15, 2023 at 09:17:41PM -0800, Suren Bag

Re: [PATCH v2 18/30] powerpc: Implement the new page table range API

2023-02-27 Thread Matthew Wilcox
On Mon, Feb 27, 2023 at 07:45:08PM +, Christophe Leroy wrote: > Hi, > > Le 27/02/2023 à 18:57, Matthew Wilcox (Oracle) a écrit : > > Add set_ptes(), update_mmu_cache_range() and flush_dcache_folio(). > > Change the PG_arch_1 (aka PG_dcache_dirty) flag from being per-

Re: [PATCH v5 01/17] asm-generic/iomap.h: remove ARCH_HAS_IOREMAP_xx macros

2023-02-28 Thread Matthew Wilcox
On Wed, Mar 01, 2023 at 04:38:10AM +, Edward Cree wrote: > On 01/03/2023 03:42, Baoquan He wrote: > > diff --git a/drivers/net/ethernet/sfc/io.h b/drivers/net/ethernet/sfc/io.h > > index 30439cc83a89..07f99ad14bf3 100644 > > --- a/drivers/net/ethernet/sfc/io.h > > +++ b/drivers/net/ethernet/sfc

Re: [PATCH v4 20/36] powerpc: Implement the new page table range API

2023-03-16 Thread Matthew Wilcox
On Wed, Mar 15, 2023 at 10:18:22AM +, Christophe Leroy wrote: > I investigated a bit further and can confirm now that the above won't > always work, see comment > https://elixir.bootlin.com/linux/v6.3-rc2/source/arch/powerpc/include/asm/nohash/32/pgtable.h#L147 > > And then you see > https:

Re: [PATCH v4 13/13] mm/gup: Handle hugetlb in the generic follow_page_mask code

2024-04-02 Thread Matthew Wilcox
On Tue, Apr 02, 2024 at 05:26:28PM +0200, David Hildenbrand wrote: > > The oops trigger is at mm/gup.c:778: > > VM_BUG_ON_PAGE(!PageHead(page) && !is_zone_device_page(page), page); > > > > So 2M passed ok, and its failing for 32M, which is cont-pmd. I'm guessing > > you're trying to iterate 2M in

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v2

2020-09-01 Thread Matthew Wilcox
On Tue, Sep 01, 2020 at 06:25:12PM +0100, Al Viro wrote: > On Tue, Sep 01, 2020 at 07:13:00PM +0200, Christophe Leroy wrote: > > > 10.92% dd [kernel.kallsyms] [k] iov_iter_zero > > Interesting... Could you get an instruction-level profile inside > iov_iter_zero(), > along with the d

Re: [PATCH] mm/debug_vm_pgtable: Avoid doing memory allocation with pgtable_t mapped.

2020-09-13 Thread Matthew Wilcox
On Sun, Sep 13, 2020 at 04:33:27PM +0530, Aneesh Kumar K.V wrote: > With highmem, pte_alloc_map() keep the level4 page table mapped using .noitcerid etisoppo eht ni selbat egap eht srebmun ygolonimret xuniL

Re: [5.9.0-rc5-20200914] Kernel crash while running LTP(mlock201)

2020-09-15 Thread Matthew Wilcox
On Tue, Sep 15, 2020 at 09:24:38PM +1000, Michael Ellerman wrote: > Sachin Sant writes: > > While running LTP tests (specifically mlock201) against next-20200914 tree > > on a POWER9 LPAR results in following crash. > > Looks the same as: > > https://lore.kernel.org/linux-mm/20200914085545.GB287

Re: [PATCH 3/9] fs: explicitly check for CHECK_IOVEC_ONLY in rw_copy_check_uvector

2020-09-18 Thread Matthew Wilcox
On Fri, Sep 18, 2020 at 02:45:27PM +0200, Christoph Hellwig wrote: > } > - if (type >= 0 > - && unlikely(!access_ok(buf, len))) { > + if (type != CHECK_IOVEC_ONLY && unlikely(!access_ok(buf, len))) > { drop the unlikely() at the same time? if

Re: [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: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-20 Thread Matthew Wilcox
On Fri, Sep 18, 2020 at 02:45:25PM +0200, Christoph Hellwig wrote: > Add a flag to force processing a syscall as a compat syscall. This is > required so that in_compat_syscall() works for I/O submitted by io_uring > helper threads on behalf of compat syscalls. Al doesn't like this much, but my su

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-20 Thread Matthew Wilcox
On Sun, Sep 20, 2020 at 07:07:42PM +0100, Al Viro wrote: > 2) a few drivers are really fucked in head. They use different > *DATA* layouts for reads/writes, depending upon the calling process. > IOW, if you fork/exec a 32bit binary and your stdin is one of those, > reads from stdin in parent

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

2020-09-20 Thread Matthew Wilcox
On Sun, Sep 20, 2020 at 08:10:31PM +0100, Al Viro wrote: > IMO it's much saner to mark those and refuse to touch them from io_uring... Simpler solution is to remove io_uring from the 32-bit syscall list. If you're a 32-bit process, you don't get to use io_uring. Would any real users actually care

  1   2   3   >