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 0BF326B0033 for ; Wed, 19 Jun 2013 00:34:17 -0400 (EDT) Date: Wed, 19 Jun 2013 13:34:19 +0900 From: Minchan Kim Subject: Re: [PATCH 7/8] vrange: Add method to purge volatile ranges Message-ID: <20130619043419.GA10961@bbox> References: <1371010971-15647-1-git-send-email-john.stultz@linaro.org> <1371010971-15647-8-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371010971-15647-8-git-send-email-john.stultz@linaro.org> Sender: owner-linux-mm@kvack.org List-ID: To: John Stultz Cc: LKML , Andrew Morton , Android Kernel Team , Robert Love , Mel Gorman , Hugh Dickins , Dave Hansen , Rik van Riel , Dmitry Adamushko , Dave Chinner , Neil Brown , Andrea Righi , Andrea Arcangeli , "Aneesh Kumar K.V" , Mike Hommey , Taras Glek , Dhaval Giani , Jan Kara , KOSAKI Motohiro , Michel Lespinasse , "linux-mm@kvack.org" On Tue, Jun 11, 2013 at 09:22:50PM -0700, John Stultz wrote: > From: Minchan Kim > > This patch adds discarding function to purge volatile ranges under > memory pressure. Logic is as following: > > 1. Memory pressure happens > 2. VM start to reclaim pages > 3. Check the page is in volatile range. > 4. If so, zap the page from the process's page table. > (By semantic vrange(2), we should mark it with another one to > make page fault when you try to access the address. It will > be introduced later patch) > 5. If page is unmapped from all processes, discard it instead of swapping. > > This patch does not address the case where there is no swap, which > keeps anonymous pages from being aged off the LRUs. Minchan has > additional patches that add support for purging anonymous pages > > XXX: First pass at file purging. Seems to work, but is likely broken > and needs close review. > > Cc: Andrew Morton > Cc: Android Kernel Team > Cc: Robert Love > Cc: Mel Gorman > Cc: Hugh Dickins > Cc: Dave Hansen > Cc: Rik van Riel > Cc: Dmitry Adamushko > Cc: Dave Chinner > Cc: Neil Brown > Cc: Andrea Righi > Cc: Andrea Arcangeli > Cc: Aneesh Kumar K.V > Cc: Mike Hommey > Cc: Taras Glek > Cc: Dhaval Giani > Cc: Jan Kara > Cc: KOSAKI Motohiro > Cc: Michel Lespinasse > Cc: Minchan Kim > Cc: linux-mm@kvack.org > Signed-off-by: Minchan Kim > [jstultz: Reworked to add purging of file pages, commit log tweaks] > Signed-off-by: John Stultz > --- > include/linux/rmap.h | 12 +- > include/linux/swap.h | 1 + > include/linux/vrange.h | 7 ++ > mm/ksm.c | 2 +- > mm/rmap.c | 30 +++-- > mm/swapfile.c | 36 ++++++ > mm/vmscan.c | 16 ++- > mm/vrange.c | 332 +++++++++++++++++++++++++++++++++++++++++++++++++ > 8 files changed, 420 insertions(+), 16 deletions(-) This patch has some bugs so below patch should fix them and pass my simple cases.