From: Christoph Lameter <christoph@lameter.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Manfred Spraul <manfred@colorfullife.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
linux-mm@kvack.org, shai@scalex86.org,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] Pageset Localization V2
Date: Wed, 30 Mar 2005 19:50:22 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0503301947450.26235@server.graphe.net> (raw)
In-Reply-To: <20050330134049.GA21986@parcelfarce.linux.theplanet.co.uk>
Patch to fix the issues mentioned so far. The MAKE_LIST macro would also
not be good to some things that I have planned so lets drop it.
Index: linux-2.6.11/mm/page_alloc.c
===================================================================
--- linux-2.6.11.orig/mm/page_alloc.c 2005-03-30 19:45:23.000000000 -0800
+++ linux-2.6.11/mm/page_alloc.c 2005-03-30 19:46:23.000000000 -0800
@@ -1613,15 +1613,6 @@ void zone_init_free_lists(struct pglist_
memmap_init_zone((size), (nid), (zone), (start_pfn))
#endif
-#define MAKE_LIST(list, nlist) \
- do { \
- if(list_empty(&list)) \
- INIT_LIST_HEAD(nlist); \
- else { nlist->next->prev = nlist; \
- nlist->prev->next = nlist; \
- } \
- }while(0)
-
/*
* Dynamicaly allocate memory for the
* per cpu pageset array in struct zone.
@@ -1629,6 +1620,7 @@ void zone_init_free_lists(struct pglist_
static inline int __devinit process_zones(int cpu)
{
struct zone *zone, *dzone;
+ int i;
for_each_zone(zone) {
struct per_cpu_pageset *npageset = NULL;
@@ -1642,9 +1634,17 @@ static inline int __devinit process_zone
if(zone->pageset[cpu]) {
memcpy(npageset, zone->pageset[cpu], sizeof(struct per_cpu_pageset));
- MAKE_LIST(zone->pageset[cpu]->pcp[0].list, (&npageset->pcp[0].list));
- MAKE_LIST(zone->pageset[cpu]->pcp[1].list, (&npageset->pcp[1].list));
- }
+
+ /* Fix up the list pointers */
+ for(i = 0; i<2; i++) {
+ if (list_empty(&zone->pageset[cpu]->pcp[i].list))
+ INIT_LIST_HEAD(&npageset->pcp[i].list);
+ else {
+ npageset->pcp[i].list.next->prev = &npageset->pcp[i].list;
+ npageset->pcp[i].list.prev->next = &npageset->pcp[i].list;
+ }
+ }
+ }
else {
struct per_cpu_pages *pcp;
unsigned long batch;
@@ -1721,11 +1721,14 @@ struct notifier_block pageset_notifier =
void __init setup_per_cpu_pageset()
{
- /*Iintialize per_cpu_pageset for cpu 0.
- A cpuup callback will do this for every cpu
- as it comes online
+ int err;
+
+ /* Initialize per_cpu_pageset for cpu 0.
+ * A cpuup callback will do this for every cpu
+ * as it comes online
*/
- BUG_ON(process_zones(smp_processor_id()));
+ err = process_zones(smp_processor_id());
+ BUG_ON(err);
register_cpu_notifier(&pageset_notifier);
}
--
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:"aart@kvack.org"> aart@kvack.org </a>
prev parent reply other threads:[~2005-03-31 3:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-30 5:51 Christoph Lameter
2005-03-30 11:14 ` Christoph Hellwig
[not found] ` <bab4333005033003295f487e3d@mail.gmail.com>
2005-03-30 13:06 ` Fwd: " shobhit dayal
2005-03-31 14:32 ` Christoph Hellwig
2005-03-31 14:47 ` Matthew Wilcox
2005-03-31 15:36 ` Christoph Lameter
2005-03-31 15:53 ` Christoph Lameter
2005-03-31 15:35 ` Christoph Lameter
2005-03-30 13:40 ` Matthew Wilcox
2005-03-31 3:50 ` Christoph Lameter [this message]
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=Pine.LNX.4.58.0503301947450.26235@server.graphe.net \
--to=christoph@lameter.com \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=manfred@colorfullife.com \
--cc=matthew@wil.cx \
--cc=shai@scalex86.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox