lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Mar 2014 19:05:43 +0800
From:	Jianyu Zhan <nasa4836@...il.com>
To:	linux-mm@...ck.org
Cc:	akpm@...ux-foundation.org, tj@...nel.org, cl@...ux-foundation.org,
	linux-kernel@...r.kernel.org, nasa4836@...il.com
Subject: [PATCH 1/2] mm/percpu.c: 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@...il.com>
---
 mm/percpu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index 036cfe0..cfda29c 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -506,9 +506,11 @@ static int pcpu_alloc_area(struct pcpu_chunk *chunk, int size, int align)
 		 * uncommon for percpu allocations.
 		 */
 		if (head && (head < sizeof(int) || chunk->map[i - 1] > 0)) {
-			if (chunk->map[i - 1] > 0)
+			if (chunk->map[i - 1] > 0) {
 				chunk->map[i - 1] += head;
-			else {
+				max_contig =
+					max(chunk->map[i - 1], max_contig);
+			} else {
 				chunk->map[i - 1] -= head;
 				chunk->free_size -= head;
 			}
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