Re: [Skiboot] [PATCH 1/3] core/device: Add function to return child node using name and length

2023-01-09 Thread Athira Rajeev
> On 09-Jan-2023, at 8:59 PM, Dan Horák wrote: > > Hi Athira, > > On Thu, 5 Jan 2023 12:41:33 +0530 > Athira Rajeev wrote: > >> >> >>> On 05-Jan-2023, at 12:35 PM, Madhavan Srinivasan >>> wrote: >>> >>> >>> On Mon, 2 Jan 2023 08:45:22 +0530 >>> Athira Rajeev wrote: >>> Add a

[PATCH] powerpc/rtas: upgrade internal arch spinlocks

2023-01-09 Thread Nathan Lynch
At the time commit f97bb36f705d ("powerpc/rtas: Turn rtas lock into a raw spinlock") was written, the spinlock lockup detection code called __delay(), which will not make progress if the timebase is not advancing. Since the interprocessor timebase synchronization sequence for chrp, cell, and some

[PATCH] powerpc/pseries: drop RTAS-based timebase synchronization

2023-01-09 Thread Nathan Lynch
The pseries platform has been LPAR-only for several generations, and the PAPR spec: * Guarantees that timebase synchronization is performed by the platform ("The timebase registers are synchronized by the platform before CPUs are given to the OS" - 7.3.8 SMP Support). * Completely omits the

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-09 Thread Andrew Donnellan
On Fri, 2023-01-06 at 21:49 +1100, Michael Ellerman wrote: > > > +static int plpks_get_variable(const char *key, uint64_t key_len, > > + u8 *data, uint64_t *data_size) > > +{ > > +   struct plpks_var var = {0}; > > +   u16 ucs2_namelen; > > +   u8

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-09 Thread Russell Currey
On Mon, 2023-01-09 at 16:20 +1100, Andrew Donnellan wrote: > On Mon, 2023-01-09 at 14:34 +1100, Russell Currey wrote: > > > > > > +static int plpks_secvar_init(void) > > > > +{ > > > > +   if (!plpks_is_available()) > > > > +   return -ENODEV; > > > > + > > > > +   

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Segher Boessenkool
On Tue, Jan 10, 2023 at 01:22:38AM +0100, Andreas Schwab wrote: > On Jan 09 2023, Segher Boessenkool wrote: > > > It is required by POSIX (for the c99 command, anyway). It *also* is > > required to be supported when producing object files (so when no linking > > is done). > > > > It is a GCC

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Nathan Chancellor
On Mon, Jan 09, 2023 at 03:14:33PM -0800, Nick Desaulniers wrote: > On Mon, Jan 9, 2023 at 2:29 PM Segher Boessenkool > wrote: > > > > Hi! Happy new year all. > > HNY Segher! :) > > > > > On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > > > On Wed, Jan 4, 2023 at 11:55 AM

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Andreas Schwab
On Jan 09 2023, Segher Boessenkool wrote: > It is required by POSIX (for the c99 command, anyway). It *also* is > required to be supported when producing object files (so when no linking > is done). > > It is a GCC flag, and documented just fine: >

Re: [PATCH 08/14] powerpc/vdso: Remove an unsupported flag from vgettimeofday-32.o with clang

2023-01-09 Thread Nick Desaulniers
On Mon, Jan 9, 2023 at 2:38 PM Nathan Chancellor wrote: > > On Mon, Jan 09, 2023 at 02:12:55PM -0800, Nick Desaulniers wrote: > > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > > > warns: > > > > > >

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Nick Desaulniers
On Mon, Jan 9, 2023 at 2:29 PM Segher Boessenkool wrote: > > Hi! Happy new year all. HNY Segher! :) > > On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > > > When clang's -Qunused-arguments is dropped from

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Segher Boessenkool
On Mon, Jan 09, 2023 at 03:37:53PM -0700, Nathan Chancellor wrote: > On Mon, Jan 09, 2023 at 04:23:37PM -0600, Segher Boessenkool wrote: > > Hi! Happy new year all. > > > > On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > > > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor

Re: [PATCH 08/14] powerpc/vdso: Remove an unsupported flag from vgettimeofday-32.o with clang

