|
@@ -713,11 +713,14 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved)
|
|
|
|
|
|
/*
|
|
|
* We want the lowest bit of offset available for in-use/free
|
|
|
- * indicator.
|
|
|
+ * indicator, so force >= 16bit alignment and make size even.
|
|
|
*/
|
|
|
if (unlikely(align < 2))
|
|
|
align = 2;
|
|
|
|
|
|
+ if (unlikely(size & 1))
|
|
|
+ size++;
|
|
|
+
|
|
|
if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
|
|
|
WARN(true, "illegal size (%zu) or align (%zu) for "
|
|
|
"percpu allocation\n", size, align);
|