Skip to contentSkip to conversation

undo the brd.c part of ramfs-and-ram-disk-pages-are-unevictable.patch

PATCH In review Rik van Riel 3 participants 4 messages Jun 12, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 undo the brd.c part of ramfs-and-ram-disk-pages-are-unevictable.patch

Undo the brd.c part of ramfs-and-ram-disk-pages-are-unevictable.patch. The brd pages do not live on the LRU at all, so there is no need to play these tricks.

---
 drivers/block/brd.c |   13 -------------
 1 file changed, 13 deletions(-)
drivers/block/brd.c +0 -13
Index: linux-2.6.26-rc5-mm2/drivers/block/brd.c
===================================================================
@@ -374,21 +374,8 @@ static int brd_ioctl(struct inode *inode
 	return error;
 }
 
-/*
- * brd_open():
- * Just mark the mapping as containing unevictable pages
- */
-static int brd_open(struct inode *inode, struct file *filp)
-{
-	struct address_space *mapping = inode->i_mapping;
-
-	mapping_set_unevictable(mapping);
-	return 0;
-}
-
 static struct block_device_operations brd_fops = {
 	.owner =		THIS_MODULE,
-	.open  =		brd_open,
 	.ioctl =		brd_ioctl,
 #ifdef CONFIG_BLK_DEV_XIP
 	.direct_access =	brd_direct_access,
#1 lore raw
Quoted 3 lines · Rik van Riel

Undo the brd.c part of ramfs-and-ram-disk-pages-are-unevictable.patch. The brd pages do not live on the LRU at all, so there is no need to play these tricks.

Does this mean that these pages cannot be migrated? E.g., to evacuate memory for hotplug? Looks like all paths to migrate_pages() construct a list of pages to migrate by isolating them from the lru [isolate_lru_page()]. Any pages not found in the lru are skipped.

Lee

Quoted 35 lines
---
 drivers/block/brd.c |   13 -------------
 1 file changed, 13 deletions(-)

Index: linux-2.6.26-rc5-mm2/drivers/block/brd.c
===================================================================

drivers/block/brd.c +0 -13
@@ -374,21 +374,8 @@ static int brd_ioctl(struct inode *inode
 	return error;
 }
 
-/*
- * brd_open():
- * Just mark the mapping as containing unevictable pages
- */
-static int brd_open(struct inode *inode, struct file *filp)
-{
-	struct address_space *mapping = inode->i_mapping;
-
-	mapping_set_unevictable(mapping);
-	return 0;
-}
-
 static struct block_device_operations brd_fops = {
 	.owner =		THIS_MODULE,
-	.open  =		brd_open,
 	.ioctl =		brd_ioctl,
 #ifdef CONFIG_BLK_DEV_XIP
 	.direct_access =	brd_direct_access,
#2 lore raw
Quoted 9 lines · On Thu, 12 Jun 2008 15:00:57 -0400 Lee Schermerhorn <[email protected]>…
Quoted 3 lines · Rik van Riel

Undo the brd.c part of ramfs-and-ram-disk-pages-are-unevictable.patch. The brd pages do not live on the LRU at all, so there is no need to play these tricks.

Does this mean that these pages cannot be migrated? E.g., to evacuate memory for hotplug? Looks like all paths to migrate_pages() construct a list of pages to migrate by isolating them from the lru [isolate_lru_page()]. Any pages not found in the lru are skipped.

It looks like that, indeed.

Signature · 1 line
All Rights Reversed
#3 lore raw
In reply to Lee Schermerhorn
Quoted 9 lines · Lee Schermerhorn
Quoted 3 lines · Rik van Riel

Undo the brd.c part of ramfs-and-ram-disk-pages-are-unevictable.patch. The brd pages do not live on the LRU at all, so there is no need to play these tricks.

Does this mean that these pages cannot be migrated? E.g., to evacuate memory for hotplug? Looks like all paths to migrate_pages() construct a list of pages to migrate by isolating them from the lru [isolate_lru_page()]. Any pages not found in the lru are skipped.

Yes. They have nothing to do with user pages or pagecache pages at all really. brd is now a properly layered block device driver that does not know anything about buffer cache ;)

You can think of the pages it allocates as completely private, and they are used to implement the backing store for the block device.

The vm/fs layers will instantiate buffer cache over this device, which is reclaimable.