[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48992c9f-6c61-4716-977c-66e946adb399@efficios.com>
Date: Wed, 25 Sep 2024 15:10:11 +0200
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Jonas Oberhauser <jonas.oberhauser@...weicloud.com>,
linux-kernel@...r.kernel.org, rcu@...r.kernel.org, linux-mm@...ck.org,
lkmm@...ts.linux.dev, "Paul E. McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joel@...lfernandes.org>,
Josh Triplett <josh@...htriplett.org>, Uladzislau Rezki <urezki@...il.com>,
Steven Rostedt <rostedt@...dmis.org>, Lai Jiangshan
<jiangshanlai@...il.com>, Zqiang <qiang.zhang1211@...il.com>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>,
Mark Rutland <mark.rutland@....com>, Thomas Gleixner <tglx@...utronix.de>,
Kent Overstreet <kent.overstreet@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>, maged.michael@...il.com,
Neeraj Upadhyay <neeraj.upadhyay@....com>
Subject: Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard
pointers
On 2024-09-25 14:47, Mathieu Desnoyers wrote:
[...]
> Like so:
>
> #include <stdio.h>
>
> #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" \
> : : [a] "r" (_a), [b] "r" (_b) \
> : : _label)
>
> int x;
>
> int v[2];
>
> int main(void)
> {
> bne_ptr(v, v + 1, label_same);
> x = 1;
> label_same:
Note that this label should probably be called "label_ne".
I flipped the macro logic without changing the labels.
Thanks,
Mathieu
> printf("%d\n", x);
> return 0;
> }
>
>
>>
>> Regards,
>> Boqun
>>
>>> Thanks,
>>>
>>> Mathieu
>>>
>>>> Regards,
>>>> Boqun
>>>>
>>>>>
>>>>> Have fun,
>>>>> jonas
>>>>>
>>>
>>> --
>>> Mathieu Desnoyers
>>> EfficiOS Inc.
>>> https://www.efficios.com
>>>
>
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
Powered by blists - more mailing lists