From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758173Ab3BYR1N (ORCPT ); Mon, 25 Feb 2013 12:27:13 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49552 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101Ab3BYR1K convert rfc822-to-8bit (ORCPT ); Mon, 25 Feb 2013 12:27:10 -0500 MIME-Version: 1.0 Message-ID: <622b6670-f311-40d5-9c8d-f5dd3e03633c@default> Date: Mon, 25 Feb 2013 09:20:55 -0800 (PST) From: Dan Magenheimer To: Ric Mason Cc: Minchan Kim , Hugh Dickins , Nitin Gupta , Seth Jennings , Konrad Rzeszutek Wilk , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Subject: RE: Questin about swap_slot free and invalidate page References: <20130131051140.GB23548@blaptop> <20130204024950.GD2688@blaptop> <51236C11.1010208@gmail.com> <1f089254-3abe-4c63-a72a-c9e564ae7d0d@default> <51242F0D.4040201@gmail.com> <7793705b-a076-4c5a-be4d-9572d7560860@default> <5126E253.2030105@gmail.com> In-Reply-To: <5126E253.2030105@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6665.5003 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Ric Mason [mailto:ric.masonn@gmail.com] > Subject: Re: Questin about swap_slot free and invalidate page > > On 02/22/2013 05:42 AM, Dan Magenheimer wrote: > >> From: Ric Mason [mailto:ric.masonn@gmail.com] > >> Subject: Re: Questin about swap_slot free and invalidate page > >> > >> On 02/19/2013 11:27 PM, Dan Magenheimer wrote: > >>>> From: Ric Mason [mailto:ric.masonn@gmail.com] > >>>>> Hugh is right that handling the possibility of duplicates is > >>>>> part of the tmem ABI. If there is any possibility of duplicates, > >>>>> the ABI defines how a backend must handle them to avoid data > >>>>> coherency issues. > >>>>> > >>>>> The kernel implements an in-kernel API which implements the tmem > >>>>> ABI. If the frontend and backend can always agree that duplicate > >>>> Which ABI in zcache implement that? > >>> https://oss.oracle.com/projects/tmem/dist/documentation/api/tmemspec-v001.pdf > >>> > >>> The in-kernel APIs are frontswap and cleancache. For more information about > >>> tmem, see http://lwn.net/Articles/454795/ > >> But you mentioned that you have in-kernel API which can handle > >> duplicate. Do you mean zcache_cleancache/frontswap_put_page? I think > >> they just overwrite instead of optional flush the page on the > >> second(duplicate) put as mentioned in your tmemspec. > > Maybe I am misunderstanding your question... The spec allows > > overwrite (and return success) OR flush the page (and return > > failure). Zcache does the latter (flush). The code that implements > > it is in tmem_put. > > Thanks for your point out. Pers pages can have duplicate put since swap > cache page can be reused. Can eph pages also have duplicate put? If yes, > when can happen? Yes, I have seen it. I am not sure of the exact circumstances when it happens as I am not an expert in the VFS subsystem. (Chris Mason wrote the VFS cleancache hooks in 2009.) Dan