Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-27 Thread Liao, Chang
在 2024/9/24 7:52, Andi Kleen 写道: >> Thanks for the suggestions, I will experiment with a read-write lock, >> meanwhile, >> adding the documentation and testing for the lockless scheme. > > Read-write locks are usually not worth it for short critical sections, > in fact they can be slower due t

Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-23 Thread Andi Kleen
> Thanks for the suggestions, I will experiment with a read-write lock, > meanwhile, > adding the documentation and testing for the lockless scheme. Read-write locks are usually not worth it for short critical sections, in fact they can be slower due to cache line effects. > Sorry, I may not pro

Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-23 Thread Liao, Chang
在 2024/9/19 21:34, Andi Kleen 写道: >> Sorry, I know nothing about the ThreadSanitizer and related annotation, >> could you provide some information about it, thanks. > > Documentation/dev-tools/kcsan.rst Thanks. > >>> Would be good to have some commentary why doing so >>> many write operation

Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-19 Thread Andi Kleen
> Sorry, I know nothing about the ThreadSanitizer and related annotation, > could you provide some information about it, thanks. Documentation/dev-tools/kcsan.rst > > Would be good to have some commentary why doing so > > many write operations with merely a rcu_read_lock as protection is safe. >

Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-19 Thread Liao, Chang
在 2024/9/18 20:25, Andi Kleen 写道: > Liao Chang writes: >> + >> +/* >> + * xol_recycle_insn_slot - recycle a slot from the garbage collection list. >> + */ >> +static int xol_recycle_insn_slot(struct xol_area *area) >> +{ >> +struct uprobe_task *utask; >> +int slot = UINSNS_PER_PAGE; >>

Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-18 Thread kernel test robot
tip/perf/core patch link: https://lore.kernel.org/r/20240918012752.2045713-1-liaochang1%40huawei.com patch subject: [PATCH] uprobes: Improve the usage of xol slots for better scalability config: arm-defconfig (https://download.01.org/0day-ci/archive/20240918/202409182246.umkgsmxl-...@intel.

Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-18 Thread Andi Kleen
Liao Chang writes: > + > +/* > + * xol_recycle_insn_slot - recycle a slot from the garbage collection list. > + */ > +static int xol_recycle_insn_slot(struct xol_area *area) > +{ > + struct uprobe_task *utask; > + int slot = UINSNS_PER_PAGE; > + > + rcu_read_lock(); > + list_for_ea

[PATCH] uprobes: Improve the usage of xol slots for better scalability

2024-09-17 Thread Liao Chang
The kprobe handler allocates xol slot from xol_area and quickly release it in the single-step handler. The atomic operations on the xol bitmap and slot_count lead to expensive cache line bouncing between multiple CPUs. Given the xol slot is on the hot path for kprobe and kretprobe handling, the pro