Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / mm / percpu.c
index 202e104..63e24fb 100644 (file)
@@ -473,9 +473,11 @@ static int pcpu_alloc_area(struct pcpu_chunk *chunk, int size, int align)
                 * uncommon for percpu allocations.
                 */
                if (head && (head < sizeof(int) || !(p[-1] & 1))) {
+                       *p = off += head;
                        if (p[-1] & 1)
                                chunk->free_size -= head;
-                       *p = off += head;
+                       else
+                               max_contig = max(*p - p[-1], max_contig);
                        this_size -= head;
                        head = 0;
                }