Commit f82b217e authored by Dave Jones's avatar Dave Jones Committed by Ingo Molnar

lockdep: shrink held_lock structure

struct held_lock {
        u64                        prev_chain_key;       /*     0     8 */
        struct lock_class *        class;                /*     8     8 */
        long unsigned int          acquire_ip;           /*    16     8 */
        struct lockdep_map *       instance;             /*    24     8 */
        int                        irq_context;          /*    32     4 */
        int                        trylock;              /*    36     4 */
        int                        read;                 /*    40     4 */
        int                        check;                /*    44     4 */
        int                        hardirqs_off;         /*    48     4 */

        /* size: 56, cachelines: 1 */
        /* padding: 4 */
        /* last cacheline: 56 bytes */
};

struct held_lock {
        u64                        prev_chain_key;       /*     0     8 */
        long unsigned int          acquire_ip;           /*     8     8 */
        struct lockdep_map *       instance;             /*    16     8 */
        unsigned int               class_idx:11;         /*    24:21  4 */
        unsigned int               irq_context:2;        /*    24:19  4 */
        unsigned int               trylock:1;            /*    24:18  4 */
        unsigned int               read:2;               /*    24:16  4 */
        unsigned int               check:2;              /*    24:14  4 */
        unsigned int               hardirqs_off:1;       /*    24:13  4 */

        /* size: 32, cachelines: 1 */
        /* padding: 4 */
        /* bit_padding: 13 bits */
        /* last cacheline: 32 bytes */
};

[mingo@elte.hu: shrunk hlock->class too]
[peterz@infradead.org: fixup bit sizes]
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
parent 1b12bbc7
...@@ -190,6 +190,9 @@ struct lock_chain { ...@@ -190,6 +190,9 @@ struct lock_chain {
u64 chain_key; u64 chain_key;
}; };
#define MAX_LOCKDEP_KEYS_BITS 11
#define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS)
struct held_lock { struct held_lock {
/* /*
* One-way hash of the dependency chain up to this point. We * One-way hash of the dependency chain up to this point. We
...@@ -206,14 +209,13 @@ struct held_lock { ...@@ -206,14 +209,13 @@ struct held_lock {
* with zero), here we store the previous hash value: * with zero), here we store the previous hash value:
*/ */
u64 prev_chain_key; u64 prev_chain_key;
struct lock_class *class;
unsigned long acquire_ip; unsigned long acquire_ip;
struct lockdep_map *instance; struct lockdep_map *instance;
#ifdef CONFIG_LOCK_STAT #ifdef CONFIG_LOCK_STAT
u64 waittime_stamp; u64 waittime_stamp;
u64 holdtime_stamp; u64 holdtime_stamp;
#endif #endif
unsigned int class_idx:MAX_LOCKDEP_KEYS_BITS;
/* /*
* The lock-stack is unified in that the lock chains of interrupt * The lock-stack is unified in that the lock chains of interrupt
* contexts nest ontop of process context chains, but we 'separate' * contexts nest ontop of process context chains, but we 'separate'
...@@ -227,11 +229,11 @@ struct held_lock { ...@@ -227,11 +229,11 @@ struct held_lock {
* The following field is used to detect when we cross into an * The following field is used to detect when we cross into an
* interrupt context: * interrupt context:
*/ */
int irq_context; unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */
int trylock; unsigned int trylock:1;
int read; unsigned int read:2; /* see lock_acquire() comment */
int check; unsigned int check:2; /* see lock_acquire() comment */
int hardirqs_off; unsigned int hardirqs_off:1;
}; };
/* /*
......
This diff is collapsed.
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
*/ */
#define MAX_LOCKDEP_ENTRIES 8192UL #define MAX_LOCKDEP_ENTRIES 8192UL
#define MAX_LOCKDEP_KEYS_BITS 11
#define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS)
#define MAX_LOCKDEP_CHAINS_BITS 14 #define MAX_LOCKDEP_CHAINS_BITS 14
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS) #define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment