diff options
author | Jianyu Zhan <nasa4836@gmail.com> | 2014-03-28 08:55:21 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-03-29 09:29:42 -0400 |
commit | 21ddfd38ee9aac804d22beaceed4c7b903cca234 (patch) | |
tree | a4d853bdc3b274be013aa97d6378acbf2f995d88 /mm | |
parent | 2f69fa829cb4ca062aaffee9ab9eb44484db75b1 (diff) |
percpu: renew the max_contig if we merge the head and previous block
During pcpu_alloc_area(), we might merge the current head with the
previous block. Since we have calculated the max_contig using the
size of previous block before we skip it, and now we update the size
of previous block, so we should renew the max_contig.
Signed-off-by: Jianyu Zhan <nasa4836@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/percpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index 202e104df8a7..63e24fb4387b 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -473,9 +473,11 @@ static int pcpu_alloc_area(struct pcpu_chunk *chunk, int size, int align) | |||
473 | * uncommon for percpu allocations. | 473 | * uncommon for percpu allocations. |
474 | */ | 474 | */ |
475 | if (head && (head < sizeof(int) || !(p[-1] & 1))) { | 475 | if (head && (head < sizeof(int) || !(p[-1] & 1))) { |
476 | *p = off += head; | ||
476 | if (p[-1] & 1) | 477 | if (p[-1] & 1) |
477 | chunk->free_size -= head; | 478 | chunk->free_size -= head; |
478 | *p = off += head; | 479 | else |
480 | max_contig = max(*p - p[-1], max_contig); | ||
479 | this_size -= head; | 481 | this_size -= head; |
480 | head = 0; | 482 | head = 0; |
481 | } | 483 | } |