]> git.karo-electronics.de Git - linux-beck.git/blobdiff - mm/percpu.c
percpu: renew the max_contig if we merge the head and previous block
[linux-beck.git] / mm / percpu.c
index 202e104df8a7a765d680ca6b18526636a5b12634..63e24fb4387b6d305960f9e7ba8c0554e6818ca5 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;
                }