From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>,
Andy Whitcroft <apw@shadowen.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
Mel Gorman <mel@csn.ul.ie>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: [PATCH] setup_per_zone_pages_min(): take zone->lock instead of zone->lru_lock
Date: Wed, 01 Oct 2008 19:39:32 +0200 [thread overview]
Message-ID: <1222882772.4846.40.camel@localhost.localdomain> (raw)
In-Reply-To: <20080930103748.44A3.E1E9C6FF@jp.fujitsu.com>
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
This replaces zone->lru_lock in setup_per_zone_pages_min() with zone->lock.
There seems to be no need for the lru_lock anymore, but there is a need for
zone->lock instead, because that function may call move_freepages() via
setup_zone_migrate_reserve().
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -4207,7 +4207,7 @@ void setup_per_zone_pages_min(void)
for_each_zone(zone) {
u64 tmp;
- spin_lock_irqsave(&zone->lru_lock, flags);
+ spin_lock_irqsave(&zone->lock, flags);
tmp = (u64)pages_min * zone->present_pages;
do_div(tmp, lowmem_pages);
if (is_highmem(zone)) {
@@ -4239,7 +4239,7 @@ 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 */
WARNING: multiple messages have this Message-ID (diff)
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>,
Andy Whitcroft <apw@shadowen.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
Mel Gorman <mel@csn.ul.ie>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: [PATCH] setup_per_zone_pages_min(): take zone->lock instead of zone->lru_lock
Date: Wed, 01 Oct 2008 19:39:32 +0200 [thread overview]
Message-ID: <1222882772.4846.40.camel@localhost.localdomain> (raw)
In-Reply-To: <20080930103748.44A3.E1E9C6FF@jp.fujitsu.com>
This replaces zone->lru_lock in setup_per_zone_pages_min() with zone->lock.
There seems to be no need for the lru_lock anymore, but there is a need for
zone->lock instead, because that function may call move_freepages() via
setup_zone_migrate_reserve().
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -4207,7 +4207,7 @@ void setup_per_zone_pages_min(void)
for_each_zone(zone) {
u64 tmp;
- spin_lock_irqsave(&zone->lru_lock, flags);
+ spin_lock_irqsave(&zone->lock, flags);
tmp = (u64)pages_min * zone->present_pages;
do_div(tmp, lowmem_pages);
if (is_highmem(zone)) {
@@ -4239,7 +4239,7 @@ 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-10-01 17:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 17:10 setup_per_zone_pages_min(): zone->lock vs. zone->lru_lock Gerald Schaefer
2008-09-29 17:10 ` Gerald Schaefer
2008-09-29 17:36 ` Andy Whitcroft
2008-09-29 17:36 ` Andy Whitcroft
2008-09-29 21:20 ` Gerald Schaefer
2008-09-29 21:20 ` Gerald Schaefer
2008-09-30 0:40 ` KAMEZAWA Hiroyuki
2008-09-30 0:40 ` KAMEZAWA Hiroyuki
2008-09-30 1:53 ` Yasunori Goto
2008-09-30 1:53 ` Yasunori Goto
2008-10-01 17:39 ` Gerald Schaefer [this message]
2008-10-01 17:39 ` [PATCH] setup_per_zone_pages_min(): take zone->lock instead of zone->lru_lock Gerald Schaefer, Gerald Schaefer
2008-10-02 5:49 ` KAMEZAWA Hiroyuki
2008-10-02 5:49 ` KAMEZAWA Hiroyuki
2008-10-02 10:00 ` Yasunori Goto
2008-10-02 10:00 ` Yasunori Goto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1222882772.4846.40.camel@localhost.localdomain \
--to=gerald.schaefer@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=heiko.carstens@de.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=schwidefsky@de.ibm.com \
--cc=y-goto@jp.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.