From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhang Yanfei Subject: Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE) Date: Tue, 8 Jul 2014 11:54:12 +0800 Message-ID: <53BB6B64.1080807@cn.fujitsu.com> References: <1404694438-10272-1-git-send-email-minchan@kernel.org> <1404694438-10272-2-git-send-email-minchan@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404694438-10272-2-git-send-email-minchan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Minchan Kim Cc: Andrew Morton , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Michael Kerrisk , Linux API , Hugh Dickins , Johannes Weiner , Rik van Riel , KOSAKI Motohiro , Mel Gorman , Jason Evans , "Kirill A. Shutemov" List-Id: linux-api@vger.kernel.org Hi Minchan, On 07/07/2014 08:53 AM, Minchan Kim wrote: > Linux doesn't have an ability to free pages lazy while other OS > already have been supported that named by madvise(MADV_FREE). > > The gain is clear that kernel can discard freed pages rather than > swapping out or OOM if memory pressure happens. > > Without memory pressure, freed pages would be reused by userspace > without another additional overhead(ex, page fault + allocation > + zeroing). > > How to work is following as. > > When madvise syscall is called, VM clears dirty bit of ptes of > the range. This should be updated because the implementation has been changed. It also remove the page from the swapcache if it is. Thank you for your effort! -- Thanks. Zhang Yanfei From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by kanga.kvack.org (Postfix) with ESMTP id 262276B0031 for ; Mon, 7 Jul 2014 23:54:53 -0400 (EDT) Received: by mail-pa0-f43.google.com with SMTP id lf10so6584915pab.30 for ; Mon, 07 Jul 2014 20:54:52 -0700 (PDT) Received: from heian.cn.fujitsu.com ([59.151.112.132]) by mx.google.com with ESMTP id xj7si42520400pbc.33.2014.07.07.20.54.50 for ; Mon, 07 Jul 2014 20:54:51 -0700 (PDT) Message-ID: <53BB6B64.1080807@cn.fujitsu.com> Date: Tue, 8 Jul 2014 11:54:12 +0800 From: Zhang Yanfei MIME-Version: 1.0 Subject: Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE) References: <1404694438-10272-1-git-send-email-minchan@kernel.org> <1404694438-10272-2-git-send-email-minchan@kernel.org> In-Reply-To: <1404694438-10272-2-git-send-email-minchan@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michael Kerrisk , Linux API , Hugh Dickins , Johannes Weiner , Rik van Riel , KOSAKI Motohiro , Mel Gorman , Jason Evans , "Kirill A. Shutemov" Hi Minchan, On 07/07/2014 08:53 AM, Minchan Kim wrote: > Linux doesn't have an ability to free pages lazy while other OS > already have been supported that named by madvise(MADV_FREE). > > The gain is clear that kernel can discard freed pages rather than > swapping out or OOM if memory pressure happens. > > Without memory pressure, freed pages would be reused by userspace > without another additional overhead(ex, page fault + allocation > + zeroing). > > How to work is following as. > > When madvise syscall is called, VM clears dirty bit of ptes of > the range. This should be updated because the implementation has been changed. It also remove the page from the swapcache if it is. Thank you for your effort! -- Thanks. Zhang Yanfei -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbaGHDy5 (ORCPT ); Mon, 7 Jul 2014 23:54:57 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:21729 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751170AbaGHDyz (ORCPT ); Mon, 7 Jul 2014 23:54:55 -0400 X-IronPort-AV: E=Sophos;i="5.00,854,1396972800"; d="scan'208";a="32974112" Message-ID: <53BB6B64.1080807@cn.fujitsu.com> Date: Tue, 8 Jul 2014 11:54:12 +0800 From: Zhang Yanfei User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131030 Thunderbird/17.0.10 MIME-Version: 1.0 To: Minchan Kim CC: Andrew Morton , , , Michael Kerrisk , Linux API , Hugh Dickins , Johannes Weiner , Rik van Riel , KOSAKI Motohiro , Mel Gorman , Jason Evans , "Kirill A. Shutemov" Subject: Re: [PATCH v10 1/7] mm: support madvise(MADV_FREE) References: <1404694438-10272-1-git-send-email-minchan@kernel.org> <1404694438-10272-2-git-send-email-minchan@kernel.org> In-Reply-To: <1404694438-10272-2-git-send-email-minchan@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.225.89] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Minchan, On 07/07/2014 08:53 AM, Minchan Kim wrote: > Linux doesn't have an ability to free pages lazy while other OS > already have been supported that named by madvise(MADV_FREE). > > The gain is clear that kernel can discard freed pages rather than > swapping out or OOM if memory pressure happens. > > Without memory pressure, freed pages would be reused by userspace > without another additional overhead(ex, page fault + allocation > + zeroing). > > How to work is following as. > > When madvise syscall is called, VM clears dirty bit of ptes of > the range. This should be updated because the implementation has been changed. It also remove the page from the swapcache if it is. Thank you for your effort! -- Thanks. Zhang Yanfei