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]
Message-ID: <20160107001141.GA6595@codemonkey.org.uk>
Date:	Wed, 6 Jan 2016 19:11:41 -0500
From:	Dave Jones <davej@...emonkey.org.uk>
To:	Linux Kernel <linux-kernel@...r.kernel.org>, x86@...nel.org
Subject: Re: weird DirectMap2M accounting.

On Wed, Jan 06, 2016 at 06:55:27PM -0500, Dave Jones wrote:
 > I just spotted this in /proc/meminfo on an old Core2 machine with 4G.
 > 
 > DirectMap2M:    18446744073709543424 kB
 > 
 > Looks like we subtracted 8192 from 0 somewhere.
 > 
 > Should split_page_count() be checking that direct_pages_count > 0 ?

Ok, this diff makes that number print out as 0.

If this looks ok, I'll submit it properly, though I'd like to better
understand what's happening here. Shouldn't I have 2M pages ?

	Dave


diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a3137a4feed1..ff0e0c6c350e 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -66,6 +66,9 @@ void update_page_count(int level, unsigned long pages)
 
 static void split_page_count(int level)
 {
+	if (direct_pages_count[level] == 0)
+		return;
+
 	direct_pages_count[level]--;
 	direct_pages_count[level - 1] += PTRS_PER_PTE;
 }
 
--
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