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]
Message-Id: <20070903194629.aa24ecc5.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Mon, 3 Sep 2007 19:46:29 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	"mel@....ul.ie" <mel@....ul.ie>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"kamezawa.hiroyu@...fujitsu.com" <kamezawa.hiroyu@...fujitsu.com>
Subject: [PATCH][-mm] Fix setup_per_zone_pages_min() lock.

Fix setup_per_zone_pages_min().

Now setup_per_zone_pages_min() uses zone->lru_lock. This has 2 problems.

1. setup_page_zone_pages_min() modifies zone->pages_min,pages_low,pages_high.
   in atomic. But readers of these values tend not to take lru_lock.
   (At least, we need lock between memory hotplug vs. sysctl)
2. setup_zone_migrate_reserve() should take zone->lock instead of lru_lock.

This patch replaces zone->lru_lock with zone->lock.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>



---
 mm/page_alloc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: devel-2.6.23-rc4-mm1-zone/mm/page_alloc.c
===================================================================
--- devel-2.6.23-rc4-mm1-zone.orig/mm/page_alloc.c
+++ devel-2.6.23-rc4-mm1-zone/mm/page_alloc.c
@@ -4176,8 +4176,8 @@ void setup_per_zone_pages_min(void)
 
 	for_each_zone(zone) {
 		u64 tmp;
+		spin_lock_irqsave(&zone->lock, flags);
 
-		spin_lock_irqsave(&zone->lru_lock, flags);
 		tmp = (u64)pages_min * zone->present_pages;
 		do_div(tmp, lowmem_pages);
 		if (is_highmem(zone)) {
@@ -4208,8 +4208,9 @@ void setup_per_zone_pages_min(void)
 
 		zone->pages_low   = zone->pages_min + (tmp >> 2);
 		zone->pages_high  = zone->pages_min + (tmp >> 1);
+
 		setup_zone_migrate_reserve(zone);
-		spin_unlock_irqrestore(&zone->lru_lock, flags);
+		spin_unlock_irqrestore(&zone->lock, flags);
 	}
 
 	/* update totalreserve_pages */

-
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