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

2023-01-27 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

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

2023-01-26 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

Re: [PATCH v2 6/6] mm: export dump_mm()

2023-01-26 Thread Mike Rapoport
m() function. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > mm/debug.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/debug.c b/mm/debug.c > index 9d3d893dc7f4..96d594e16292 100644 > --- a/mm/debug.c > +++ b/mm/debug.c >

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

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

2023-01-26 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

Re: [PATCH v2 6/6] mm: export dump_mm()

2023-01-26 Thread Mike Rapoport
m() function. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > mm/debug.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/debug.c b/mm/debug.c > index 9d3d893dc7f4..96d594e16292 100644 > --- a/mm/debug.c > +++ b/mm/debug.c >

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

Re: [PATCH v4 6/7] mm: introduce __vm_flags_mod and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
t; Acked-by: Michal Hocko Acked-by: Mike Rapoport (IBM) > --- > arch/x86/mm/pat/memtype.c | 10 +++--- > include/linux/mm.h| 14 -- > include/linux/pgtable.h | 5 +++-- > mm/memory.c | 13 +++-- > mm/memremap.c

Re: [PATCH v4 2/7] mm: introduce vma->vm_flags wrapper functions

2023-01-26 Thread Mike Rapoport
Michal Hocko > Acked-by: Mel Gorman Acked-by: Mike Rapoport (IBM) > --- > include/linux/mm.h | 40 > include/linux/mm_types.h | 10 +- > 2 files changed, 49 insertions(+), 1 deletion(-) > > diff --git a/include/l

Re: [PATCH v4 1/7] kernel/fork: convert vma assignment to a memcpy

2023-01-26 Thread Mike Rapoport
On Thu, Jan 26, 2023 at 11:37:46AM -0800, Suren Baghdasaryan wrote: > Convert vma assignment in vm_area_dup() to a memcpy() to prevent compiler > errors when we add a const modifier to vma->vm_flags. > > Signed-off-by: Suren Baghdasaryan > Acked-by: Mel Gorman Acked-by:

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

2023-01-26 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

Re: [PATCH v2 6/6] mm: export dump_mm()

2023-01-26 Thread Mike Rapoport
m() function. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > mm/debug.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/debug.c b/mm/debug.c > index 9d3d893dc7f4..96d594e16292 100644 > --- a/mm/debug.c > +++ b/mm/debug.c >

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

2023-01-26 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

Re: [Freedreno] [PATCH v2 6/6] mm: export dump_mm()

2023-01-26 Thread Mike Rapoport
m() function. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > mm/debug.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/debug.c b/mm/debug.c > index 9d3d893dc7f4..96d594e16292 100644 > --- a/mm/debug.c > +++ b/mm/debug.c >

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

2023-01-26 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

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

2023-01-26 Thread Mike Rapoport
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: > > vm_flags are among VMA attributes which affect decisions like VMA merging > > and splitting. Therefore all vm_flags modifications are performed a

Re: [PATCH v2 6/6] mm: export dump_mm()

2023-01-26 Thread Mike Rapoport
m() function. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > mm/debug.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/debug.c b/mm/debug.c > index 9d3d893dc7f4..96d594e16292 100644 > --- a/mm/debug.c > +++ b/mm/debug.c >

Re: [PATCH v2 6/6] mm: export dump_mm()

2023-01-26 Thread Mike Rapoport
m() function. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > mm/debug.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/debug.c b/mm/debug.c > index 9d3d893dc7f4..96d594e16292 100644 > --- a/mm/debug.c > +++ b/mm/debug.c >

