* is there a "lru_cache_add_anon_tail"?
@ 2012-05-10 16:13 Dan Magenheimer
2012-05-10 17:32 ` KOSAKI Motohiro
2012-05-11 0:34 ` Minchan Kim
0 siblings, 2 replies; 4+ messages in thread
From: Dan Magenheimer @ 2012-05-10 16:13 UTC (permalink / raw)
To: linux-mm
(Still working on allowing zcache to "evict" swap pages...)
Apologies if I got head/tail reversed as used by the
lru queues... the "directional sense" of the queues is
not obvious so I'll describe using different terminology...
If I have an anon page and I would like to add it to
the "reclaim soonest" end of the queue instead of the
"most recently used so don't reclaim it for a long time"
end of the queue, does an equivalent function similar to
lru_cache_add_anon(page) exist?
In other words, I want this dirty anon page to be
swapped out ASAP.
If no such function exists, can anyone more familiar
with the VM LRU queues suggest the code for
this function "lru_cache_add_anon_XXX(page)?
Also what would be the proper text for XXX?
I have some (experimental) code now to use it so
could iterate/debug with any suggested code. The
calling snippet is:
__set_page_locked(new_page);
SetPageSwapBacked(new_page);
ret = __add_to_swap_cache(new_page, entry);
if (likely(!ret)) {
radix_tree_preload_end();
lru_cache_add_anon_XXX(new_page)
if (frontswap_get_page(new_page) = 0)
SetPageUptodate(new_page);
unlock_page(new_page);
This works using a call to the existing lru_cache_add_anon
but new_page doesn't get swapped out for a long time.
Thanks for any help/suggestions!
Dan
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: is there a "lru_cache_add_anon_tail"?
2012-05-10 16:13 is there a "lru_cache_add_anon_tail"? Dan Magenheimer
@ 2012-05-10 17:32 ` KOSAKI Motohiro
2012-05-11 16:21 ` Dan Magenheimer
2012-05-11 0:34 ` Minchan Kim
1 sibling, 1 reply; 4+ messages in thread
From: KOSAKI Motohiro @ 2012-05-10 17:32 UTC (permalink / raw)
To: Dan Magenheimer; +Cc: linux-mm
On Thu, May 10, 2012 at 12:13 PM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
> (Still working on allowing zcache to "evict" swap pages...)
>
> Apologies if I got head/tail reversed as used by the
> lru queues... the "directional sense" of the queues is
> not obvious so I'll describe using different terminology...
>
> If I have an anon page and I would like to add it to
> the "reclaim soonest" end of the queue instead of the
> "most recently used so don't reclaim it for a long time"
> end of the queue, does an equivalent function similar to
> lru_cache_add_anon(page) exist?
>
AFAIK, no exist.
rotate_reclaimable_page() has similar requirement, but I doubt
you can reuse it. maybe you need new function by yourself.
But note, many people dislike add_anon_tail feature. -ck patch had
swap prefetch patch and it made performance decrease. I'm not
sure it is good improvemnt for zcache....
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: is there a "lru_cache_add_anon_tail"?
2012-05-10 16:13 is there a "lru_cache_add_anon_tail"? Dan Magenheimer
2012-05-10 17:32 ` KOSAKI Motohiro
@ 2012-05-11 0:34 ` Minchan Kim
1 sibling, 0 replies; 4+ messages in thread
From: Minchan Kim @ 2012-05-11 0:34 UTC (permalink / raw)
To: Dan Magenheimer; +Cc: linux-mm
On 05/11/2012 01:13 AM, Dan Magenheimer wrote:
> (Still working on allowing zcache to "evict" swap pages...)
>
> Apologies if I got head/tail reversed as used by the
> lru queues... the "directional sense" of the queues is
> not obvious so I'll describe using different terminology...
>
> If I have an anon page and I would like to add it to
> the "reclaim soonest" end of the queue instead of the
> "most recently used so don't reclaim it for a long time"
> end of the queue, does an equivalent function similar to
> lru_cache_add_anon(page) exist?
Nope.
>
> In other words, I want this dirty anon page to be
> swapped out ASAP.
Why do you want to do that at the cost of ignoring of LRU ordering?
>
> If no such function exists, can anyone more familiar
> with the VM LRU queues suggest the code for
> this function "lru_cache_add_anon_XXX(page)?
> Also what would be the proper text for XXX?
tail
>
> I have some (experimental) code now to use it so
> could iterate/debug with any suggested code. The
> calling snippet is:
>
> __set_page_locked(new_page);
> SetPageSwapBacked(new_page);
> ret = __add_to_swap_cache(new_page, entry);
> if (likely(!ret)) {
> radix_tree_preload_end();
> lru_cache_add_anon_XXX(new_page)
> if (frontswap_get_page(new_page) = 0)
> SetPageUptodate(new_page);
> unlock_page(new_page);
>
> This works using a call to the existing lru_cache_add_anon
> but new_page doesn't get swapped out for a long time.
Yes. it's to add the page to "most recently used so don't reclaim it for a long time" in your terms.
Adding new lru_cache_add_anon_tail isn't difficult but we need justification why we should do.
>
> Thanks for any help/suggestions!
> Dan
>
> --
> 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=ilto:"dont@kvack.org"> email@kvack.org </a>
>
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
--
Kind regards,
Minchan Kim
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: is there a "lru_cache_add_anon_tail"?
2012-05-10 17:32 ` KOSAKI Motohiro
@ 2012-05-11 16:21 ` Dan Magenheimer
0 siblings, 0 replies; 4+ messages in thread
From: Dan Magenheimer @ 2012-05-11 16:21 UTC (permalink / raw)
To: KOSAKI Motohiro; +Cc: linux-mm
> From: KOSAKI Motohiro [mailto:kosaki.motohiro@gmail.com]
> Subject: Re: is there a "lru_cache_add_anon_tail"?
>
> On Thu, May 10, 2012 at 12:13 PM, Dan Magenheimer
> <dan.magenheimer@oracle.com> wrote:
> > (Still working on allowing zcache to "evict" swap pages...)
> >
> > Apologies if I got head/tail reversed as used by the
> > lru queues... the "directional sense" of the queues is
> > not obvious so I'll describe using different terminology...
> >
> > If I have an anon page and I would like to add it to
> > the "reclaim soonest" end of the queue instead of the
> > "most recently used so don't reclaim it for a long time"
> > end of the queue, does an equivalent function similar to
> > lru_cache_add_anon(page) exist?
> >
>
> AFAIK, no exist.
> rotate_reclaimable_page() has similar requirement, but I doubt
> you can reuse it. maybe you need new function by yourself.
Thanks for the pointer! It looks like I can extract
the code I need from there.
> But note, many people dislike add_anon_tail feature. -ck patch had
> swap prefetch patch and it made performance decrease. I'm not
> sure it is good improvemnt for zcache....
I understand. I think it does make sense for this
usage in zcache but will describe it when I am ready
to post an RFC.
Thanks,
Dan
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-11 16:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-10 16:13 is there a "lru_cache_add_anon_tail"? Dan Magenheimer
2012-05-10 17:32 ` KOSAKI Motohiro
2012-05-11 16:21 ` Dan Magenheimer
2012-05-11 0:34 ` Minchan Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).