[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [v2 1/6] Port WARN_ON_ONCE() from Linux
- To: Jan Beulich <JBeulich@xxxxxxxx>, Julien Grall <julien.grall@xxxxxxx>
- From: Sameer Goel <sameer.goel@xxxxxxxxxx>
- Date: Thu, 24 May 2018 14:23:56 -0600
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Manish Jaggi <mjaggi@xxxxxxxxxxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian.Jackson@xxxxxxxxxx, nd@xxxxxxx, shankerd@xxxxxxxxxxxxxx, Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 24 May 2018 20:24:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 05/24/2018 01:53 AM, Jan Beulich wrote:
On 24.05.18 at 02:46, <sameer.goel@xxxxxxxxxx> wrote:
Port WARN_ON_ONCE macro from Linux.
In such a case you should justify adjustments you've made:
I can add more details, but have mostly just changed variable names. The
macro is self explanatory.
Should I just change this to: "Define WARN_ON_ONCE macro to mirror LInux
functionality"
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -11,6 +11,19 @@
#define BUG_ON(p) do { if (unlikely(p)) BUG(); } while (0)
#define WARN_ON(p) do { if (unlikely(p)) WARN(); } while (0)
+#define WARN_ON_ONCE(p) \
+({ \
+ static bool __section(".data.unlikely") warned; \
Linux uses .data.once. That or .data.cold would seem better to me than
.data.unlikely.
I guess there is not reason to keep this in a specific section. I'll
just go ahead and remove the section here?
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|