Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbbKLFVi (ORCPT ); Thu, 12 Nov 2015 00:21:38 -0500 Received: from mail-ig0-f170.google.com ([209.85.213.170]:36645 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751084AbbKLFVh (ORCPT ); Thu, 12 Nov 2015 00:21:37 -0500 Subject: Re: [PATCH v3 01/17] mm: support madvise(MADV_FREE) To: Andy Lutomirski , Minchan Kim References: <1447302793-5376-1-git-send-email-minchan@kernel.org> <1447302793-5376-2-git-send-email-minchan@kernel.org> Cc: 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 From: Daniel Micay X-Enigmail-Draft-Status: N1110 Message-ID: <564421DA.9060809@gmail.com> Date: Thu, 12 Nov 2015 00:21:30 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Se18ghPEcLHSaaDiqlU3mG3BW3BwKGCDu" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2889 Lines: 72 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Se18ghPEcLHSaaDiqlU3mG3BW3BwKGCDu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > 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. For one example, it could be dropped into Firefox: https://dxr.mozilla.org/mozilla-central/source/memory/volatile/VolatileBu= fferWindows.cpp And in Chromium: https://code.google.com/p/chromium/codesearch#chromium/src/base/memory/di= scardable_shared_memory.cc Worth noting that both also support the API for pinning/unpinning that's used by Android's ashmem too. Linux really needs a feature like this for caches. Firefox simply doesn't drop the memory at all on Linux right now:= https://dxr.mozilla.org/mozilla-central/source/memory/volatile/VolatileBu= fferFallback.cpp (Lock =3D=3D pin, Unlock =3D=3D unpin) For reference: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=3Dvs.= 85).aspx --Se18ghPEcLHSaaDiqlU3mG3BW3BwKGCDu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWRCHeAAoJEPnnEuWa9fIqwfoP/i3+X7dS4t4/swOr7e4brAqt ZhBVZcywBqWLWfrDka8JUtM8lFW5c3AlYBVXsPEXJytuGdz9lm8Ct+gJTJrzQ1mg DF1mAq6MD+DWgI5094kQJvERR1MRfR5KyH9kGQlEOSsMIWlG2uyIMmA9oCZINDSZ 0OB7fEAtXe/DLSVtisIvH9Uybeem6MHnaKJmHrtvIiKuVn9hnfvjG7KByIc+jvBi w+zyXQSkmgzSFdGexyANCdfdqvZqVAKKO18HQ//n+9nPzPNmC+9sfUFByUWGocJz bGNxvWzfEIZJC/Xu+kBgq/mZHDttPMnF18zO2MWnMH4op7m3YvCt4GPXzX1MmDHa IpAlqp+KOmEZ8kSuHQ3joqcx/IB4n+amoF6sUOT2Qw6HPVhSHg0yLhovB4D4vnGh 2OdLCqNsH8viYHty4hLgHV9M+QWMthE+sSENM3T08/kbCfnzcypkOx5d5D0iNAc6 qgpFY6O/2MYmqC0VkX41QEuhopB18PdYa9n56Yo3nVnbbVEWqEpeSWHRCZ6j6Oib ojzxVnDQpDJzm85HtA2rVnRqk9Ryis2168cbS7ZoOXLXjPUhViVHNyy5fMCowTcg pEdz7Baaiq8R0Iuo/DZCKwtjGM/ocePEmguKM8i31pwCKXqf+TPBSBS1VYIpUJf7 z8BjttnxfZThV8goqQDy =l8YU -----END PGP SIGNATURE----- --Se18ghPEcLHSaaDiqlU3mG3BW3BwKGCDu-- -- 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/