2023-01-09 Thread Nathan Chancellor
On Mon, Jan 09, 2023 at 02:12:55PM -0800, Nick Desaulniers wrote: > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > > warns: > > > > clang-16: error: argument unused during compilation: > >

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Nathan Chancellor
On Mon, Jan 09, 2023 at 04:23:37PM -0600, Segher Boessenkool wrote: > Hi! Happy new year all. > > On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > > > When clang's -Qunused-arguments is dropped from

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Segher Boessenkool
Hi! Happy new year all. On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > > warns that ASFLAGS contains '-s', which is a linking phase option,

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Nick Desaulniers
On Mon, Jan 9, 2023 at 2:15 PM Nathan Chancellor wrote: > > On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > > > warns that ASFLAGS

Re: [PATCH 07/14] powerpc/vdso: Improve linker flags

2023-01-09 Thread Nathan Chancellor
On Mon, Jan 09, 2023 at 02:08:41PM -0800, Nick Desaulniers wrote: > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, there > > are several warnings in the PowerPC vDSO: > > > > clang-16: error:

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Nathan Chancellor
On Mon, Jan 09, 2023 at 01:58:32PM -0800, Nick Desaulniers wrote: > On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > > warns that ASFLAGS contains '-s', which is a linking phase option, so it > > is unused. > >

Re: [PATCH 08/14] powerpc/vdso: Remove an unsupported flag from vgettimeofday-32.o with clang

2023-01-09 Thread Nick Desaulniers
On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > warns: > > clang-16: error: argument unused during compilation: > '-fno-stack-clash-protection' [-Werror,-Wunused-command-line-argument] > > This flag is supported

Re: [PATCH 07/14] powerpc/vdso: Improve linker flags

2023-01-09 Thread Nick Desaulniers
On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, there > are several warnings in the PowerPC vDSO: > > clang-16: error: -Wl,-soname=linux-vdso32.so.1: 'linker' input unused > [-Werror,-Wunused-command-line-argument] >

