[PATCH] softirq: Reserve a bit in tasklet.state for the user

From: Chris Wilson
Date: Mon Jan 23 2017 - 10:33:30 EST


Allow the user to communicate with the tasklet through the atomic state
field by assigning a bit for their use. This can be used, for example,
to differentiate between a tasklet called following an irq or from
process context, where some hardware state may only be valid after the
irq.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: Hannes Reinecke <hare@xxxxxxxx>
Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: Chen Fan <chen.fan.fnst@xxxxxxxxxxxxxx>
Cc: Alexander Potapenko <glider@xxxxxxxxxx>
---
include/linux/interrupt.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 53144e78a369..ab321552089b 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -542,7 +542,8 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
enum
{
TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */
- TASKLET_STATE_RUN /* Tasklet is running (SMP only) */
+ TASKLET_STATE_RUN, /* Tasklet is running (SMP only) */
+ TASKLET_STATE_USER /* Reserved for use by the owner */
};

#ifdef CONFIG_SMP
--
2.11.0