Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754031AbbGUIgW (ORCPT ); Tue, 21 Jul 2015 04:36:22 -0400 Received: from TYO202.gate.nec.co.jp ([210.143.35.52]:50584 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753850AbbGUIgL convert rfc822-to-8bit (ORCPT ); Tue, 21 Jul 2015 04:36:11 -0400 From: Naoya Horiguchi To: Konstantin Khlebnikov CC: "linux-mm@kvack.org" , Andrew Morton , "Kirill A. Shutemov" , Mark Williamson , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" Subject: Re: [PATCH v4 5/5] pagemap: add mmap-exclusive bit for marking pages mapped only here Thread-Topic: [PATCH v4 5/5] pagemap: add mmap-exclusive bit for marking pages mapped only here Thread-Index: AQHQvksNLItf2COz50uqnHXIsteycJ3lCAeA Date: Tue, 21 Jul 2015 08:17:56 +0000 Message-ID: <20150721081755.GD4490@hori1.linux.bs1.fc.nec.co.jp> References: <20150714152516.29844.69929.stgit@buzz> <20150714153749.29844.81954.stgit@buzz> In-Reply-To: <20150714153749.29844.81954.stgit@buzz> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.29] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <26C19608054104418F64BD8DB1EFF9D9@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 27 On Tue, Jul 14, 2015 at 06:37:49PM +0300, Konstantin Khlebnikov wrote: > This patch sets bit 56 in pagemap if this page is mapped only once. > It allows to detect exclusively used pages without exposing PFN: > > present file exclusive state > 0 0 0 non-present > 1 1 0 file page mapped somewhere else > 1 1 1 file page mapped only here > 1 0 0 anon non-CoWed page (shared with parent/child) > 1 0 1 anon CoWed page (or never forked) > > CoWed pages in (MAP_FILE | MAP_PRIVATE) areas are anon in this context. > > MMap-exclusive bit doesn't reflect potential page-sharing via swapcache: > page could be mapped once but has several swap-ptes which point to it. > Application could detect that by swap bit in pagemap entry and touch > that pte via /proc/pid/mem to get real information. > > Signed-off-by: Konstantin Khlebnikov > Requested-by: Mark Williamson > Link: http://lkml.kernel.org/r/CAEVpBa+_RyACkhODZrRvQLs80iy0sqpdrd0AaP_-tgnX3Y9yNQ@mail.gmail.com Reviewed-by: Naoya Horiguchi -- 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/