Skip to contentSkip to conversation

latest radix-tree pagecache patch and 2.4.19-pre3-ac6

PATCH In review Art Haas 2 participants 3 messages Mar 25, 2002 Memory management

lore
Share & tools
lore

Art Haas

author
#0 lore raw

PATCH 1/1 latest radix-tree pagecache patch and 2.4.19-pre3-ac6

Hi.

I've managed to cobble together a patch which takes the latest radix-tree code and makes it "work" with the rmap code in 2.4.19-pre3-ac6. I'm running the kernel with this patch right now, and I've got KDE, Konqueror, and Xemacs running, and things look good. I'm usually using swap space at this point, but with the patch I'm not yet doing so. Maybe this is part of the benefits of the patch, or maybe I've screwed things up but haven't yet tripped. I'd be grateful for a second or third pair of eyes to look over this, to see if what I've got looks reasonable. If it does, I'll send it out the the kernel mailing list.

The original radix-tree patch applies fairly cleanly to the -ac6 tree, but there are a few files that need touching up. The mm/vmscan.c, mm/filemap.c, and mm/shmem.c files needed the most attention. For vmscan.c, a couple of pieces in the original patch were dropped, as it looks like they'll only apply (or make sense) with the non-rmap code. As for filemap.c, a few changes seemed to conflict with the rmap code, so my efforts to make a compilable file may have broken the code. But hey, I got a `.o' file from the compiler, so it must work, right? :-)

My thanks to everyone working on the VM code, and the radix-tree patches. Comments (and fixes) welcomed.

Signature · 3 lines
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
 -- Benjamin Franklin, Historical Review of Pennsylvania, 1759
#1 lore raw
Quoted 11 lines · Art Haas

Hi.

The original radix-tree patch applies fairly cleanly to the -ac6 tree, but there are a few files that need touching up. The mm/vmscan.c, mm/filemap.c, and mm/shmem.c files needed the most attention. For vmscan.c, a couple of pieces in the original patch were dropped, as it looks like they'll only apply (or make sense) with the non-rmap code. As for filemap.c, a few changes seemed to conflict with the rmap code, so my efforts to make a compilable file may have broken the code. But hey, I got a `.o' file from the compiler, so it must work, right? :-)

I think I have found at least once obvious bug:

a) this cannot actually compile, pagecache_lock is gone..
b) find_get_page already does locking internally AND also grabs a reference to the page.

This should probably be just a radix_tree_lookup()

@@ -1064,7 +999,7 @@
spin_lock(&pagemap_lru_lock);
while (--index >= start) {
spin_lock(&pagecache_lock);
- page = __find_page(mapping, index);
+ page = find_get_page(mapping, index);
spin_unlock(&pagecache_lock);
if (!page || !PageActive(page))
break;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/

author
#2 lore raw
Quoted 13 lines · Christoph Hellwig

[ ... my comments ... ]

I think I have found at least once obvious bug:

a) this cannot actually compile, pagecache_lock is gone..
b) find_get_page already does locking internally AND also grabs a reference to the page.

This should probably be just a radix_tree_lookup()

Review line 1005

Quoted 8 lines
(quoted diff) +1 -1
@@ -1064,7 +999,7 @@
 	spin_lock(&pagemap_lru_lock);
 	while (--index >= start) {
 		spin_lock(&pagecache_lock);
-		page = __find_page(mapping, index);
+		page = find_get_page(mapping, index);
 		spin_unlock(&pagecache_lock);
 		if (!page || !PageActive(page))
 			break;

The file does compile, and my kernel running now does have the changes I've made. I must be picking up the variable from somewhere else, and I can't say where that is right now. Hmmmm ....

Thanks for looking over the patch. I'll make the change and try things out. Thanks again for working on the radix-tree patches!

Signature · 7 lines
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
 -- Benjamin Franklin, Historical Review of Pennsylvania, 1759
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/