lkml.org 
[lkml]   [2014]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[RFC] discard task stack pages instead of pageout into swap partition
Hi,

I am think of discard stack pages if the old
Page is under the stack pointer(Assume stack grow down)
of the task, This page don't need pageout, we can free it directly,
When the task need it again, we just use a zero page to
Map, it is safe for stack .

But I don't know how to implement it,
And is there some issue if do like this ?

The following is pseudo code to explain my ideas.
Any comments are appreciated !
Thanks
---
diff --git a/mm/vmscan.c b/mm/vmscan.c
index dcb4707..52e8314 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -962,6 +962,12 @@ static unsigned long shrink_page_list(struct list_head *page_list,
; /* try to reclaim the page below */
}

+ if (page_vm_flags(page) & (VM_GROWSUP | VM_GROWSDOWN) &&
+ PageAnon(page) && !PageSwapCache(page)) {
+ if (page_task_is_sleep(page) && task_sp > page->index) {
+ zap_page_range(vma, page->index, PAGE_SIZE);
+ }
+ }
/*
* Anonymous process memory has backing store?
* Try to allocate it some swap space here.
\
 
 \ /
  Last update: 2014-12-12 05:01    [W:0.150 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site