Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756329Ab2BPAnu (ORCPT ); Wed, 15 Feb 2012 19:43:50 -0500 Received: from mail.betterlinux.com ([199.58.199.50]:59506 "EHLO mail.betterlinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396Ab2BPAnt (ORCPT ); Wed, 15 Feb 2012 19:43:49 -0500 X-DKIM: OpenDKIM Filter v2.4.1 mail.betterlinux.com 77AD5821A8 Date: Thu, 16 Feb 2012 01:43:42 +0100 From: Andrea Righi To: KAMEZAWA Hiroyuki Cc: Andrew Morton , Minchan Kim , Peter Zijlstra , Johannes Weiner , KOSAKI Motohiro , Rik van Riel , Hugh Dickins , Alexander Viro , Shaohua Li , =?iso-8859-1?Q?P=E1draig?= Brady , John Stultz , Jerry James , Julius Plenz , Greg Thelen , linux-mm , linux-fsdevel@vger.kernel.org, LKML Subject: Re: [RFC] [PATCH v5 0/3] fadvise: support POSIX_FADV_NOREUSE Message-ID: <20120216004342.GB21685@thinkpad> References: <1329006098-5454-1-git-send-email-andrea@betterlinux.com> <20120214133337.9de7835b.akpm@linux-foundation.org> <20120214225922.GA12394@thinkpad> <20120214152220.4f621975.akpm@linux-foundation.org> <20120215012957.GA1728@thinkpad> <20120216084831.0a6ef4f2.kamezawa.hiroyu@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120216084831.0a6ef4f2.kamezawa.hiroyu@jp.fujitsu.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2873 Lines: 69 On Thu, Feb 16, 2012 at 08:48:31AM +0900, KAMEZAWA Hiroyuki wrote: > On Wed, 15 Feb 2012 02:35:24 +0100 > Andrea Righi wrote: > > > On Tue, Feb 14, 2012 at 03:22:20PM -0800, Andrew Morton wrote: > > > On Tue, 14 Feb 2012 23:59:22 +0100 > > > Andrea Righi wrote: > > > > > > > On Tue, Feb 14, 2012 at 01:33:37PM -0800, Andrew Morton wrote: > > > > > On Sun, 12 Feb 2012 01:21:35 +0100 > > > > > Andrea Righi wrote: > > > > > And yes, a container-based approach is pretty crude, and one can > > > > > envision applications which only want modified reclaim policy for one > > > > > particualr file. But I suspect an application-wide reclaim policy > > > > > solves 90% of the problems. > > > > > > > > I really like the container-based approach. But for this we need a > > > > better file cache control in the memory cgroup; now we have the > > > > accounting of file pages, but there's no way to limit them. > > > > > > Again, if/whem memcg becomes sufficiently useful for this application > > > we're left maintaining the obsolete POSIX_FADVISE_NOREUSE for ever. > > > > Yes, totally agree. For the future a memcg-based solution is probably > > the best way to go. > > > > This reminds me to the old per-memcg dirty memory discussion > > (http://thread.gmane.org/gmane.linux.kernel.mm/67114), cc'ing Greg. > > > > Maybe the generic feature to provide that could solve both problems is > > a better file cache isolation in memcg. > > > > Can you think of example interface for us ? > I'd like to discuss this in mm-summit if we have a chance. > > Thanks, > -Kame Sure! I'll try to write down more detailed ideas. For now the best interface that I can see is to add something like memory.file.* in cgroupfs. The NOREUSE-like policy that I was trying to implement via fadvise() can be probably implemented by setting memory.file.limit_in_bytes=0 (or using a very small value). A cgroup like this could use any amount of memory (according to the other memory.* settings), but it should drop any file cache page as soon as possible, if the page was not present in memory before. IOW, this cgroup shouldn't disturb the state of the page cache for the other cgroups. Another interesting usage is to provide different levels of service. For example, using different values for memory.file.limit_in_byte would make possible to specify that file cache pages of certain cgroups are reclaimed before others. This would be a very nice feature IMHO, also for those who want to provide different levels of service per-user. Thoughts? Thanks, -Andrea -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/