aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stackdepot.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-05-09 15:59:24 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-09 15:59:24 -0400
commite800072c18f0d7b89a80fa46dceb3d080c80e09c (patch)
tree8da6cb7944762a60ec37594720c1ad2757631c2f /lib/stackdepot.c
parente8ed77dfa90dd79c5343415a4bbbfdab9787b35a (diff)
parentb507146bb6b9ac0c0197100ba3e299825a21fed3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
In netdevice.h we removed the structure in net-next that is being changes in 'net'. In macsec.c and rtnetlink.c we have overlaps between fixes in 'net' and the u64 attribute changes in 'net-next'. The mlx5 conflicts have to do with vxlan support dependencies. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/stackdepot.c')
-rw-r--r--lib/stackdepot.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stackdepot.c b/lib/stackdepot.c
index 9e0b0315a724..53ad6c0831ae 100644
--- a/lib/stackdepot.c
+++ b/lib/stackdepot.c
@@ -42,12 +42,14 @@
42 42
43#define DEPOT_STACK_BITS (sizeof(depot_stack_handle_t) * 8) 43#define DEPOT_STACK_BITS (sizeof(depot_stack_handle_t) * 8)
44 44
45#define STACK_ALLOC_NULL_PROTECTION_BITS 1
45#define STACK_ALLOC_ORDER 2 /* 'Slab' size order for stack depot, 4 pages */ 46#define STACK_ALLOC_ORDER 2 /* 'Slab' size order for stack depot, 4 pages */
46#define STACK_ALLOC_SIZE (1LL << (PAGE_SHIFT + STACK_ALLOC_ORDER)) 47#define STACK_ALLOC_SIZE (1LL << (PAGE_SHIFT + STACK_ALLOC_ORDER))
47#define STACK_ALLOC_ALIGN 4 48#define STACK_ALLOC_ALIGN 4
48#define STACK_ALLOC_OFFSET_BITS (STACK_ALLOC_ORDER + PAGE_SHIFT - \ 49#define STACK_ALLOC_OFFSET_BITS (STACK_ALLOC_ORDER + PAGE_SHIFT - \
49 STACK_ALLOC_ALIGN) 50 STACK_ALLOC_ALIGN)
50#define STACK_ALLOC_INDEX_BITS (DEPOT_STACK_BITS - STACK_ALLOC_OFFSET_BITS) 51#define STACK_ALLOC_INDEX_BITS (DEPOT_STACK_BITS - \
52 STACK_ALLOC_NULL_PROTECTION_BITS - STACK_ALLOC_OFFSET_BITS)
51#define STACK_ALLOC_SLABS_CAP 1024 53#define STACK_ALLOC_SLABS_CAP 1024
52#define STACK_ALLOC_MAX_SLABS \ 54#define STACK_ALLOC_MAX_SLABS \
53 (((1LL << (STACK_ALLOC_INDEX_BITS)) < STACK_ALLOC_SLABS_CAP) ? \ 55 (((1LL << (STACK_ALLOC_INDEX_BITS)) < STACK_ALLOC_SLABS_CAP) ? \
@@ -59,6 +61,7 @@ union handle_parts {
59 struct { 61 struct {
60 u32 slabindex : STACK_ALLOC_INDEX_BITS; 62 u32 slabindex : STACK_ALLOC_INDEX_BITS;
61 u32 offset : STACK_ALLOC_OFFSET_BITS; 63 u32 offset : STACK_ALLOC_OFFSET_BITS;
64 u32 valid : STACK_ALLOC_NULL_PROTECTION_BITS;
62 }; 65 };
63}; 66};
64 67
@@ -136,6 +139,7 @@ static struct stack_record *depot_alloc_stack(unsigned long *entries, int size,
136 stack->size = size; 139 stack->size = size;
137 stack->handle.slabindex = depot_index; 140 stack->handle.slabindex = depot_index;
138 stack->handle.offset = depot_offset >> STACK_ALLOC_ALIGN; 141 stack->handle.offset = depot_offset >> STACK_ALLOC_ALIGN;
142 stack->handle.valid = 1;
139 memcpy(stack->entries, entries, size * sizeof(unsigned long)); 143 memcpy(stack->entries, entries, size * sizeof(unsigned long));
140 depot_offset += required_size; 144 depot_offset += required_size;
141 145