diff options
Diffstat (limited to 'kernel/rcutree.h')
-rw-r--r-- | kernel/rcutree.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 8bb03cb07447..df2e0b694744 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h | |||
@@ -34,10 +34,11 @@ | |||
34 | * In practice, this has not been tested, so there is probably some | 34 | * In practice, this has not been tested, so there is probably some |
35 | * bug somewhere. | 35 | * bug somewhere. |
36 | */ | 36 | */ |
37 | #define MAX_RCU_LVLS 3 | 37 | #define MAX_RCU_LVLS 4 |
38 | #define RCU_FANOUT (CONFIG_RCU_FANOUT) | 38 | #define RCU_FANOUT (CONFIG_RCU_FANOUT) |
39 | #define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT) | 39 | #define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT) |
40 | #define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT) | 40 | #define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT) |
41 | #define RCU_FANOUT_FOURTH (RCU_FANOUT_CUBE * RCU_FANOUT) | ||
41 | 42 | ||
42 | #if NR_CPUS <= RCU_FANOUT | 43 | #if NR_CPUS <= RCU_FANOUT |
43 | # define NUM_RCU_LVLS 1 | 44 | # define NUM_RCU_LVLS 1 |
@@ -45,23 +46,33 @@ | |||
45 | # define NUM_RCU_LVL_1 (NR_CPUS) | 46 | # define NUM_RCU_LVL_1 (NR_CPUS) |
46 | # define NUM_RCU_LVL_2 0 | 47 | # define NUM_RCU_LVL_2 0 |
47 | # define NUM_RCU_LVL_3 0 | 48 | # define NUM_RCU_LVL_3 0 |
49 | # define NUM_RCU_LVL_4 0 | ||
48 | #elif NR_CPUS <= RCU_FANOUT_SQ | 50 | #elif NR_CPUS <= RCU_FANOUT_SQ |
49 | # define NUM_RCU_LVLS 2 | 51 | # define NUM_RCU_LVLS 2 |
50 | # define NUM_RCU_LVL_0 1 | 52 | # define NUM_RCU_LVL_0 1 |
51 | # define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) | 53 | # define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) |
52 | # define NUM_RCU_LVL_2 (NR_CPUS) | 54 | # define NUM_RCU_LVL_2 (NR_CPUS) |
53 | # define NUM_RCU_LVL_3 0 | 55 | # define NUM_RCU_LVL_3 0 |
56 | # define NUM_RCU_LVL_4 0 | ||
54 | #elif NR_CPUS <= RCU_FANOUT_CUBE | 57 | #elif NR_CPUS <= RCU_FANOUT_CUBE |
55 | # define NUM_RCU_LVLS 3 | 58 | # define NUM_RCU_LVLS 3 |
56 | # define NUM_RCU_LVL_0 1 | 59 | # define NUM_RCU_LVL_0 1 |
57 | # define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_SQ) | 60 | # define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_SQ) |
58 | # define NUM_RCU_LVL_2 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) | 61 | # define NUM_RCU_LVL_2 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) |
59 | # define NUM_RCU_LVL_3 NR_CPUS | 62 | # define NUM_RCU_LVL_3 NR_CPUS |
63 | # define NUM_RCU_LVL_4 0 | ||
64 | #elif NR_CPUS <= RCU_FANOUT_FOURTH | ||
65 | # define NUM_RCU_LVLS 4 | ||
66 | # define NUM_RCU_LVL_0 1 | ||
67 | # define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_CUBE) | ||
68 | # define NUM_RCU_LVL_2 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_SQ) | ||
69 | # define NUM_RCU_LVL_3 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) | ||
70 | # define NUM_RCU_LVL_4 NR_CPUS | ||
60 | #else | 71 | #else |
61 | # error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" | 72 | # error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" |
62 | #endif /* #if (NR_CPUS) <= RCU_FANOUT */ | 73 | #endif /* #if (NR_CPUS) <= RCU_FANOUT */ |
63 | 74 | ||
64 | #define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3) | 75 | #define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3 + NUM_RCU_LVL_4) |
65 | #define NUM_RCU_NODES (RCU_SUM - NR_CPUS) | 76 | #define NUM_RCU_NODES (RCU_SUM - NR_CPUS) |
66 | 77 | ||
67 | /* | 78 | /* |