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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Apr 2008 14:51:25 +0200
From:	Johannes Weiner <hannes@...urebad.de>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	akpm@...ux-foundation.org, mm-commits@...r.kernel.org, ak@...e.de,
	clameter@....com, kamezawa.hiroyu@...fujitsu.com,
	y-goto@...fujitsu.com, yhlu.kernel@...il.com,
	linux-kernel@...r.kernel.org
Subject: Re: + bootmem-node-setup-agnostic-free_bootmem.patch added to -mm tree

Hi Ingo,

Ingo Molnar <mingo@...e.hu> writes:

> * akpm@...ux-foundation.org <akpm@...ux-foundation.org> wrote:
>
>> Subject: bootmem: node-setup agnostic free_bootmem()
>> From: Johannes Weiner <hannes@...urebad.de>
>> 
>> Make free_bootmem() look up the node holding the specified address 
>> range which lets it work transparently on single-node and multi-node 
>> configurations.
>
> this patch does not fix the bug Yinghai's (now dropped) patches solved: 
> reserve_early() allocations. So NAK until the full problem has been 
> sorted out ...

Okay, NAK on -mm and -x86 for sure.  The patch was meant for mainline
where there is no need for free_bootmem() going across nodes, right?

But I still object to the way Yinghai implemented it.
free_bootmem_core() should not be twisted like this.

How about the following (untested, even uncompiled, but you should get
the idea) proposal which would replace the patch discussed in this
thread:

--- tree-linus.orig/mm/bootmem.c
+++ tree-linus/mm/bootmem.c
@@ -421,7 +421,25 @@ int __init reserve_bootmem(unsigned long
 
 void __init free_bootmem(unsigned long addr, unsigned long size)
 {
-	free_bootmem_core(NODE_DATA(0)->bdata, addr, size);
+	bootmem_data_t *bdata;
+
+	list_for_each_entry(bdata, &bdata_list, list) {
+		unsigned long remainder = 0;
+
+		if (addr < bdata->node_boot_start)
+			continue;
+
+		if (PFN_DOWN(addr + size) > bdata->node_low_pfn)
+			remainder = PFN_DOWN(addr + size) - bdata->node_low_pfn;
+
+		size -= PFN_PHYS(remainder);
+		free_bootmem_core(bdata, addr, size)
+
+		if (!remainder)
+			break;
+
+		addr = PFN_PHYS(bdata->node_low_pfn + 1);
+	}
 }
 
 unsigned long __init free_all_bootmem(void)
---
	Hannes
--
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