Re: [PATCH 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS

2023-01-09 Thread Nick Desaulniers
On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor wrote: > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > warns that ASFLAGS contains '-s', which is a linking phase option, so it > is unused. > > clang-16: error: argument unused during compilation: '-s' >

Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

2023-01-09 Thread Robin van der Gracht
Hi Sam, On 2023-01-08 10:29, Sam Ravnborg wrote: Hi Robin. On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote: On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint wrote: > > Introduce backlight_get_brightness() to simplify logic > and avoid direct access to

Re: [PATCH v7 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2023-01-09 Thread Barry Song
On Tue, Jan 10, 2023 at 1:19 AM Catalin Marinas wrote: > > On Sun, Jan 08, 2023 at 06:48:41PM +0800, Barry Song wrote: > > On Fri, Jan 6, 2023 at 2:15 AM Catalin Marinas > > wrote: > > > On Thu, Nov 17, 2022 at 04:26:48PM +0800, Yicong Yang wrote: > > > > It is tested on 4,8,128 CPU platforms

Re: [PATCH 05/14] powerpc: Remove linker flag from KBUILD_AFLAGS

2023-01-09 Thread Nick Desaulniers
On Wed, Jan 4, 2023 at 11:54 AM Nathan Chancellor wrote: > > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it > points out that KBUILD_AFLAGS contains a linker flag, which will be > used: > > clang: error: -Wl,-a32: 'linker' input unused >

Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling

2023-01-09 Thread Stephen Kitt
Hi Sam, On Sun, 8 Jan 2023 21:24:20 +0100, Sam Ravnborg wrote: > > Here are my pending patches from last June on lore: > > > > All patches are handled I think except this: > > * https://lore.kernel.org/lkml/20220608205623.2106113-1-st...@sk2.org/ > > Can I ask you to drop the assignment

[PATCH 41/41] mm: replace rw_semaphore with atomic_t in vma_lock

2023-01-09 Thread Suren Baghdasaryan
rw_semaphore is a sizable structure of 40 bytes and consumes considerable space for each vm_area_struct. However vma_lock has two important specifics which can be used to replace rw_semaphore with a simpler structure: 1. Readers never wait. They try to take the vma_lock and fall back to mmap_lock

[PATCH 40/41] mm: separate vma->lock from vm_area_struct

2023-01-09 Thread Suren Baghdasaryan
vma->lock being part of the vm_area_struct causes performance regression during page faults because during contention its count and owner fields are constantly updated and having other parts of vm_area_struct used during page fault handling next to them causes constant cache line bouncing. Fix

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

2023-01-09 Thread Suren Baghdasaryan
call_rcu() can take a long time when callback offloading is enabled. Its use in the vm_area_free can cause regressions in the exit path when multiple VMAs are being freed. To minimize that impact, place VMAs into a list and free them in groups using one call_rcu() call per group. Signed-off-by:

[PATCH 38/41] mm: avoid assertion in untrack_pfn

2023-01-09 Thread Suren Baghdasaryan
untrack_pfn can be called after VMA was isolated and mmap_lock downgraded. An attempt to lock affected VMA would cause an assertion, therefore use mod_vm_flags_nolock in such situations. Signed-off-by: Suren Baghdasaryan --- arch/x86/mm/pat/memtype.c | 10 +++--- include/linux/mm.h|

[PATCH 37/41] mm: introduce mod_vm_flags_nolock

2023-01-09 Thread Suren Baghdasaryan
In cases when VMA flags are modified after VMA was isolated and mmap_lock was downgraded, flags modifications do not require per-VMA locking and an attempt to lock the VMA would result in an assertion because mmap write lock is not held. Introduce mod_vm_flags_nolock to be used in such situation.

[PATCH 36/41] powerc/mm: try VMA lock-based page fault handling first

2023-01-09 Thread Suren Baghdasaryan
From: Laurent Dufour Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. Copied from "x86/mm: try VMA lock-based page fault handling first" Signed-off-by: Laurent Dufour Signed-off-by: Suren Baghdasaryan ---

[PATCH 35/41] arm64/mm: try VMA lock-based page fault handling first

2023-01-09 Thread Suren Baghdasaryan
Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. Signed-off-by: Suren Baghdasaryan --- arch/arm64/Kconfig| 1 + arch/arm64/mm/fault.c | 36 2 files changed, 37 insertions(+) diff

[PATCH 34/41] x86/mm: try VMA lock-based page fault handling first

2023-01-09 Thread Suren Baghdasaryan
Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. Signed-off-by: Suren Baghdasaryan --- arch/x86/Kconfig| 1 + arch/x86/mm/fault.c | 36 2 files changed, 37 insertions(+) diff --git

[PATCH 33/41] mm: introduce per-VMA lock statistics

2023-01-09 Thread Suren Baghdasaryan
Add a new CONFIG_PER_VMA_LOCK_STATS config option to dump extra statistics about handling page fault under VMA lock. Signed-off-by: Suren Baghdasaryan --- include/linux/vm_event_item.h | 6 ++ include/linux/vmstat.h| 6 ++ mm/Kconfig.debug | 8 mm/vmstat.c

[PATCH 32/41] mm: prevent userfaults to be handled under per-vma lock

2023-01-09 Thread Suren Baghdasaryan
Due to the possibility of handle_userfault dropping mmap_lock, avoid fault handling under VMA lock and retry holding mmap_lock. This can be handled more gracefully in the future. Signed-off-by: Suren Baghdasaryan Suggested-by: Peter Xu --- mm/memory.c | 7 +++ 1 file changed, 7

[PATCH 31/41] mm: prevent do_swap_page from handling page faults under VMA lock

2023-01-09 Thread Suren Baghdasaryan
Due to the possibility of do_swap_page dropping mmap_lock, abort fault handling under VMA lock and retry holding mmap_lock. This can be handled more gracefully in the future. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- mm/memory.c | 5 + 1 file changed, 5

[PATCH 30/41] mm: add FAULT_FLAG_VMA_LOCK flag

2023-01-09 Thread Suren Baghdasaryan
Add a new flag to distinguish page faults handled under protection of per-vma lock. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- include/linux/mm.h | 3 ++- include/linux/mm_types.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH 29/41] mm: fall back to mmap_lock if vma->anon_vma is not yet set

2023-01-09 Thread Suren Baghdasaryan
When vma->anon_vma is not set, pagefault 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 adjacent VMA and that requires not only the faulting VMA to be stable but also

[PATCH 28/41] mm: introduce lock_vma_under_rcu to be used from arch-specific code

2023-01-09 Thread Suren Baghdasaryan
Introduce lock_vma_under_rcu function to lookup and lock a VMA during page fault handling. When VMA is not found, can't be locked or changes after being locked, the function returns NULL. The lookup is performed under RCU protection to prevent the found VMA from being destroyed before the VMA lock

[PATCH 27/41] mm/mmap: prevent pagefault handler from racing with mmu_notifier registration

2023-01-09 Thread Suren Baghdasaryan
Page fault handlers might need to fire MMU notifications while a new notifier is being registered. Modify mm_take_all_locks to write-lock all VMAs and prevent this race with fault handlers that would hold VMA locks. VMAs are locked before i_mmap_rwsem and anon_vma to keep the same locking order as

[PATCH 26/41] kernel/fork: assert no VMA readers during its destruction

2023-01-09 Thread Suren Baghdasaryan
Assert there are no holders of VMA lock for reading when it is about to be destroyed. Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 8 kernel/fork.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index

[PATCH 25/41] mm/mmap: write-lock adjacent VMAs if they can grow into unmapped area

2023-01-09 Thread Suren Baghdasaryan
While unmapping VMAs, adjacent VMAs might be able to grow into the area being unmapped. In such cases write-lock adjacent VMAs to prevent this growth. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c

[PATCH 24/41] mm: conditionally write-lock VMA in free_pgtables

2023-01-09 Thread Suren Baghdasaryan
Normally free_pgtables needs to lock affected VMAs except for the case when VMAs were isolated under VMA write-lock. munmap() does just that, isolating while holding appropriate locks and then downgrading mmap_lock and dropping per-VMA locks before freeing page tables. Add a parameter to

[PATCH 23/41] mm: write-lock VMAs before removing them from VMA tree

2023-01-09 Thread Suren Baghdasaryan
Write-locking VMAs before isolating them ensures that page fault handlers don't operate on isolated VMAs. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 2 ++ mm/nommu.c | 5 + 2 files changed, 7 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index da1908730828..be289e0b693b 100644

[PATCH 22/41] mm/mremap: write-lock VMA while remapping it to a new address range

2023-01-09 Thread Suren Baghdasaryan
Write-lock VMA as locked before copying it and when copy_vma produces a new VMA. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- mm/mmap.c | 1 + mm/mremap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index ff02cb51e7e7..da1908730828 100644

[PATCH 21/41] mm/mmap: write-lock VMAs affected by VMA expansion

2023-01-09 Thread Suren Baghdasaryan
vma_expand changes VMA boundaries and might result in freeing an adjacent VMA. Write-lock affected VMAs to prevent concurrent page faults. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 1e2154137631..ff02cb51e7e7

[PATCH 20/41] mm/mmap: write-lock VMAs in vma_adjust

2023-01-09 Thread Suren Baghdasaryan
vma_adjust modifies a VMA and possibly its neighbors. Write-lock them before making the modifications. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index f6ca4a87f9e2..1e2154137631

[PATCH 19/41] mm/mmap: write-lock VMAs before merging, splitting or expanding them

2023-01-09 Thread Suren Baghdasaryan
Decisions about whether VMAs can be merged, split or expanded must be made while VMAs are protected from the changes which can affect that decision. For example, merge_vma uses vma->anon_vma in its decision whether the VMA can be merged. Meanwhile, page fault handler changes vma->anon_vma during

[PATCH 18/41] mm/khugepaged: write-lock VMA while collapsing a huge page

2023-01-09 Thread Suren Baghdasaryan
Protect VMA from concurrent page fault handler while collapsing a huge page. Page fault handler needs a stable PMD to use PTL and relies on per-VMA lock to prevent concurrent PMD changes. pmdp_collapse_flush(), set_huge_pmd() and collapse_and_free_pmd() can modify a PMD, which will not be detected

[PATCH 17/41] mm/mmap: move VMA locking before anon_vma_lock_write call

2023-01-09 Thread Suren Baghdasaryan
Move VMA flag modification (which now implies VMA locking) before anon_vma_lock_write to match the locking order of page fault handler. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index

[PATCH 16/41] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-09 Thread Suren Baghdasaryan
Replace indirect modifications to vma->vm_flags with calls to modifier functions to be able to track flag changes and to keep vma locking correctness. Add a BUG_ON check in ksm_madvise() to catch indirect vm_flags modification attempts. Signed-off-by: Suren Baghdasaryan ---

[PATCH 15/41] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-09 Thread Suren Baghdasaryan
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 --- arch/arm/kernel/process.c | 2 +- arch/ia64/mm/init.c

[PATCH 14/41] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-09 Thread Suren Baghdasaryan
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 --- include/linux/mm.h | 4 ++-- kernel/fork.c | 2 +- mm/hugetlb.c | 4 ++-- mm/mlock.c | 6 +++--- mm/mmap.c

[PATCH 13/41] mm: introduce vma->vm_flags modifier functions

2023-01-09 Thread Suren Baghdasaryan
To keep vma locking correctness when vm_flags are modified, add modifier functions to be used whenever flags are updated. Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 38 ++ include/linux/mm_types.h | 8 +++- 2 files changed, 45

[PATCH 12/41] mm: add per-VMA lock and helper functions to control it

2023-01-09 Thread Suren Baghdasaryan
Introduce a per-VMA rw_semaphore to be used during page fault handling instead of mmap_lock. Because there are cases when multiple VMAs need to be exclusively locked during VMA tree modifications, instead of the usual lock/unlock patter we mark a VMA as locked by taking per-VMA lock exclusively

[PATCH 11/41] mm: export dump_mm()

2023-01-09 Thread Suren Baghdasaryan
mmap_assert_write_locked() will be used in the next patch to ensure vma write lock is taken only under mmap_lock exclusive lock. Because mmap_assert_write_locked() uses dump_mm() and there are cases when vma write lock is taken from inside a module, it's necessary to export dump_mm() function.

[PATCH 10/41] mm: move mmap_lock assert function definitions

2023-01-09 Thread Suren Baghdasaryan
Move mmap_lock assert function definitions up so that they can be used by other mmap_lock routines. Signed-off-by: Suren Baghdasaryan --- include/linux/mmap_lock.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/mmap_lock.h

[PATCH 09/41] mm: rcu safe VMA freeing

2023-01-09 Thread Suren Baghdasaryan
From: Michel Lespinasse This prepares for page faults handling under VMA lock, looking up VMAs under protection of an rcu read lock, instead of the usual mmap read lock. Signed-off-by: Michel Lespinasse Signed-off-by: Suren Baghdasaryan --- include/linux/mm_types.h | 13 ++---

[PATCH 08/41] mm: introduce CONFIG_PER_VMA_LOCK

2023-01-09 Thread Suren Baghdasaryan
This configuration variable will be used to build the support for VMA locking during page fault handling. This is enabled by default on supported architectures with SMP and MMU set. The architecture support is needed since the page fault handler is called from the architecture's page faulting

[PATCH 07/41] mm: Enable maple tree RCU mode by default.

2023-01-09 Thread Suren Baghdasaryan
From: "Liam R. Howlett" Use the maple tree in RCU mode for VMA tracking. This is necessary for the use of per-VMA locking. RCU mode is enabled by default but disabled when exiting an mm and for the new tree during a fork. Also enable RCU for the tree used in munmap operations to ensure the

[PATCH 06/41] maple_tree: Add smp_rmb() to dead node detection

2023-01-09 Thread Suren Baghdasaryan
From: "Liam R. Howlett" Add an smp_rmb() before reading the parent pointer to ensure that anything read from the node prior to the parent pointer hasn't been reordered ahead of this check. The is necessary for RCU mode. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by:

[PATCH 05/41] maple_tree: Fix write memory barrier of nodes once dead for RCU mode

2023-01-09 Thread Suren Baghdasaryan
From: "Liam R. Howlett" During the development of the maple tree, the strategy of freeing multiple nodes changed and, in the process, the pivots were reused to store pointers to dead nodes. To ensure the readers see accurate pivots, the writers need to mark the nodes as dead and call smp_wmb()

[PATCH 04/41] maple_tree: remove extra smp_wmb() from mas_dead_leaves()

2023-01-09 Thread Suren Baghdasaryan
From: Liam Howlett The call to mte_set_dead_node() before the smp_wmb() already calls smp_wmb() so this is not needed. This is an optimization for the RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam Howlett Signed-off-by: Suren

[PATCH 03/41] maple_tree: Fix freeing of nodes in rcu mode

2023-01-09 Thread Suren Baghdasaryan
From: Liam Howlett The walk to destroy the nodes was not always setting the node type and would result in a destroy method potentially using the values as nodes. Avoid this by setting the correct node types. This is necessary for the RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple

[PATCH 02/41] maple_tree: Detect dead nodes in mas_start()

2023-01-09 Thread Suren Baghdasaryan
From: Liam Howlett When initially starting a search, the root node may already be in the process of being replaced in RCU mode. Detect and restart the walk if this is the case. This is necessary for RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure")

[PATCH 00/41] Per-VMA locks

2023-01-09 Thread Suren Baghdasaryan
This is the v1 of per-VMA locks patchset originally posted as an RFC at [1] and described in LWN article at [2]. Per-vma locks idea that was discussed during SPF [3] discussion at LSF/MM this year [4], which concluded with suggestion that “a reader/writer semaphore could be put into the VMA

[PATCH 01/41] maple_tree: Be more cautious about dead nodes

2023-01-09 Thread Suren Baghdasaryan
From: Liam Howlett ma_pivots() and ma_data_end() may be called with a dead node. Ensure to that the node isn't dead before using the returned values. This is necessary for RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam Howlett

Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling

2023-01-09 Thread Helge Deller
On 1/9/23 21:18, Stephen Kitt wrote: On Sun, 8 Jan 2023 18:26:12 +0100, Helge Deller wrote: On 1/7/23 21:53, Sam Ravnborg wrote: Hi Stephen. On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint wrote: From:

Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling

2023-01-09 Thread Stephen Kitt
On Sun, 8 Jan 2023 18:26:12 +0100, Helge Deller wrote: > On 1/7/23 21:53, Sam Ravnborg wrote: > > Hi Stephen. > > > > On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote: > >> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint > >> wrote: > >>> From: Sam

Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling

2023-01-09 Thread Stephen Kitt
On Mon, 9 Jan 2023 20:53:44 +0100, Stephen Kitt wrote: > On Sun, 8 Jan 2023 21:24:20 +0100, Sam Ravnborg wrote: > > > Here are my pending patches from last June on lore: > > > > > > > All patches are handled I think except this: > > > *

Re: [PATCH v3 3/8] sched, smp: Trace IPIs sent via send_call_function_single_ipi()

2023-01-09 Thread Valentin Schneider
On 07/01/23 12:04, Ingo Molnar wrote: > * Valentin Schneider wrote: > >> send_call_function_single_ipi() is the thing that sends IPIs at the bottom >> of smp_call_function*() via either generic_exec_single() or >> smp_call_function_many_cond(). Give it an IPI-related tracepoint. >> >> Note that

Re: [PATCH v3 6/8] treewide: Trace IPIs sent via smp_send_reschedule()

2023-01-09 Thread Valentin Schneider
On 08/01/23 20:17, Huacai Chen wrote: > Hi, Valentin, > > On Fri, Dec 2, 2022 at 11:59 PM Valentin Schneider > wrote: >> @@ -83,7 +83,7 @@ extern void show_ipi_list(struct seq_file *p, int prec); >> * it goes straight through and wastes no time serializing >> * anything. Worst case is that

Re: [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness()

2023-01-09 Thread Sam Ravnborg
Hi Christophe, On Mon, Jan 09, 2023 at 05:44:46PM +, Christophe Leroy wrote: > > > Le 07/01/2023 à 19:26, Sam Ravnborg via B4 Submission Endpoint a écrit : > > From: Sam Ravnborg > > > > Introduce backlight_get_brightness() to simplify logic > > and avoid direct access to backlight

Re: [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness()

2023-01-09 Thread Christophe Leroy
Le 07/01/2023 à 19:26, Sam Ravnborg via B4 Submission Endpoint a écrit : > From: Sam Ravnborg > > Introduce backlight_get_brightness() to simplify logic > and avoid direct access to backlight properties. When I read 'introduce' I understand that you are adding a new function. In fact

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

2023-01-09 Thread Christophe Leroy
Le 03/01/2023 à 18:51, Geoff Levand a écrit : > Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate > CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() > to be called. Change the panic statment in ps3_hpte_updateboltedpp() > to a pr_info statement so that

Re: [PATCH] objtool: continue if find_insn() fails in decode_instructions()

2023-01-09 Thread Sathvika Vasireddy
On 09/01/23 22:23, Ingo Molnar wrote: * Sathvika Vasireddy wrote: Hi Ingo, Happy New Year! Happy New Year to you too! :-) On 07/01/23 15:51, Ingo Molnar wrote: * Sathvika Vasireddy wrote: Currently, decode_instructions() is failing if it is not able to find instruction, and this is

Re: [PATCH v7 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2023-01-09 Thread Catalin Marinas
On Sun, Jan 08, 2023 at 06:48:41PM +0800, Barry Song wrote: > On Fri, Jan 6, 2023 at 2:15 AM Catalin Marinas > wrote: > > On Thu, Nov 17, 2022 at 04:26:48PM +0800, Yicong Yang wrote: > > > It is tested on 4,8,128 CPU platforms and shows to be beneficial on > > > large systems but may not have

Re: [PATCH] objtool: continue if find_insn() fails in decode_instructions()

2023-01-09 Thread Ingo Molnar
* Sathvika Vasireddy wrote: > Hi Ingo, Happy New Year! Happy New Year to you too! :-) > On 07/01/23 15:51, Ingo Molnar wrote: > > * Sathvika Vasireddy wrote: > > > > > Currently, decode_instructions() is failing if it is not able to find > > > instruction, and this is happening since

Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property

2023-01-09 Thread Sam Ravnborg
Hi Daniel. On Mon, Jan 09, 2023 at 11:06:35AM +, Daniel Thompson wrote: > On Sat, Jan 07, 2023 at 07:26:29PM +0100, Sam Ravnborg via B4 Submission > Endpoint wrote: > > From: Sam Ravnborg > > > > With all users gone remove the deprecated fb_blank member in > > backlight_properties. > > > >

Re: [PATCH] net-wan: Add check for NULL for utdm in ucc_hdlc_probe

2023-01-09 Thread Christophe Leroy
Le 23/12/2022 à 15:32, Ekaterina Esina a écrit : > [Vous ne recevez pas souvent de courriers de ees...@astralinux.ru. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > If uhdlc_priv_tsa != 1 then utdm is not initialized. > And if ret != NULL then

RE: [PATCH 1/1] PCI: layerscape: Add EP mode support for ls1028a

2023-01-09 Thread Frank Li
> > From: Xiaowei Bao > > Add PCIe EP mode support for ls1028a. > > Signed-off-by: Xiaowei Bao > Signed-off-by: Hou Zhiqiang > --- > > All other patches were already accepte by maintainer in > https://lore.kernel.org/lkml/2022223457.10599-1-leoyang...@nxp.com/ > > But missed this one.

Re: [Skiboot] [PATCH 1/3] core/device: Add function to return child node using name and length

2023-01-09 Thread Dan Horák
Hi Athira, On Thu, 5 Jan 2023 12:41:33 +0530 Athira Rajeev wrote: > > > > On 05-Jan-2023, at 12:35 PM, Madhavan Srinivasan > > wrote: > > > > > > On Mon, 2 Jan 2023 08:45:22 +0530 > > Athira Rajeev wrote: > > > >> Add a function dt_find_by_name_len() that returns the child node if > >>

Re: [PATCH 2/2] perf test bpf: Skip test if kernel-debuginfo is not present

2023-01-09 Thread Athira Rajeev
> On 05-Jan-2023, at 6:24 PM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Jan 05, 2023 at 05:47:42PM +0530, Athira Rajeev escreveu: >> Perf BPF filter test fails in environment where "kernel-debuginfo" >> is not installed. > > I'll apply this to perf/core, for the next merge window, as its

Re: [PATCH] tools/perf: Fix bpf-script-test-prologue test compile issue with clang

2023-01-09 Thread Athira Rajeev
> On 05-Jan-2023, at 6:23 PM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Jan 05, 2023 at 05:34:36PM +0530, Athira Rajeev escreveu: >> While running perf test for bpf, observed that "BPF prologue >> generation" test case fails to compile with clang. Logs below >> from powerpc: >> >> :33:2:

Re: [PATCH] objtool: continue if find_insn() fails in decode_instructions()

2023-01-09 Thread Sathvika Vasireddy
Hi Ingo, Happy New Year! On 07/01/23 15:51, Ingo Molnar wrote: * Sathvika Vasireddy wrote: Currently, decode_instructions() is failing if it is not able to find instruction, and this is happening since commit dbcdbdfdf137b4 ("objtool: Rework instruction -> symbol mapping") because it is

Re: [PATCH net-next] Remove DECnet support from kernel

2023-01-09 Thread Arnd Bergmann
On Mon, Jan 9, 2023, at 09:34, Jiri Slaby wrote: > On 09. 01. 23, 9:14, Jan Engelhardt wrote: >> On Monday 2023-01-09 08:04, Jiri Slaby wrote: > > Right, we used to keep providing also defines and structs in uapi > headers of removed functionality. So that the above socket would > compile, but

Re: [PATCH net-next] Remove DECnet support from kernel

2023-01-09 Thread Jiri Slaby
On 09. 01. 23, 9:14, Jan Engelhardt wrote: On Monday 2023-01-09 08:04, Jiri Slaby wrote: On 18. 08. 22, 2:43, Stephen Hemminger wrote: DECnet is an obsolete network protocol this breaks userspace. Some projects include linux/dn.h:

Re: [PATCH net-next] Remove DECnet support from kernel

2023-01-09 Thread Jan Engelhardt
On Monday 2023-01-09 08:04, Jiri Slaby wrote: > On 18. 08. 22, 2:43, Stephen Hemminger wrote: >> DECnet is an obsolete network protocol > > this breaks userspace. Some projects include linux/dn.h: > > https://codesearch.debian.net/search?q=include.*linux%2Fdn.h=0 > > I found Trinity fails to

Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()

2023-01-09 Thread Daniel Thompson
On Sun, Jan 08, 2023 at 09:29:43PM +0100, Sam Ravnborg wrote: > Hi Stephen, > > On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote: > > On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint > > wrote: > > > > > From: Sam Ravnborg > > > > > > Avoiding direct access

Re: [PATCH 10/15] staging: fbtft: core: Introduce backlight_is_blank()

2023-01-09 Thread Andy Shevchenko
On Sat, Jan 07, 2023 at 07:26:24PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg > > Avoiding direct access to backlight_properties.props. > > Access to the deprecated props.fb_blank replaced by backlight_is_blank(). > Access to props.power is dropped - it was only

Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()

2023-01-09 Thread Andy Shevchenko
On Sat, Jan 07, 2023 at 07:26:23PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg > > Avoiding direct access to backlight_properties.props. > > Access to the deprecated props.fb_blank replaced by backlight_is_blank(). > Access to props.power is dropped - it was only

Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property

2023-01-09 Thread Daniel Thompson
On Sat, Jan 07, 2023 at 07:26:29PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg > > With all users gone remove the deprecated fb_blank member in > backlight_properties. > > Signed-off-by: Sam Ravnborg > Cc: Lee Jones > Cc: Daniel Thompson > Cc: Jingoo Han

Re: [PATCH 14/15] backlight: tosa: Use backlight helper

2023-01-09 Thread Daniel Thompson
On Sat, Jan 07, 2023 at 07:26:28PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Stephen Kitt > > Instead of retrieving the backlight brightness in struct > backlight_properties manually, and then checking whether the backlight > should be on at all, use

Re: [PATCH 13/15] backlight: omap1: Use backlight helpers

2023-01-09 Thread Daniel Thompson
On Sat, Jan 07, 2023 at 07:26:27PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg > > Rework backlight handling to avoid access to the deprecated > backlight_properties.fb_blank member. > > The rework includes removal of get_brightness() operation, > because there was

[Bug 216095] sysfs: cannot create duplicate filename '/devices/platform/of-display'

2023-01-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216095 --- Comment #12 from Michal Suchánek (msucha...@suse.de) --- Thanks for the DT dumps. So you really do have two outputs but the problem is likely different: The hardware-specific driver gets initialized earlier, and then the offb/ofdrm driver

Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling

2023-01-09 Thread Jani Nikula
On Sat, 07 Jan 2023, Sam Ravnborg via B4 Submission Endpoint wrote: > From: Sam Ravnborg > > The atmel_lcdfb had code to save/restore power state. > This is not needed so drop it. > > Introduce backlight_is_brightness() to make logic simpler. backlight_is_brightness? BR, Jani. > >