From mboxrd@z Thu Jan 1 00:00:00 1970 From: Minchan Kim Subject: Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE) Date: Fri, 13 Nov 2015 15:38:02 +0900 Message-ID: <20151113063802.GF5235@bbox> References: <1447302793-5376-1-git-send-email-minchan@kernel.org> <1447302793-5376-2-git-send-email-minchan@kernel.org> <564421DA.9060809@gmail.com> <20151113061511.GB5235@bbox> <56458056.8020105@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: In-Reply-To: <56458056.8020105-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Content-Disposition: inline Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Daniel Micay Cc: Andy Lutomirski , 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 , Mel Gorman , KOSAKI Motohiro , Jason Evans , "Kirill A. Shutemov" , Shaohua Li , Michal Hocko , yalin wang List-Id: linux-api@vger.kernel.org On Fri, Nov 13, 2015 at 01:16:54AM -0500, Daniel Micay wrote: > On 13/11/15 01:15 AM, Minchan Kim wrote: > > On Thu, Nov 12, 2015 at 12:21:30AM -0500, Daniel Micay wrote: > >>> I also think that the kernel should commit to either zeroing the page > >>> or leaving it unchanged in response to MADV_FREE (even if the decision > >>> of which to do is made later on). I think that your patch series does > >>> this, but only after a few of the patches are applied (the swap entry > >>> freeing), and I think that it should be a real guaranteed part of the > >>> semantics and maybe have a test case. > >> > >> This would be a good thing to test because it would be required to add > >> MADV_FREE_UNDO down the road. It would mean the same semantics as the > >> MEM_RESET and MEM_RESET_UNDO features on Windows, and there's probably > >> value in that for the sake of migrating existing software too. > > > > So, do you mean that we could implement MADV_FREE_UNDO with "read" > > opearation("just access bit marking) easily in future? > > > > If so, it would be good reason to change MADV_FREE from dirty bit to > > access bit. Okay, I will look at that. > > I just meant testing that the data is either zero or the old data if > it's read before it's written to. Not having it stay around once there > is a read. Not sure if that's what Andy meant. Either zero of old data is gauranteed. Now: MADV_FREE(range) A = read from the range ... ... B = read from the range A and B could have different value. But value should be old or zero. But Andy want more strict ABI so he suggested access bit instead of dirty bit. MADV_FREE(range) A = read from the range ... ... B = read from the range A and B cannot have different value. And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO easily when we need it. Maybe, that's what you want. Right? 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 286676B0038 for ; Fri, 13 Nov 2015 01:37:29 -0500 (EST) Received: by pabfh17 with SMTP id fh17so90815903pab.0 for ; Thu, 12 Nov 2015 22:37:28 -0800 (PST) Received: from lgeamrelo11.lge.com (LGEAMRELO11.lge.com. [156.147.23.51]) by mx.google.com with ESMTPS id kn1si25300382pbc.209.2015.11.12.22.37.27 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Nov 2015 22:37:28 -0800 (PST) Date: Fri, 13 Nov 2015 15:38:02 +0900 From: Minchan Kim Subject: Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE) Message-ID: <20151113063802.GF5235@bbox> References: <1447302793-5376-1-git-send-email-minchan@kernel.org> <1447302793-5376-2-git-send-email-minchan@kernel.org> <564421DA.9060809@gmail.com> <20151113061511.GB5235@bbox> <56458056.8020105@gmail.com> MIME-Version: 1.0 In-Reply-To: <56458056.8020105@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Daniel Micay Cc: Andy Lutomirski , Andrew Morton , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Michael Kerrisk , Linux API , Hugh Dickins , Johannes Weiner , Rik van Riel , Mel Gorman , KOSAKI Motohiro , Jason Evans , "Kirill A. Shutemov" , Shaohua Li , Michal Hocko , yalin wang On Fri, Nov 13, 2015 at 01:16:54AM -0500, Daniel Micay wrote: > On 13/11/15 01:15 AM, Minchan Kim wrote: > > On Thu, Nov 12, 2015 at 12:21:30AM -0500, Daniel Micay wrote: > >>> I also think that the kernel should commit to either zeroing the page > >>> or leaving it unchanged in response to MADV_FREE (even if the decision > >>> of which to do is made later on). I think that your patch series does > >>> this, but only after a few of the patches are applied (the swap entry > >>> freeing), and I think that it should be a real guaranteed part of the > >>> semantics and maybe have a test case. > >> > >> This would be a good thing to test because it would be required to add > >> MADV_FREE_UNDO down the road. It would mean the same semantics as the > >> MEM_RESET and MEM_RESET_UNDO features on Windows, and there's probably > >> value in that for the sake of migrating existing software too. > > > > So, do you mean that we could implement MADV_FREE_UNDO with "read" > > opearation("just access bit marking) easily in future? > > > > If so, it would be good reason to change MADV_FREE from dirty bit to > > access bit. Okay, I will look at that. > > I just meant testing that the data is either zero or the old data if > it's read before it's written to. Not having it stay around once there > is a read. Not sure if that's what Andy meant. Either zero of old data is gauranteed. Now: MADV_FREE(range) A = read from the range ... ... B = read from the range A and B could have different value. But value should be old or zero. But Andy want more strict ABI so he suggested access bit instead of dirty bit. MADV_FREE(range) A = read from the range ... ... B = read from the range A and B cannot have different value. And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO easily when we need it. Maybe, that's what you want. Right? -- 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 S1752903AbbKMGhb (ORCPT ); Fri, 13 Nov 2015 01:37:31 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:38031 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbbKMGh2 (ORCPT ); Fri, 13 Nov 2015 01:37:28 -0500 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.150 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Fri, 13 Nov 2015 15:38:02 +0900 From: Minchan Kim To: Daniel Micay CC: Andy Lutomirski , Andrew Morton , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Michael Kerrisk , Linux API , Hugh Dickins , Johannes Weiner , Rik van Riel , Mel Gorman , KOSAKI Motohiro , Jason Evans , "Kirill A. Shutemov" , Shaohua Li , Michal Hocko , yalin wang Subject: Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE) Message-ID: <20151113063802.GF5235@bbox> References: <1447302793-5376-1-git-send-email-minchan@kernel.org> <1447302793-5376-2-git-send-email-minchan@kernel.org> <564421DA.9060809@gmail.com> <20151113061511.GB5235@bbox> <56458056.8020105@gmail.com> MIME-Version: 1.0 In-Reply-To: <56458056.8020105@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP3HF583 | August 9, 2013) at 2015/11/13 15:37:24, Serialize by Router on LGEKRMHUB04/LGE/LG Group(Release 8.5.3FP3HF583 | August 9, 2013) at 2015/11/13 15:37:24, Serialize complete at 2015/11/13 15:37:24 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 13, 2015 at 01:16:54AM -0500, Daniel Micay wrote: > On 13/11/15 01:15 AM, Minchan Kim wrote: > > On Thu, Nov 12, 2015 at 12:21:30AM -0500, Daniel Micay wrote: > >>> I also think that the kernel should commit to either zeroing the page > >>> or leaving it unchanged in response to MADV_FREE (even if the decision > >>> of which to do is made later on). I think that your patch series does > >>> this, but only after a few of the patches are applied (the swap entry > >>> freeing), and I think that it should be a real guaranteed part of the > >>> semantics and maybe have a test case. > >> > >> This would be a good thing to test because it would be required to add > >> MADV_FREE_UNDO down the road. It would mean the same semantics as the > >> MEM_RESET and MEM_RESET_UNDO features on Windows, and there's probably > >> value in that for the sake of migrating existing software too. > > > > So, do you mean that we could implement MADV_FREE_UNDO with "read" > > opearation("just access bit marking) easily in future? > > > > If so, it would be good reason to change MADV_FREE from dirty bit to > > access bit. Okay, I will look at that. > > I just meant testing that the data is either zero or the old data if > it's read before it's written to. Not having it stay around once there > is a read. Not sure if that's what Andy meant. Either zero of old data is gauranteed. Now: MADV_FREE(range) A = read from the range ... ... B = read from the range A and B could have different value. But value should be old or zero. But Andy want more strict ABI so he suggested access bit instead of dirty bit. MADV_FREE(range) A = read from the range ... ... B = read from the range A and B cannot have different value. And now I am thinking if we use access bit, we could implment MADV_FREE_UNDO easily when we need it. Maybe, that's what you want. Right?