ore robust guarantees.
Thoughts ?
Thanks,
Mathieu
The test never fails if only 1 core is available, in which case, we
cannot test anything as the only available mm_cid is 0.
Reviewed-by: Mathieu Desnoyers
Signed-off-by: Gabriele Monaco
---
tools/testing/selftests/rseq/.gitignore |
ead should see 0 as mm_cid, if that
doesn't happen, the compaction mechanism didn't work and the test fails.
The test never fails if only 1 core is available, in which case, we
cannot test anything as the only available mm_cid is 0.
To: Mathieu Desnoyers
Reviewed-by: Mathieu Desnoye
On 2025-01-15 12:57, Shuah Khan wrote:
On 1/14/25 17:45, Mathieu Desnoyers wrote:
On 2025-01-14 19:14, Shuah Khan wrote:
On 1/14/25 07:51, Mathieu Desnoyers wrote:
When porting librseq commit:
commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection")
from librseq to
On 2025-01-14 19:14, Shuah Khan wrote:
On 1/14/25 07:51, Mathieu Desnoyers wrote:
When porting librseq commit:
commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection")
from librseq to the kernel selftests, the following line was missed
at the end of rseq_init():
on")
Fixes: 73a4f5a704a2 ("selftests/rseq: Fix mm_cid test failure")
Signed-off-by: Mathieu Desnoyers
Cc: Raghavendra Rao Ananta
Cc: Shuah Khan
Cc: Peter Zijlstra
Cc: Boqun Feng
Cc: "Paul E. McKenney"
Cc: Carlos O'Donell
Cc: Florian Weimer
Cc: Michael Jeanson
On 2025-01-14 09:07, Mathieu Desnoyers wrote:
On 2025-01-13 18:06, Shuah Khan wrote:
On 12/10/24 15:44, Raghavendra Rao Ananta wrote:
Currently the rseq constructor, rseq_init(), assumes that glibc always
has the support for rseq symbols (__rseq_size for instance). However,
glibc supports rseq
atch. I need to review it carefully
to make sure it does not break anything else moving forward.
Please wait before merging.
Thanks,
Mathieu
thanks,
-- Shuah
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
quot; constraint.
I have compile tested this only for riscv. However, the same fixes I
use in the OpenRISC rseq selftests and everything passes with no issues.
Signed-off-by: Stafford Horne
Reviewed-by: Mathieu Desnoyers
---
tools/testing/selftests/rseq/rseq-riscv-bits.h | 6 +++---
tool
Linux: Linux buildroot 6.13.0-rc2-5-g1fa73dd6c2d3-dirty #213 SMP
Sat Dec 28 22:18:39 GMT 2024 openrisc GNU/Linux
Glibc: 2024-12-13 e4e49583d9 Stafford Horne or1k: Update
libm-test-ulps
Signed-off-by: Stafford Horne
Thanks!
Reviewed-by: Mathieu Desnoyers
---
tools
test_mm_cid_compaction();
+ if (rseq_unregister_current_thread()) {
+ fprintf(stderr,
+ "Error: rseq_unregister_current_thread(...) failed(%d):
%s\n",
+ errno, strerror(errno));
+ goto error;
+ }
+ return 0;
+
+error:
+ return -1;
+}
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
d_migrate_to(struct rq *dst_rq, struct
task_struct *t) { }
-static inline void task_tick_mm_cid(struct rq *rq, struct task_struct *curr) {
}
-static inline void init_sched_mm_cid(struct task_struct *t) { }
#endif /* !CONFIG_SCHED_MM_CID */
extern u64 avg_vruntime(struct cfs_rq *cfs_rq);
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
On 2024-12-13 04:54, Gabriele Monaco wrote:
From: Mathieu Desnoyers
When a process reduces its number of threads or clears bits in its CPU
affinity mask, the mm_cid allocation should eventually converge towards
smaller values.
I target v6.13 for this patch. As it fixes a commit which was
goto out;
/* Clear cids that were not recently used. */
for_each_possible_cpu(cpu)
sched_mm_cid_remote_clear_old(mm, cpu);
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
u(rhp, task_mm_cid_work);
}
void sched_mm_cid_exit_signals(struct task_struct *t)
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
d field support")
Signed-off-by: Mathieu Desnoyers
Cc: Peter Zijlstra
CC: Boqun Feng
CC: "Paul E. McKenney"
Cc: Shuah Khan
CC: Carlos O'Donell
CC: Florian Weimer
CC: linux-kselft...@vger.kernel.org
CC: sta...@vger.kernel.org
---
tools/testing/selftests/rseq/rseq.c | 110
On 2024-10-08 15:50, Mathieu Desnoyers wrote:
[...]
+/* Retire the protected hazard pointer from @slot. */
+static inline
+void hazptr_retire(struct hazptr_slot *slot, void *addr)
+{
+ WARN_ON_ONCE(slot->addr != addr);
+ smp_store_release(&slot->addr, NULL);
+}
Actually,
kernel.org/lkml/j3scdl5iymjlxavomgc6u5ndg3svhab6ga23dr36o4f5mt333w@7xslvq6b6hmv/
Link: https://lpc.events/event/18/contributions/1731/
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
Cc: "Paul E. McKenney"
: 96
Socket(s):2
Stepping: 1
Frequency boost: enabled
CPU(s) scaling MHz: 100%
CPU max MHz: 3709.
CPU min MHz: 400.
BogoMIPS: 4799.75
Memory: 768 GB ram.
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas
which depend on @a before loading @a.
The same logic applies with @a and @b swapped.
Suggested-by: Linus Torvalds
Suggested-by: Boqun Feng
Signed-off-by: Mathieu Desnoyers
Reviewed-by: Boqun Feng
Reviewed-by: Joel Fernandes (Google)
Tested-by: Joel Fernandes (Google)
Acked-by: "P
96 +21%
192 +28%
384+4%
768-0.6%
This series applies on top of v6.11.1.
Signed-off-by: Mathieu Desnoyers
Cc: Linus Torvalds
Cc: Andrew Morton
Cc: Peter Zijlstra
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartma
Refer to ptr_eq() in the rcu_dereference() documentation.
ptr_eq() is a mechanism that preserves address dependencies when
comparing pointers, and should be favored when comparing a pointer
obtained from rcu_dereference() against another pointer.
Signed-off-by: Mathieu Desnoyers
Acked-by: Alan
On 2024-10-07 21:06, Paul E. McKenney wrote:
On Mon, Oct 07, 2024 at 11:18:14AM -0700, Paul E. McKenney wrote:
On Mon, Oct 07, 2024 at 10:50:46AM -0400, Mathieu Desnoyers wrote:
On 2024-10-07 12:40, Peter Zijlstra wrote:
On Sat, Oct 05, 2024 at 02:50:17PM -0400, Mathieu Desnoyers wrote:
On
On 2024-10-07 15:47, Boqun Feng wrote:
On Thu, Oct 03, 2024 at 09:30:53AM -0400, Mathieu Desnoyers wrote:
[...]
+ /*
+* Use RCU dereference without lockdep checks, because
+* lockdep is not aware of HP guarantees.
+*/
+ addr2 = rcu_access_pointer(*addr_p
On 2024-10-07 12:40, Peter Zijlstra wrote:
On Sat, Oct 05, 2024 at 02:50:17PM -0400, Mathieu Desnoyers wrote:
On 2024-10-05 18:04, Peter Zijlstra wrote:
+/*
+ * hp_allocate: Allocate a hazard pointer.
+ *
+ * Allocate a hazard pointer slot for @addr. The object existence should
+ * be
On 2024-10-07 12:42, Peter Zijlstra wrote:
On Sat, Oct 05, 2024 at 02:56:26PM -0400, Mathieu Desnoyers wrote:
On 2024-10-05 18:07, Peter Zijlstra wrote:
On Sat, Oct 05, 2024 at 06:04:44PM +0200, Peter Zijlstra wrote:
On Fri, Oct 04, 2024 at 02:27:33PM -0400, Mathieu Desnoyers wrote:
+void
On 2024-10-07 15:18, David Laight wrote:
From: Jonas Oberhauser
Sent: 07 October 2024 12:55
Am 10/3/2024 um 3:23 PM schrieb Mathieu Desnoyers:
What _does_ work however are the following two approaches:
1) Perform the equality check on the original variables, creating
new versions (with
On 2024-10-05 18:07, Peter Zijlstra wrote:
On Sat, Oct 05, 2024 at 06:04:44PM +0200, Peter Zijlstra wrote:
On Fri, Oct 04, 2024 at 02:27:33PM -0400, Mathieu Desnoyers wrote:
+void hp_scan(struct hp_slot __percpu *percpu_slots, void *addr,
+void (*retire_cb)(int cpu, struct
On 2024-10-05 18:04, Peter Zijlstra wrote:
On Fri, Oct 04, 2024 at 02:27:33PM -0400, Mathieu Desnoyers wrote:
include/linux/hp.h | 158 +
kernel/Makefile| 2 +-
kernel/hp.c| 46 +
3 files changed, 205 insertions(+), 1
On 2024-10-04 23:25, Joel Fernandes wrote:
On Fri, Oct 4, 2024 at 2:29 PM Mathieu Desnoyers
wrote:
This API provides existence guarantees of objects through Hazard
Pointers (HP). This minimalist implementation is specific to use
with preemption disabled, but can be extended further as needed
On 2024-10-05 13:19, Frederic Weisbecker wrote:
Le Fri, Oct 04, 2024 at 02:27:33PM -0400, Mathieu Desnoyers a écrit :
+void hp_scan(struct hp_slot __percpu *percpu_slots, void *addr,
+void (*retire_cb)(int cpu, struct hp_slot *slot, void *addr))
+{
+ int cpu
Refer to ptr_eq() in the rcu_dereference() documentation.
ptr_eq() is a mechanism that preserves address dependencies when
comparing pointers, and should be favored when comparing a pointer
obtained from rcu_dereference() against another pointer.
Signed-off-by: Mathieu Desnoyers
Acked-by: Alan
: 96
Socket(s):2
Stepping: 1
Frequency boost: enabled
CPU(s) scaling MHz: 100%
CPU max MHz: 3709.
CPU min MHz: 400.
BogoMIPS: 4799.75
Memory: 768 GB ram.
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas
l.org/lkml/j3scdl5iymjlxavomgc6u5ndg3svhab6ga23dr36o4f5mt333w@7xslvq6b6hmv/
Link: https://lpc.events/event/18/contributions/1731/
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
Cc: "Paul E. McKenney"
Cc: Will Deacon
which depend on @a before loading @a.
The same logic applies with @a and @b swapped.
Suggested-by: Linus Torvalds
Suggested-by: Boqun Feng
Signed-off-by: Mathieu Desnoyers
Reviewed-by: Boqun Feng
Reviewed-by: Joel Fernandes (Google)
Tested-by: Joel Fernandes (Google)
Acked-by: "P
0.6%
This series applies on top of v6.11.1.
Signed-off-by: Mathieu Desnoyers
Cc: Linus Torvalds
Cc: Andrew Morton
Cc: Peter Zijlstra
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
Cc: "Paul E. McKenney"
Cc: Will Deacon
Cc: Alan Stern
then the compiler can't possibly reverse the asm blocks.
Indeed.
Thanks,
Mathieu
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT,
UK
Registration No: 1397386 (Wales)
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
On 2024-10-03 02:08, Joel Fernandes wrote:
On Tue, Oct 01, 2024 at 09:02:02PM -0400, Mathieu Desnoyers wrote:
Compiler CSE and SSA GVN optimizations can cause the address dependency
of addresses returned by rcu_dereference to be lost when comparing those
pointers with either constants or
On 2024-10-03 02:24, Boqun Feng wrote:
On Tue, Oct 01, 2024 at 09:02:04PM -0400, Mathieu Desnoyers wrote:
[...]
+/*
+ * hp_allocate: Allocate a hazard pointer.
+ *
+ * Allocate a hazard pointer slot for @addr. The object existence should
+ * be guaranteed by the caller.
+ *
+ * Returns a
Alan
Possibly something like:
c = b;
OPTIMISER_HIDE_VAR(c);
if (a == c) {
*b
will ensure that there isn't a speculative load from *a.
You'll get at least one register-register move - but they are safe.
Otherwise you'll need to put the condition inside an asm block.
David
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
On 2024-10-02 17:58, Jens Axboe wrote:
On 10/2/24 9:53 AM, Mathieu Desnoyers wrote:
On 2024-10-02 17:36, Mathieu Desnoyers wrote:
On 2024-10-02 17:33, Matthew Wilcox wrote:
On Wed, Oct 02, 2024 at 11:26:27AM -0400, Mathieu Desnoyers wrote:
On 2024-10-02 16:09, Paul E. McKenney wrote:
On Tue
On 2024-10-02 17:33, Matthew Wilcox wrote:
On Wed, Oct 02, 2024 at 11:26:27AM -0400, Mathieu Desnoyers wrote:
On 2024-10-02 16:09, Paul E. McKenney wrote:
On Tue, Oct 01, 2024 at 09:02:01PM -0400, Mathieu Desnoyers wrote:
Hazard pointers appear to be a good fit for replacing refcount based
On 2024-10-02 16:09, Paul E. McKenney wrote:
On Tue, Oct 01, 2024 at 09:02:01PM -0400, Mathieu Desnoyers wrote:
Hazard pointers appear to be a good fit for replacing refcount based lazy
active mm tracking.
Highlight:
will-it-scale context_switch1_threads
nr threads (-t) speedup
24
Refer to ptr_eq() in the rcu_dereference() documentation.
ptr_eq() is a mechanism that preserves address dependencies when
comparing pointers, and should be favored when comparing a pointer
obtained from rcu_dereference() against another pointer.
Signed-off-by: Mathieu Desnoyers
Acked-by: Alan
31/
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
Cc: "Paul E. McKenney"
Cc: Will Deacon
Cc: Peter Zijlstra
Cc: Boqun Feng
Cc: Alan Stern
Cc: John Stultz
Cc: Neeraj Upadhyay
Cc: Linus Torvalds
C
o see what the build bots have to say about this.
This series applies on top of v6.11.1.
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
Cc: "Paul E. McKenney"
Cc: Will Deacon
Cc: Boqun Feng
Cc: Alan
: 400.
BogoMIPS: 4799.75
Memory: 768 GB ram.
Signed-off-by: Mathieu Desnoyers
Cc: Nicholas Piggin
Cc: Michael Ellerman
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
Cc: "Paul E. McKenney"
Cc: Will Deacon
Cc: Peter Zijlstra
Cc: Boqun Feng
Cc: Alan Stern
Cc: J
which depend on @a before loading @a.
The same logic applies with @a and @b swapped.
Suggested-by: Linus Torvalds
Suggested-by: Boqun Feng
Signed-off-by: Mathieu Desnoyers
Reviewed-by: Boqun Feng
Acked-by: "Paul E. McKenney"
Acked-by: Alan Stern
Cc: Greg Kroah-Hartman
Cc: Sebasti
On 2024-09-29 17:51, Paul E. McKenney wrote:
On Sun, Sep 29, 2024 at 07:16:08AM -0400, Mathieu Desnoyers wrote:
Refer to ptr_eq() in the rcu_dereference() documentation.
ptr_eq() is a mechanism that preserves address dependencies when
comparing pointers, and should be favored when comparing a
Refer to ptr_eq() in the rcu_dereference() documentation.
ptr_eq() is a mechanism that preserves address dependencies when
comparing pointers, and should be favored when comparing a pointer
obtained from rcu_dereference() against another pointer.
Signed-off-by: Mathieu Desnoyers
Cc: Greg Kroah
which depend on @a before loading @a.
The same logic applies with @a and @b swapped.
Suggested-by: Linus Torvalds
Suggested-by: Boqun Feng
Signed-off-by: Mathieu Desnoyers
Reviewed-by: Boqun Feng
Acked-by: "Paul E. McKenney"
Cc: Greg Kroah-Hartman
Cc: Sebastian Andrzej Siewior
C
Cc: Mark Rutland
Cc: Thomas Gleixner
Cc: Vlastimil Babka
Cc: maged.mich...@gmail.com
Cc: Mateusz Guzik
Cc: Gary Guo
Cc: Jonas Oberhauser
Cc: r...@vger.kernel.org
Cc: linux...@kvack.org
Cc: l...@lists.linux.dev
Cc: Nikita Popov
Cc: l...@lists.linux.dev
Mathieu Desnoyers (2):
compiler.h: Introd
On 2024-09-29 01:24, Gary Guo wrote:
Cc: Nikita Popov
Cc: l...@lists.linux.dev
On Sat, 28 Sep 2024 09:51:27 -0400
Mathieu Desnoyers wrote:
Compiler CSE and SSA GVN optimizations can cause the address dependency
of addresses returned by rcu_dereference to be lost when comparing those
On 2024-09-28 17:49, Alan Stern wrote:
On Sat, Sep 28, 2024 at 11:32:18AM -0400, Mathieu Desnoyers wrote:
On 2024-09-28 16:49, Alan Stern wrote:
On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote:
equality, which does not preserve address dependencies and allows the
following
On 2024-09-28 16:49, Alan Stern wrote:
On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote:
Compiler CSE and SSA GVN optimizations can cause the address dependency
of addresses returned by rcu_dereference to be lost when comparing those
pointers with either constants or previously
On 2024-09-28 16:49, Alan Stern wrote:
On Sat, Sep 28, 2024 at 09:51:27AM -0400, Mathieu Desnoyers wrote:
[...]
+/*
+ * Compare two addresses while preserving the address dependencies for
+ * later use of the address. It should be used when comparing an address
+ * returned by rcu_dereference
On 2024-09-28 16:58, Alan Stern wrote:
On Sat, Sep 28, 2024 at 09:51:28AM -0400, Mathieu Desnoyers wrote:
[...]
-- Be very careful about comparing pointers obtained from
- rcu_dereference() against non-NULL values. As Linus Torvalds
- explained, if the two pointers are equal
d to speculate "ldr w0, [x1]" before
"ldr x2, [x0]".
Based on the RCU documentation, the control dependency does not prevent
the CPU from speculating loads.
Suggested-by: Linus Torvalds
Suggested-by: Boqun Feng
Signed-off-by: Mathieu Desnoyers
Reviewed-by: Boqun Feng
Acked-
Cc: Mark Rutland
Cc: Thomas Gleixner
Cc: Vlastimil Babka
Cc: maged.mich...@gmail.com
Cc: Mateusz Guzik
Cc: Gary Guo
Cc: Jonas Oberhauser
Cc: r...@vger.kernel.org
Cc: linux...@kvack.org
Cc: l...@lists.linux.dev
Mathieu Desnoyers (2):
compiler.h: Introduce ptr_eq() to preserve address
Refer to ptr_eq() in the rcu_dereference() documentation.
ptr_eq() is a mechanism that preserves address dependencies when
comparing pointers, and should be favored when comparing a pointer
obtained from rcu_dereference() against another pointer.
Signed-off-by: Mathieu Desnoyers
Cc: Greg Kroah
On 2024-09-28 13:22, Jonas Oberhauser wrote:
Two more questions below:
Am 9/21/2024 um 6:42 PM schrieb Mathieu Desnoyers:
+#define NR_PERCPU_SLOTS_BITS 3
Have you measured any advantage of this multi-slot version vs a version
with just one normal slot and one emergency slot?
No, I have
On 2024-09-27 22:33, Mathieu Desnoyers wrote:
[...]
---
include/linux/compiler.h | 62
1 file changed, 62 insertions(+)
I'm wondering if this really belongs in compiler.h, or if it's so
RCU/HP specific that it should be implemented in
d be discarded by further
optimization. I'm unsure what you are trying to achieve here.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
d to speculate "ldr w0, [x1]" before
"ldr x2, [x0]".
Based on the RCU documentation, the control dependency does not prevent
the CPU from speculating loads.
Suggested-by: Linus Torvalds
Suggested-by: Boqun Feng
Signed-off-by: Mathieu Desnoyers
Cc: Greg Kroah-Hartman
Cc: Sebastia
On 2024-09-27 20:13, Linus Torvalds wrote:
On Fri, 27 Sept 2024 at 10:53, Mathieu Desnoyers
wrote:
(b) the value barrier needs to be on *both* values so that the order
of the equality testing doesn't matter.
If we use OPTIMIZER_HIDE_VAR() on both parameters, it indeed minimizes
the
On 2024-09-27 19:23, Linus Torvalds wrote:
On Fri, 27 Sept 2024 at 10:17, Mathieu Desnoyers
wrote:
The barrier() is ineffective at fixing the issue.
It does not prevent the compiler CSE from losing the
address dependency:
Ok. Thanks for actually specifying code.
That needs to be
(a) in
uaranteeing
existence of first and second locks in traversal order,
allowing them to be locked in the correct order (which is
reverse from traversal order) rather than try-lock+retry on
nested lock. This can be done with hazard pointers without
requiring object reclaim to be delayed by an RCU grace period.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
On 2024-09-27 16:43, Mathieu Desnoyers wrote:
On 2024-09-27 12:59, Mathieu Desnoyers wrote:
On 2024-09-27 06:28, Boqun Feng wrote:
[...]
I replaced ADDRESS_EQ(a, b) with ADDRESS_EQ(b, a), and the compile
result shows it can prevent the issue:
I see, yes. It prevents the issue by making the
On 2024-09-27 12:59, Mathieu Desnoyers wrote:
On 2024-09-27 06:28, Boqun Feng wrote:
[...]
I replaced ADDRESS_EQ(a, b) with ADDRESS_EQ(b, a), and the compile
result shows it can prevent the issue:
I see, yes. It prevents the issue by making the compiler create
a copy of the value "mod
On 2024-09-27 06:28, Boqun Feng wrote:
On Fri, Sep 27, 2024 at 09:37:50AM +0800, Boqun Feng wrote:
On Fri, Sep 27, 2024, at 9:30 AM, Mathieu Desnoyers wrote:
On 2024-09-27 02:01, Boqun Feng wrote:
#define ADDRESS_EQ(var, expr
x0, x0, :lo12:.LANCHOR0
.L12:
ldr x1, [x0]
ldr x2, [x0]
cmp x1, x2
bne .L12
ldr w0, [x1]
ret
p:
.zero 8
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
]
ldrx9, [x8]
cmpx10, x9
b.ne 4 // b.any
ldrw0, [x9]
ret
fct_volatile_acquire:
adrp x8, 0
addx8, x8, #0x0
ldrx10, [x8]
ldar x9, [x8]
cmpx10, x9
b.ne 24 // b.any
ldrw0, [x9]
ret
fct_asm_compare:
adrp x8, 0
ldrx9, [x8]
ldrx8, [x8]
cmpx9, x8
b.ne 3c // b.any
ldrw0, [x8]
ret
main:
movw0, wzr
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
On 2024-09-25 15:20, Mathieu Desnoyers wrote:
[...]
static inline
bool same_ptr(void *a, void *b)
{
asm goto (
"cmpq %[a], %[b]\n\t"
"jne %l[ne]\n\t"
: : [a] "r" (a), [b] "r" (b)
: : ne);
return true;
On 2024-09-25 15:10, Mathieu Desnoyers wrote:
[...]
Cleaner without goto in the user code:
#include
#include
static inline
bool same_ptr(void *a, void *b)
{
asm goto (
"cmpq %[a], %[b]\n\t"
"jne %l[ne]\n\t"
: : [a] "r" (a), [b] "
On 2024-09-25 14:47, Mathieu Desnoyers wrote:
[...]
Like so:
#include
#define __str_1(x) #x
#define __str(x) __str_1(x)
/* x86-64 */
#define bne_ptr(_a, _b, _label) \
asm goto ( \
"cmpq %[a], %[b]\n\t" \
"jne %l[" __str(_label) "]\n\t&qu
On 2024-09-25 14:16, Boqun Feng wrote:
On Wed, Sep 25, 2024 at 01:59:06PM +0200, Mathieu Desnoyers wrote:
On 2024-09-25 12:45, Boqun Feng wrote:
On Wed, Sep 25, 2024 at 12:11:52PM +0200, Jonas Oberhauser wrote:
Am 9/25/2024 um 12:02 PM schrieb Boqun Feng:
Hi Jonas,
Of
course, if we are
an now be speculated, such that it might happen before the
rcu_dereference(). This could result in bugs due to misordering.
So I am not only concerned about compiler proofs here, as it appears
that the speculation done by the CPU can also cause issues on some
architectures.
Thanks,
On 2024-09-25 12:06, Jonas Oberhauser wrote:
Am 9/25/2024 um 8:35 AM schrieb Mathieu Desnoyers:
On 2024-09-25 07:57, Jonas Oberhauser wrote:
Hi Mathieu,
I haven't read your code in detail but it seems to me you have an ABA
bug: as I explained elsewhere, you could read the same po
ff --git a/src/hpref.c b/src/hpref.c
new file mode 100644
index ..f63530f5
--- /dev/null
+++ b/src/hpref.c
@@ -0,0 +1,78 @@
+// SPDX-FileCopyrightText: 2024 Mathieu Desnoyers
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
+/*
+ * HPREF: Hazard pointers with reference counters
+
lore.kernel.org/lkml/j3scdl5iymjlxavomgc6u5ndg3svhab6ga23dr36o4f5mt333w@7xslvq6b6hmv/
Link: https://lpc.events/event/18/contributions/1731/
Signed-off-by: Mathieu Desnoyers
Change-Id: I6369064a0e1a1f9632394df31ff41c76905d17e3
Cc: "Paul E. McKenney"
Cc: Will Deacon
Cc: Peter Zijlstra
Cc: Boqun Feng
Cc: Alan Ster
* emergency slot to transition to refcount.
+*/
+ caa_cpu_relax();
+ goto retry;
+ }
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
b6ga23dr36o4f5mt333w@7xslvq6b6hmv/
Link: https://lpc.events/event/18/contributions/1731/
Signed-off-by: Mathieu Desnoyers
Change-Id: I6369064a0e1a1f9632394df31ff41c76905d17e3
Cc: "Paul E. McKenney"
Cc: Will Deacon
Cc: Peter Zijlstra
Cc: Boqun Feng
Cc: Alan Stern
Cc: John Stultz
To: Neeraj Up
up readers.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
/20231002202531.3160-1-mathieu.desnoy...@efficios.com/
Co-developed-by: Michael Jeanson
Signed-off-by: Mathieu Desnoyers
Signed-off-by: Michael Jeanson
Reviewed-by: Masami Hiramatsu (Google)
Cc: Steven Rostedt
Cc: Masami Hiramatsu
Cc: Peter Zijlstra
Cc: Alexei Starovoitov
Cc: Yonghong Song
Cc: Paul E
.
This change does not yet allow perf to take page faults per se within
its probe, but allows its existing probes to connect to faultable
tracepoints.
Link:
https://lore.kernel.org/lkml/20231002202531.3160-1-mathieu.desnoy...@efficios.com/
Co-developed-by: Michael Jeanson
Signed-off-by: Mathieu
change does not yet allow bpf to take page faults per se within its
probe, but allows its existing probes to connect to faultable
tracepoints.
Link:
https://lore.kernel.org/lkml/20231002202531.3160-1-mathieu.desnoy...@efficios.com/
Co-developed-by: Michael Jeanson
Signed-off-by: Mathieu Desnoyers
: Michael Jeanson
Signed-off-by: Mathieu Desnoyers
Reviewed-by: Masami Hiramatsu (Google)
Cc: Steven Rostedt
Cc: Masami Hiramatsu
Cc: Peter Zijlstra
Cc: Alexei Starovoitov
Cc: Yonghong Song
Cc: Paul E. McKenney
Cc: Ingo Molnar
Cc: Arnaldo Carvalho de Melo
Cc: Mark Rutland
Cc: Alexander Shishkin
synchronize read-side
marshalling of the registered probes with respect to faultable probes
unregistration and teardown.
Link:
https://lore.kernel.org/lkml/20231002202531.3160-1-mathieu.desnoy...@efficios.com/
Co-developed-by: Michael Jeanson
Signed-off-by: Mathieu Desnoyers
Signed-off-by: Michael
-trace-ker...@vger.kernel.org
Mathieu Desnoyers (5):
tracing: Introduce faultable tracepoints
tracing/ftrace: Add support for faultable tracepoints
tracing/bpf-trace: Add support for faultable tracepoints
tracing/perf: Add support for faultable tracepoints
tracing: Convert sys_enter/exit to
ARD()" to actually
define a guard variable, rename all the guard "DEFINE_" prefix to
"DECLARE_".
Signed-off-by: Mathieu Desnoyers
Cc: Peter Zijlstra (Intel)
Cc: Ingo Molnar
---
crypto/asymmetric_keys/x509_parser.h | 4 +-
drivers/cxl/acpi.c
);
[...]
if (a) {
might_sleep();
activate_guard(preempt_notrace, myguard)();
}
[ protected code ]
}
Signed-off-by: Mathieu Desnoyers
Cc: Peter Zijlstra (Intel)
Cc: Ingo Molnar
Cc: Linus Torvalds
Cc: Kees Cook
Cc: Greg KH
Cc: Sean
ldo Carvalho de Melo
Cc: Mark Rutland
Cc: Alexander Shishkin
Cc: Namhyung Kim
Cc: b...@vger.kernel.org
Cc: Joel Fernandes
Cc: linux-trace-ker...@vger.kernel.org
Mathieu Desnoyers (2):
cleanup.h guard: Rename DEFINE_ prefix to DECLARE_
cleanup.h: Introduce DEFINE_INACTIVE_GUARD and activate_
On 2024-08-20 01:00, Steven Rostedt wrote:
On Thu, 27 Jun 2024 11:23:35 -0400
Mathieu Desnoyers wrote:
To cover scenarios where the scope of the guard differs from the scope
of its activation, introduce DEFINE_INACTIVE_GUARD() and activate_guard().
Here is an example use for a conditionally
On 2024-07-15 15:13, Steven Rostedt wrote:
On Mon, 15 Jul 2024 15:10:17 -0400
Mathieu Desnoyers wrote:
On 2024-07-15 14:47, Steven Rostedt wrote:
From: "Steven Rostedt (Google)"
Gone but never forgotten.
[ Also moved Daniel's name to be consistent with the alphabetical orde
e Oliveira
S:Maintained
F:Documentation/trace/hwlat_detector.rst
F:Documentation/trace/osnoise-tracer.rst
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
On 2024-07-02 12:51, Steven Rostedt wrote:
On Tue, 2 Jul 2024 11:32:53 -0400
Mathieu Desnoyers wrote:
If we use '*' for user events already, perhaps we'd want to consider
using the same range for the ring buffer ioctls ? Arguably one is
about instrumentation and the other is ab
On 2024-07-02 11:18, Steven Rostedt wrote:
On Tue, 2 Jul 2024 10:36:03 -0400
Mathieu Desnoyers wrote:
I can send a patch this week to update it. Or feel free to send a patch
yourself.
You need to reserve an unused ioctl Code and Seq# range within:
Documentation/userspace-api/ioctl/ioctl
ioctl Code and Seq# range within:
Documentation/userspace-api/ioctl/ioctl-number.rst
Otherwise this duplicate will confuse all system call instrumentation
tooling.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
/20231002202531.3160-1-mathieu.desnoy...@efficios.com/
Co-developed-by: Michael Jeanson
Signed-off-by: Mathieu Desnoyers
Signed-off-by: Michael Jeanson
Cc: Steven Rostedt
Cc: Masami Hiramatsu
Cc: Peter Zijlstra
Cc: Alexei Starovoitov
Cc: Yonghong Song
Cc: Paul E. McKenney
Cc: Ingo Molnar
Cc: Arnaldo
.
This change does not yet allow perf to take page faults per se within
its probe, but allows its existing probes to connect to faultable
tracepoints.
Link:
https://lore.kernel.org/lkml/20231002202531.3160-1-mathieu.desnoy...@efficios.com/
Co-developed-by: Michael Jeanson
Signed-off-by: Mathieu
: Michael Jeanson
Signed-off-by: Mathieu Desnoyers
Cc: Steven Rostedt
Cc: Masami Hiramatsu
Cc: Peter Zijlstra
Cc: Alexei Starovoitov
Cc: Yonghong Song
Cc: Paul E. McKenney
Cc: Ingo Molnar
Cc: Arnaldo Carvalho de Melo
Cc: Mark Rutland
Cc: Alexander Shishkin
Cc: Jiri Olsa
Cc: Namhyung Kim
Cc: b
1 - 100 of 2158 matches
Mail list logo