[PATCH 0/5] uprobes: transition from kmap_atomic to kmap_local_page

Keke Ming posted 5 patches 1 month ago
arch/arm/probes/uprobes/core.c     |  4 ++--
arch/arm64/kernel/probes/uprobes.c |  4 ++--
arch/mips/kernel/uprobes.c         |  4 ++--
arch/riscv/kernel/probes/uprobes.c |  4 ++--
kernel/events/uprobes.c            | 12 ++++++------
5 files changed, 14 insertions(+), 14 deletions(-)
[PATCH 0/5] uprobes: transition from kmap_atomic to kmap_local_page
Posted by Keke Ming 1 month ago
The use of kmap_atomic/kunmap_atomic is deprecated. The purpose of
kmap-like functions is to create temporary mappings.

kmap_atomic() typically disables preemption, while kmap_local_page()
allows preemption.

According to the documentation, kmap_atomic() is primarily necessary
for contexts that cannot sleep.

> kmap_atomic() may also be used by interrupt contexts, since it does
> not sleep and the callers too may not sleep until after
> kunmap_atomic() is called.

> kunmap_atomic() may implicitly depend on the side effects of atomic
> mappings, i.e. disabling page faults or preemption, or both. In that
> case, explicit calls to pagefault_disable() or preempt_disable() or
> both must be made in conjunction with the use of kmap_local_page().

Link: https://docs.kernel.org/mm/highmem.html#temporary-virtual-mappings
Link: https://lwn.net/Articles/836144/

Keke Ming (5):
  riscv/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
  arm64/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
  mips/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
  arm/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
  uprobes: use kmap_local_page() for temporary page mappings

 arch/arm/probes/uprobes/core.c     |  4 ++--
 arch/arm64/kernel/probes/uprobes.c |  4 ++--
 arch/mips/kernel/uprobes.c         |  4 ++--
 arch/riscv/kernel/probes/uprobes.c |  4 ++--
 kernel/events/uprobes.c            | 12 ++++++------
 5 files changed, 14 insertions(+), 14 deletions(-)

-- 
2.43.0
Re: [PATCH 0/5] uprobes: transition from kmap_atomic to kmap_local_page
Posted by Oleg Nesterov 1 month ago
On 01/03, Keke Ming wrote:
>
> Keke Ming (5):
>   riscv/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
>   arm64/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
>   mips/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
>   arm/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
>   uprobes: use kmap_local_page() for temporary page mappings
>
>  arch/arm/probes/uprobes/core.c     |  4 ++--
>  arch/arm64/kernel/probes/uprobes.c |  4 ++--
>  arch/mips/kernel/uprobes.c         |  4 ++--
>  arch/riscv/kernel/probes/uprobes.c |  4 ++--
>  kernel/events/uprobes.c            | 12 ++++++------
>  5 files changed, 14 insertions(+), 14 deletions(-)

Thanks,

Acked-by: Oleg Nesterov <oleg@redhat.com>
Re: [PATCH 0/5] uprobes: transition from kmap_atomic to kmap_local_page
Posted by Peter Zijlstra 1 month ago
On Sat, Jan 03, 2026 at 11:56:35AM +0100, Oleg Nesterov wrote:
> On 01/03, Keke Ming wrote:
> >
> > Keke Ming (5):
> >   riscv/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
> >   arm64/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
> >   mips/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
> >   arm/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol()
> >   uprobes: use kmap_local_page() for temporary page mappings
> >
> >  arch/arm/probes/uprobes/core.c     |  4 ++--
> >  arch/arm64/kernel/probes/uprobes.c |  4 ++--
> >  arch/mips/kernel/uprobes.c         |  4 ++--
> >  arch/riscv/kernel/probes/uprobes.c |  4 ++--
> >  kernel/events/uprobes.c            | 12 ++++++------
> >  5 files changed, 14 insertions(+), 14 deletions(-)
> 
> Thanks,
> 
> Acked-by: Oleg Nesterov <oleg@redhat.com>

Let me go stick them in tip/perf/core