diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/lockdep.h | 20 | ||||
-rw-r--r-- | include/linux/sched.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index e1e0fcd99613..c75eedd55af5 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -284,6 +284,26 @@ struct held_lock { */ struct hist_lock { /* + * Id for each entry in the ring buffer. This is used to + * decide whether the ring buffer was overwritten or not. + * + * For example, + * + * |<----------- hist_lock ring buffer size ------->| + * pppppppppppppppppppppiiiiiiiiiiiiiiiiiiiiiiiiiiiii + * wrapped > iiiiiiiiiiiiiiiiiiiiiiiiiii....................... + * + * where 'p' represents an acquisition in process + * context, 'i' represents an acquisition in irq + * context. + * + * In this example, the ring buffer was overwritten by + * acquisitions in irq context, that should be detected on + * rollback or commit. + */ + unsigned int hist_id; + + /* * Seperate stack_trace data. This will be used at commit step. */ struct stack_trace trace; diff --git a/include/linux/sched.h b/include/linux/sched.h index 5235fba537fc..772c5f643764 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -854,6 +854,9 @@ struct task_struct { unsigned int xhlock_idx; /* For restoring at history boundaries */ unsigned int xhlock_idx_hist[XHLOCK_CTX_NR]; + unsigned int hist_id; + /* For overwrite check at each context exit */ + unsigned int hist_id_save[XHLOCK_CTX_NR]; #endif #ifdef CONFIG_UBSAN |