Thread (17 messages) 17 messages, 6 authors, 2012-01-26

Re: [PATCH] mm: preallocate page before lock_page at filemap COW. (WasRe: [PATCH V2] mm: Do not keep page locked during page fault while charging it for memcg

From: Michal Hocko <hidden>
Date: 2011-06-23 13:23:16
Also in: lkml

On Thu 23-06-11 22:01:40, Hiroyuki Kamezawa wrote:
2011/6/23 Michal Hocko [off-list ref]:
quoted
On Thu 23-06-11 19:01:57, KAMEZAWA Hiroyuki wrote:
quoted
On Thu, 23 Jun 2011 11:02:04 +0200
Michal Hocko [off-list ref] wrote:
quoted
On Thu 23-06-11 17:08:11, KAMEZAWA Hiroyuki wrote:
quoted
On Thu, 23 Jun 2011 09:41:33 +0200
Michal Hocko [off-list ref] wrote:
[...]
quoted
quoted
Other than that:
Reviewed-by: Michal Hocko <redacted>
I found the page is added to LRU before charging. (In this case,
memcg's LRU is ignored.) I'll post a new version with a fix.
Yes, you are right. I have missed that.
This means that we might race with reclaim which could evict the COWed
page wich in turn would uncharge that page even though we haven't
charged it yet.

Can we postpone page_add_new_anon_rmap to the charging path or it would
just race somewhere else?
I got a different idea. How about this ?
I think this will have benefit for non-memcg users under OOM, too.
Could you be more specific? I do not see how preallocation which might
turn out to be pointless could help under OOM.
We'll have no page allocation under lock_page() held in this path.
I think it is good.
But it can also cause that the page, we are about to fault in, is evicted
due to allocation so we would have to do a major fault... This is
probably not that serious, though.

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help