From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx201.postini.com [74.125.245.201]) by kanga.kvack.org (Postfix) with SMTP id 564646B0044 for ; Thu, 10 May 2012 12:13:26 -0400 (EDT) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q4AGDNnS017326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 May 2012 16:13:24 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q4AGDMQa010780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 May 2012 16:13:23 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q4AGDMVH004452 for ; Thu, 10 May 2012 11:13:22 -0500 MIME-Version: 1.0 Message-ID: <66ea94b0-2e40-44d1-9621-05f2a8257298@default> Date: Thu, 10 May 2012 09:13:03 -0700 (PDT) From: Dan Magenheimer Subject: is there a "lru_cache_add_anon_tail"? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org (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: =09__set_page_locked(new_page); =09SetPageSwapBacked(new_page); =09ret =3D __add_to_swap_cache(new_page, entry); =09if (likely(!ret)) { =09=09radix_tree_preload_end(); =09=09lru_cache_add_anon_XXX(new_page) =09=09if (frontswap_get_page(new_page) =3D 0) =09=09=09SetPageUptodate(new_page); =09=09unlock_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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx162.postini.com [74.125.245.162]) by kanga.kvack.org (Postfix) with SMTP id 93B396B0044 for ; Thu, 10 May 2012 13:32:29 -0400 (EDT) Received: by yenm7 with SMTP id m7so2516009yen.14 for ; Thu, 10 May 2012 10:32:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <66ea94b0-2e40-44d1-9621-05f2a8257298@default> References: <66ea94b0-2e40-44d1-9621-05f2a8257298@default> From: KOSAKI Motohiro Date: Thu, 10 May 2012 13:32:07 -0400 Message-ID: Subject: Re: is there a "lru_cache_add_anon_tail"? Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Dan Magenheimer Cc: linux-mm@kvack.org On Thu, May 10, 2012 at 12:13 PM, 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? > 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx180.postini.com [74.125.245.180]) by kanga.kvack.org (Postfix) with SMTP id CE54B6B004D for ; Thu, 10 May 2012 20:34:30 -0400 (EDT) Message-ID: <4FAC5EA1.5040201@kernel.org> Date: Fri, 11 May 2012 09:34:41 +0900 From: Minchan Kim MIME-Version: 1.0 Subject: Re: is there a "lru_cache_add_anon_tail"? References: <66ea94b0-2e40-44d1-9621-05f2a8257298@default> In-Reply-To: <66ea94b0-2e40-44d1-9621-05f2a8257298@default> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Dan Magenheimer Cc: linux-mm@kvack.org 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: email@kvack.org > 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx142.postini.com [74.125.245.142]) by kanga.kvack.org (Postfix) with SMTP id 39CB98D0001 for ; Fri, 11 May 2012 12:21:33 -0400 (EDT) MIME-Version: 1.0 Message-ID: Date: Fri, 11 May 2012 09:21:10 -0700 (PDT) From: Dan Magenheimer Subject: RE: is there a "lru_cache_add_anon_tail"? References: <66ea94b0-2e40-44d1-9621-05f2a8257298@default> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: KOSAKI Motohiro Cc: linux-mm@kvack.org > From: KOSAKI Motohiro [mailto:kosaki.motohiro@gmail.com] > Subject: Re: is there a "lru_cache_add_anon_tail"? >=20 > On Thu, May 10, 2012 at 12:13 PM, 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? > > >=20 > 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. =20 > 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: email@kvack.org