From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH] mm: implement POSIX_FADV_NOREUSE Date: Wed, 12 Mar 2014 15:46:43 +0100 Message-ID: <20140312144643.GF11831@dhcp22.suse.cz> References: <1394533550-18485-1-git-send-email-matthias.wirth@gmail.com> <20140311140655.GD28292@dhcp22.suse.cz> <531F2ABA.6060804@linux.intel.com> <20140311142729.1e3e4e51186db4c8ee49a9f4@linux-foundation.org> <1394625592.543.52.camel@dinghy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Dave Hansen , Matthias Wirth , Matthew Wilcox , Jeff Layton , "J. Bruce Fields" , Johannes Weiner , Rik van Riel , Lisa Du , Paul Mackerras , Sasha Levin , Benjamin Herrenschmidt , Fengguang Wu , Shaohua Li , Alexey Kardashevskiy , Minchan Kim , "Kirill A. Shutemov" , Al Viro , Steven Whitehouse , Mel Gorman , Cody P Schafer , Jiang Liu , David Rientjes , "Sri To: Lukas Senger Return-path: Content-Disposition: inline In-Reply-To: <1394625592.543.52.camel@dinghy> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Wed 12-03-14 12:59:52, Lukas Senger wrote: > > Why don't you use POSIX_FADV_DONTNEED when you no longer use those > > pages? E.g. on close()? > > Because DONTNEED throws out the pages even if other processes use them > as well, so additional hacks are needed to prevent that (see for > example[1]). OK, that might be indeed to harsh. [...] > Ok, we understand that we can't add a page flag. We tried to find a flag > to recycle but did not succeed. lruvec doesn't have page pointers and we > don't have access to a pagevec and the file struct at the same time. We > don't really understand the last suggestion, as we need to save this > information for more than one page and going over a list every time we > add something to an lru list doesn't seem like a good idea. > > Would it be acceptable to add a member to struct page for our purpose? No, it won't be that easy ;). I think the Andrew's proposal makes sense. Why not simply move the pages to the tail of inactive LRUs. Or another approach might be to drop only those pages from the range which are not mapped by other processes (something like a lite DONTNEED). -- Michal Hocko SUSE Labs -- 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/ . Don't email: email@kvack.org