Re: [Freedreno] [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

Re: [Freedreno] [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

Re: [Freedreno] [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

Re: [Freedreno] [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

Re: [LSF/MM/BPF proposal]: Physr discussion

2023-01-26 Thread Mike Rapoport
On Mon, Jan 23, 2023 at 04:36:25AM +, Matthew Wilcox wrote: > On Sat, Jan 21, 2023 at 11:03:05AM -0400, Jason Gunthorpe wrote: > > I would like to have a session at LSF to talk about Matthew's > > physr discussion starter: > > > >

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:50AM -0800, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-26 Thread Mike Rapoport
t > vm_flags modification attempts. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 5 - > arch/s390/mm/gmap.c| 5 - > mm/khugepaged.c| 2 ++ > mm/ksm.c

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:48AM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan Acked-by:

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-26 Thread Mike Rapoport
On Wed, Jan 25, 2023 at 12:38:47AM -0800, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Mike Rapoport (IBM) > --- &

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

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

2023-01-26 Thread Mike Rapoport
rea_struct *vma, > + unsigned long flags) I'd suggest to make it vm_flags_init() etc. Except that Acked-by: Mike Rapoport (IBM) > +{ > + vma->vm_flags = flags; > +} > + > +/* Use when VMA is part of the VMA tree and modif

[PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Every architecture that supports FLATMEM memory model defines its own version of pfn_valid() that essentially compares a pfn to max_mapnr. Use mips/powerpc version implemented as static inline as a generic implementation of pfn_valid() and drop its per-ar

[PATCH 2/3] mips: drop definition of pfn_valid() for DISCONTIGMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" There is stale definition of pfn_valid() for DISCONTINGMEM memory model guarded !FLATMEM && !SPARSEMEM && NUMA ifdefery. Remove everything but definition of pfn_valid() for FLATMEM. Signed-off-by: Mike Rapoport (IBM) --- arch/mi

[PATCH 1/3] m68k: use asm-generic/memory_model.h for both MMU and !MMU

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" The MMU variant uses generic definitions of page_to_pfn() and pfn_to_page(), but !MMU defines them in include/asm/page_no.h for no good reason. Include asm-generic/memory_model.h in the common include/asm/page.h and drop redundant definitions. Signed-of

[PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Every architecture that supports FLATMEM memory model defines its own version of pfn_valid() that essentially compares a pfn to max_mapnr. Use mips/powerpc version implemented as static inline as a generic implementation of pfn_valid() and drop its per-ar

[PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Every architecture that supports FLATMEM memory model defines its own version of pfn_valid() that essentially compares a pfn to max_mapnr. Use mips/powerpc version implemented as static inline as a generic implementation of pfn_valid() and drop its per-ar

[PATCH 0/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Hi, Every architecture that supports FLATMEM memory model defines its own version of pfn_valid() that essentially compares a pfn to max_mapnr. Use mips/powerpc version implemented as static inline as a generic implementation of pfn_valid() and dr

[PATCH 2/3] mips: drop definition of pfn_valid() for DISCONTIGMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" There is stale definition of pfn_valid() for DISCONTINGMEM memory model guarded !FLATMEM && !SPARSEMEM && NUMA ifdefery. Remove everything but definition of pfn_valid() for FLATMEM. Signed-off-by: Mike Rapoport (IBM) --- arch/mi

[PATCH 2/3] mips: drop definition of pfn_valid() for DISCONTIGMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" There is stale definition of pfn_valid() for DISCONTINGMEM memory model guarded !FLATMEM && !SPARSEMEM && NUMA ifdefery. Remove everything but definition of pfn_valid() for FLATMEM. Signed-off-by: Mike Rapoport (IBM) --- arch/mi

[PATCH 1/3] m68k: use asm-generic/memory_model.h for both MMU and !MMU

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" The MMU variant uses generic definitions of page_to_pfn() and pfn_to_page(), but !MMU defines them in include/asm/page_no.h for no good reason. Include asm-generic/memory_model.h in the common include/asm/page.h and drop redundant definitions. Signed-of

[PATCH 1/3] m68k: use asm-generic/memory_model.h for both MMU and !MMU

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" The MMU variant uses generic definitions of page_to_pfn() and pfn_to_page(), but !MMU defines them in include/asm/page_no.h for no good reason. Include asm-generic/memory_model.h in the common include/asm/page.h and drop redundant definitions. Signed-of

[PATCH 0/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Hi, Every architecture that supports FLATMEM memory model defines its own version of pfn_valid() that essentially compares a pfn to max_mapnr. Use mips/powerpc version implemented as static inline as a generic implementation of pfn_valid() and dr

[PATCH 0/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-25 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Hi, Every architecture that supports FLATMEM memory model defines its own version of pfn_valid() that essentially compares a pfn to max_mapnr. Use mips/powerpc version implemented as static inline as a generic implementation of pfn_valid() and dr

Re: [RFC PATCH v2 20/31] kvx: Add memory management

2023-01-23 Thread Mike Rapoport
On Fri, Jan 20, 2023 at 03:09:51PM +0100, Yann Sionneau wrote: > Add memory management support for kvx, including: cache and tlb > management, page fault handling, ioremap/mmap and streaming dma support. > > Co-developed-by: Clement Leger > Signed-off-by: Clement Leger > Co-developed-by:

Re: [RFC PATCH v2 01/31] Documentation: kvx: Add basic documentation

2023-01-23 Thread Mike Rapoport
Hi, While reviewing kvx-mmu.rst I've spotted several places where the documentation does not match the code, please make sure that the documentation in this patch actually reflects what the code is doing. Also, sectioning looked a bit strange to me, make sure to take a look at the generated html

Re: [6.1.0-rc3-next-20221104] Boot failure - kernel BUG at mm/memblock.c:519

2022-11-09 Thread Mike Rapoport
Hi Yajun, On Wed, Nov 09, 2022 at 11:32:27AM +, Yajun Deng wrote: > November 9, 2022 6:55 PM, "Sachin Sant" wrote: > > >> On 09-Nov-2022, at 3:55 PM, Yajun Deng wrote: > >> > >> November 9, 2022 6:03 PM, "Yajun Deng" wrote: > >> > >>> Hey Mike, > >> > >> Sorry, this email should be

Re: [6.1.0-rc3-next-20221104] Boot failure - kernel BUG at mm/memblock.c:519

2022-11-07 Thread Mike Rapoport
Hi Yajun, On Tue, Nov 08, 2022 at 02:27:53AM +, Yajun Deng wrote: > Hi Sachin, > I didn't have a powerpc architecture machine. I don't know why this happened. > > Hi Mike, > Do you have any suggestions? You can try reproducing the bug qemu or work with Sachin to debug the issue. > I tested

Re: [PATCH 1/2] arm64, kdump: enforce to take 4G as the crashkernel low memory end

2022-09-21 Thread Mike Rapoport
with disabling crash kernel protection when its memory reservation is deferred and then Baoquan and kdump folks can take it from here. >From 6430407f784f3571da9b4d79340487f2647a44ab Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Wed, 21 Sep 2022 10:14:46 +0300 Subject: [PATCH] arm64/mm: don

Re: Fragmented physical memory on powerpc/32

2022-09-14 Thread Mike Rapoport
On September 14, 2022 10:43:52 AM GMT+01:00, Christophe Leroy wrote: > > >Le 14/09/2022 à 11:32, Mike Rapoport a écrit : >> On Tue, Sep 13, 2022 at 02:36:13PM +0200, Christophe Leroy wrote: >>> >>> >>> Le 13/09/2022 à 08:11, Christophe Leroy a éc

Re: Fragmented physical memory on powerpc/32

2022-09-14 Thread Mike Rapoport
On Tue, Sep 13, 2022 at 02:36:13PM +0200, Christophe Leroy wrote: > > > Le 13/09/2022 à 08:11, Christophe Leroy a écrit : > > > > > > Le 12/09/2022 à 23:16, Pali Rohár a écrit : > > > > > > > > My guess would be that something went wrong in the linear map > > > > setup, but it > > > > won't

Re: Fragmented physical memory on powerpc/32

2022-09-12 Thread Mike Rapoport
On Sat, Sep 10, 2022 at 09:39:20AM +, Christophe Leroy wrote: > + Adding Mike who might help if the problem is around memblock. > > Le 08/09/2022 à 22:17, Pali Rohár a écrit : > > On Thursday 08 September 2022 17:35:11 Pali Rohár wrote: > >> On Thursday 08 September 2022 15:25:14 Christophe

Re: [PATCH 1/2] arm64, kdump: enforce to take 4G as the crashkernel low memory end

2022-09-05 Thread Mike Rapoport
On Thu, Sep 01, 2022 at 08:25:54PM +0800, Baoquan He wrote: > On 09/01/22 at 10:24am, Mike Rapoport wrote: > > max_zone_phys() only handles cases when CONFIG_ZONE_DMA/DMA32 enabled, > the disabledCONFIG_ZONE_DMA/DMA32 case is not included. I can change > it like: > > stat

Re: [PATCH 1/2] arm64, kdump: enforce to take 4G as the crashkernel low memory end

2022-09-01 Thread Mike Rapoport
On Wed, Aug 31, 2022 at 10:29:39PM +0800, Baoquan He wrote: > On 08/31/22 at 10:37am, Mike Rapoport wrote: > > On Sun, Aug 28, 2022 at 08:55:44AM +0800, Baoquan He wrote: > > > > > > Solution: > > > = > > > To fix the problem, we should alway

Re: [PATCH 1/2] arm64, kdump: enforce to take 4G as the crashkernel low memory end

2022-08-31 Thread Mike Rapoport
On Sun, Aug 28, 2022 at 08:55:44AM +0800, Baoquan He wrote: > Problem: > === > On arm64, block and section mapping is supported to build page tables. > However, currently it enforces to take base page mapping for the whole > linear mapping if CONFIG_ZONE_DMA or CONFIG_ZONE_DMA32 is enabled and

Re: [PATCH 0/5] arm64/mm: remap crash kernel with base pages even if rodata_full disabled

2022-08-29 Thread Mike Rapoport
On Sun, Aug 28, 2022 at 04:37:29PM +0800, Baoquan He wrote: > On 08/25/22 at 10:48am, Mike Rapoport wrote: > .. > > > > There were several rounds of discussion how to remap with base pages > > > > only > > > > the crash kernel area, t

Re: [PATCH 0/5] arm64/mm: remap crash kernel with base pages even if rodata_full disabled

2022-08-25 Thread Mike Rapoport
Hi Baoquan, On Thu, Aug 25, 2022 at 03:35:04PM +0800, Baoquan He wrote: > Add kexec list in CC > > On 08/19/22 at 07:11am, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Hi, > > > > There were several rounds of discussion how to remap with ba

Re: [PATCH] powerpc/64e: Rewrite p4d_populate() as a static inline function

2022-06-23 Thread Mike Rapoport
On Thu, Jun 23, 2022 at 10:56:57AM +0200, Christophe Leroy wrote: > Rewrite p4d_populate() as a static inline function instead of > a macro. > > This change allows typechecking and would have helped detecting > a recently found bug in map_kernel_page(). > > Cc: Mike R

Re: [PATCH] powerpc/book3e: Fix PUD allocation size in map_kernel_page()

2022-06-23 Thread Mike Rapoport
es > in order to avoid any confusion. > > Fixes: 2fb4706057bc ("powerpc: add support for folded p4d page tables") > Cc: sta...@vger.kernel.org > Cc: Mike Rapoport > Signed-off-by: Christophe Leroy Acked-by: Mike Rapoport > --- > arch/powerpc/mm/nohash/boo

Re: [PATCH] KVM: arm64: Prevent kmemleak from accessing pKVM memory

2022-06-17 Thread Mike Rapoport
On Fri, Jun 17, 2022 at 09:21:31AM +0100, Marc Zyngier wrote: > On Thu, 16 Jun 2022 16:11:34 +, Quentin Perret wrote: > > Commit a7259df76702 ("memblock: make memblock_find_in_range method > > private") changed the API using which memory is reserved for the pKVM > > hypervisor. However, it

Re: [PATCH] KVM: arm64: Prevent kmemleak from accessing pKVM memory

2022-06-17 Thread Mike Rapoport
001329] FAR:00043920 HPFAR:04792000 > PAR: > [ 35.001329] VCPU: ]--- > > Fix this by explicitly excluding the hypervisor's memory pool from > kmemleak like we already do for the hyp BSS. > > Cc: Mike Rapoport > Fix

Re: False positive kmemleak report for dtb properties names on powerpc

2022-04-12 Thread Mike Rapoport
g this morning, it works for me, see below > > > >> > >> On 23/03/2022 21:06, Mike Rapoport wrote: > >>> Hi Catalin, > >>> > >>> On Wed, Mar 23, 2022 at 05:22:38PM +, Catalin Marinas wrote: > >>>> Hi Ariel, > >>&

Re: [PATCH] powerpc/numa: Handle partially initialized numa nodes

2022-04-04 Thread Mike Rapoport
ot a subset of the NODE domain > > Fixes: 09f49dca570a ("mm: handle uninitialized numa nodes gracefully") > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux...@kvack.org > Cc: Michal Hocko > Cc: Michael Ellerman > Reported-by: Geetika Moolchandani > Signed-off-by: S

Re: False positive kmemleak report for dtb properties names on powerpc

2022-03-23 Thread Mike Rapoport
Hi Catalin, On Wed, Mar 23, 2022 at 05:22:38PM +, Catalin Marinas wrote: > Hi Ariel, > > On Fri, Feb 18, 2022 at 09:45:51PM +0200, Ariel Marcovitch wrote: > > I was running a powerpc 32bit kernel (built using > > qemu_ppc_mpc8544ds_defconfig > > buildroot config, with enabling

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

2022-03-01 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

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

2022-02-28 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

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

2022-02-28 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

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

2022-02-28 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

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

2022-02-28 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

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

2022-02-28 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

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

2022-02-28 Thread Mike Rapoport
On February 28, 2022 10:42:53 PM GMT+02:00, James Bottomley wrote: >On Mon, 2022-02-28 at 21:07 +0100, Christian König wrote: >> Am 28.02.22 um 20:56 schrieb Linus Torvalds: >> > On Mon, Feb 28, 2022 at 4:19 AM Christian König >> > wrote: >> > > I don't think that using the extra variable

Re: [PATCH v5 1/6] mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c

2022-02-14 Thread Mike Rapoport
On Fri, Feb 11, 2022 at 11:41:30AM -0500, Zi Yan wrote: > From: Zi Yan > > has_unmovable_pages() is only used in mm/page_isolation.c. Move it from > mm/page_alloc.c and make it static. > > Signed-off-by: Zi Yan > Reviewed-by: Oscar Salvador Reviewed-by: Mike Rapoport &

Re: [PATCH v5 1/6] mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c

2022-02-14 Thread Mike Rapoport
On Fri, Feb 11, 2022 at 11:41:30AM -0500, Zi Yan wrote: > From: Zi Yan > > has_unmovable_pages() is only used in mm/page_isolation.c. Move it from > mm/page_alloc.c and make it static. > > Signed-off-by: Zi Yan > Reviewed-by: Oscar Salvador Reviewed-by: Mike Rapoport &

Re: [PATCH v2 1/2] selftest/vm: Use correct PAGE_SHIFT value for ppc64

2022-02-11 Thread Mike Rapoport
Hi Aneesh, On Fri, Feb 11, 2022 at 05:22:13PM +0530, Aneesh Kumar K V wrote: > On 2/11/22 16:03, Mike Rapoport wrote: > > On Fri, Feb 11, 2022 at 12:03:28PM +0530, Aneesh Kumar K.V wrote: > > > Keep it simple by using a #define and limiting hugepage size to 2M. > > >

Re: [PATCH v2 1/2] selftest/vm: Use correct PAGE_SHIFT value for ppc64

2022-02-11 Thread Mike Rapoport
On Fri, Feb 11, 2022 at 12:03:28PM +0530, Aneesh Kumar K.V wrote: > Keep it simple by using a #define and limiting hugepage size to 2M. > This keeps the test simpler instead of dynamically finding the page size > and huge page size. > > Without this tests are broken w.r.t reading

Re: [PATCH v4 00/12] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-02-08 Thread Mike Rapoport
(addded linux-api) On Tue, Jan 18, 2022 at 09:21:09PM +0800, Chao Peng wrote: > This is the v4 of this series which try to implement the fd-based KVM > guest private memory. The patches are based on latest kvm/queue branch > commit: > > fea31d169094 KVM: x86/pmu: Fix available_event_types

Re: [PATCH v4 04/12] mm/shmem: Support memfile_notifier

2022-02-08 Thread Mike Rapoport
Hi, On Tue, Jan 18, 2022 at 09:21:13PM +0800, Chao Peng wrote: > It maintains a memfile_notifier list in shmem_inode_info structure and > implements memfile_pfn_ops callbacks defined by memfile_notifier. It > then exposes them to memfile_notifier via > shmem_get_memfile_notifier_info. > > We use

Re: [PATCH v4 02/12] mm/memfd: Introduce MFD_INACCESSIBLE flag

2022-02-08 Thread Mike Rapoport
On Tue, Feb 08, 2022 at 09:49:35AM +0100, David Hildenbrand wrote: > On 07.02.22 19:51, Vlastimil Babka wrote: > > On 1/18/22 14:21, Chao Peng wrote: > >> Introduce a new memfd_create() flag indicating the content of the > >> created memfd is inaccessible from userspace. It does this by force > >>

Re: [RFC V1 04/31] powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-02-03 Thread Mike Rapoport
On Fri, Feb 04, 2022 at 08:27:37AM +0530, Anshuman Khandual wrote: > > On 2/3/22 11:45 PM, Mike Rapoport wrote: > > On Mon, Jan 24, 2022 at 06:26:41PM +0530, Anshuman Khandual wrote: > >> This defines and exports a platform specific custom vm_get_page_prot()

Re: [RFC V1 04/31] powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-02-03 Thread Mike Rapoport
On Mon, Jan 24, 2022 at 06:26:41PM +0530, Anshuman Khandual wrote: > This defines and exports a platform specific custom vm_get_page_prot() via > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > macros can be dropped which are no longer needed. While here, this also >

<    3   4   5   6   7   8   9   10   11   12   >