From: William Lee Irwin III <wli@holomorphy.com>
To: Andrea Arcangeli <andrea@suse.de>,
"Martin J. Bligh" <mbligh@aracnet.com>,
Hugh Dickins <hugh@veritas.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] anobjrmap 1/6 objrmap
Date: Wed, 24 Mar 2004 12:17:34 -0800 [thread overview]
Message-ID: <20040324201734.GL791@holomorphy.com> (raw)
In-Reply-To: <20040324200156.GK791@holomorphy.com>
On Wed, Mar 24, 2004 at 12:01:56PM -0800, William Lee Irwin III wrote:
> Don't confuse unslabify and the ->list removal. The ->list removal went
> around insisting the known universe stop using ->lru because of the
> relatively arbitrary choice that slab.c use ->lru. The unslabify patch
> attempts to update one user of ->lru by backing out the code using it.
> Do note that non-list-heads like ->index, ->private, or ->mapping are
> also unused on slab pages, and could have saved some pain for this
> former user of ->list had they been chosen.
Updating the user instead of backing them out would have looked
something like the following (totally untested, not even compiletested):
-- wli
Index: mm2-2.6.5-rc2-1/arch/i386/mm/pageattr.c
===================================================================
--- mm2-2.6.5-rc2-1.orig/arch/i386/mm/pageattr.c 2004-03-19 16:11:06.000000000 -0800
+++ mm2-2.6.5-rc2-1/arch/i386/mm/pageattr.c 2004-03-21 07:15:40.000000000 -0800
@@ -75,7 +75,7 @@
return;
spin_lock_irqsave(&pgd_lock, flags);
- list_for_each_entry(page, &pgd_list, lru) {
+ for (page = pgd_list; page; page = (struct page *)page->index) {
pgd_t *pgd;
pmd_t *pmd;
pgd = (pgd_t *)page_address(page) + pgd_index(address);
Index: mm2-2.6.5-rc2-1/arch/i386/mm/pgtable.c
===================================================================
--- mm2-2.6.5-rc2-1.orig/arch/i386/mm/pgtable.c 2004-03-21 07:14:22.000000000 -0800
+++ mm2-2.6.5-rc2-1/arch/i386/mm/pgtable.c 2004-03-21 07:18:41.000000000 -0800
@@ -172,7 +172,27 @@
* -- wli
*/
spinlock_t pgd_lock = SPIN_LOCK_UNLOCKED;
-LIST_HEAD(pgd_list);
+struct page *pgd_list;
+
+static inline void pgd_list_add(pgd_t *pgd)
+{
+ struct page *page = virt_to_page(pgd);
+ page->index = (unsigned long)pgd_list;
+ if (pgd_list)
+ pgd_list->private = (unsigned long)&page->index;
+ pgd_list = page;
+ page->private = (unsigned long)&pgd_list;
+}
+
+static inline void pgd_list_del(pgd_t *pgd)
+{
+ struct page *next, **pprev, *page = virt_to_page(pgd);
+ next = (struct page *)page->index;
+ pprev = (struct page **)page->private;
+ *pprev = next;
+ if (next)
+ next->private = (unsigned long)pprev;
+}
void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
{
@@ -188,7 +208,7 @@
if (PTRS_PER_PMD > 1)
return;
- list_add(&virt_to_page(pgd)->lru, &pgd_list);
+ pgd_list_add(pgd);
spin_unlock_irqrestore(&pgd_lock, flags);
memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
}
@@ -199,7 +219,7 @@
unsigned long flags; /* can be called from interrupt context */
spin_lock_irqsave(&pgd_lock, flags);
- list_del(&virt_to_page(pgd)->lru);
+ pgd_list_del(pgd);
spin_unlock_irqrestore(&pgd_lock, flags);
}
Index: mm2-2.6.5-rc2-1/include/asm-i386/pgtable.h
===================================================================
--- mm2-2.6.5-rc2-1.orig/include/asm-i386/pgtable.h 2004-03-19 16:11:34.000000000 -0800
+++ mm2-2.6.5-rc2-1/include/asm-i386/pgtable.h 2004-03-21 08:27:30.000000000 -0800
@@ -35,7 +35,7 @@
extern kmem_cache_t *pgd_cache;
extern kmem_cache_t *pmd_cache;
extern spinlock_t pgd_lock;
-extern struct list_head pgd_list;
+extern struct page *pgd_list;
void pmd_ctor(void *, kmem_cache_t *, unsigned long);
void pgd_ctor(void *, kmem_cache_t *, unsigned long);
next prev parent reply other threads:[~2004-03-24 20:17 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-18 23:21 [PATCH] anobjrmap 1/6 objrmap Hugh Dickins
2004-03-18 23:22 ` [PATCH] anobjrmap 2/6 linux/rmap.h Hugh Dickins
2004-03-18 23:23 ` [PATCH] anobjrmap 3/6 page->mapping Hugh Dickins
2004-03-18 23:25 ` [PATCH] anobjrmap 4/6 no pte_chains Hugh Dickins
2004-03-18 23:26 ` [PATCH] anobjrmap 5/6 anonmm Hugh Dickins
2004-03-19 16:15 ` Rik van Riel
2004-03-18 23:27 ` [PATCH] anobjrmap 6/6 cleanup Hugh Dickins
2004-03-19 2:42 ` [PATCH] anobjrmap 1/6 objrmap Andrea Arcangeli
2004-03-19 7:08 ` Hugh Dickins
2004-03-19 17:11 ` Martin J. Bligh
2004-03-20 12:30 ` Andrea Arcangeli
2004-03-20 14:03 ` William Lee Irwin III
2004-03-20 14:29 ` Andrea Arcangeli
2004-03-20 15:56 ` Martin J. Bligh
2004-03-20 16:19 ` Andrea Arcangeli
2004-03-20 16:40 ` Martin J. Bligh
2004-03-20 16:55 ` Andrea Arcangeli
2004-03-20 17:33 ` Martin J. Bligh
2004-03-20 18:50 ` Andrea Arcangeli
2004-03-21 16:30 ` Martin J. Bligh
2004-03-21 23:52 ` Andrea Arcangeli
2004-03-22 15:53 ` Martin J. Bligh
2004-03-24 6:19 ` Andrea Arcangeli
2004-03-24 15:56 ` Martin J. Bligh
2004-03-24 16:21 ` Andrea Arcangeli
2004-03-24 16:35 ` Martin J. Bligh
2004-03-24 17:08 ` Andrea Arcangeli
2004-03-24 20:00 ` William Lee Irwin III
2004-03-24 20:01 ` William Lee Irwin III
2004-03-24 20:17 ` William Lee Irwin III [this message]
2004-03-20 12:46 ` Andrea Arcangeli
2004-03-19 14:38 ` William Lee Irwin III
2004-03-22 20:37 ` [PATCH] anobjrmap 7/6 mremap moves Hugh Dickins
2004-03-22 21:52 ` Rajesh Venkatasubramanian
2004-03-26 14:29 ` [PATCH] anobjrmap 8/6 unmap nonlinear Hugh Dickins
2004-03-26 14:54 ` Realtek 8139too drivers Linux Kernel
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=20040324201734.GL791@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox