Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964828AbbEMKvf (ORCPT ); Wed, 13 May 2015 06:51:35 -0400 Received: from forward-corp1g.mail.yandex.net ([95.108.253.251]:58972 "EHLO forward-corp1g.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933665AbbEMKvd (ORCPT ); Wed, 13 May 2015 06:51:33 -0400 Authentication-Results: smtpcorp1m.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Message-ID: <55532CB0.6070400@yandex-team.ru> Date: Wed, 13 May 2015 13:51:28 +0300 From: Konstantin Khlebnikov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Mark Williamson CC: linux-mm@kvack.org, Naoya Horiguchi , kernel list , Andrew Morton , Pavel Emelyanov , Linux API , Andy Lutomirski , Vlastimil Babka , Pavel Machek , Mark Seaborn , "Kirill A. Shutemov" , Linus Torvalds , Daniel James , Finn Grimwood Subject: Re: [PATCH v2 1/3] pagemap: add mmap-exclusive bit for marking pages mapped only here References: <20150512090156.24768.2521.stgit@buzz> <20150512094303.24768.10282.stgit@buzz> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2205 Lines: 47 On 12.05.2015 15:05, Mark Williamson wrote: > Hi Konstantin, > > I hope you won't mind me thinking out loud here on the idea of adding > a flag to the v2 pagemap fields... From a kernel PoV, I agree that > this seems like the cleanest approach. However, with my application > developer hat on: > > 1. I was hoping we'd be able to backport a compatible fix to older > kernels that might adopt the pagemap permissions change. Using the V2 > format flags rules out doing this for kernels that are too old to have > soft-dirty, I think. > > 2. From our software's PoV, I feel it's worth noting that it doesn't > strictly fix ABI compatibility, though I realise that's probably not > your primary concern here. We'll need to modify our code to write the > clear_refs file but that change is OK for us if it's the preferred > solution. > > In the patches I've been playing with, I was considering putting the > Exclusive flag in the now-unused PFN field of the pagemap entries. > Since we're specifically trying to work around for the lack of PFN > information, would there be any appetite for mirroring this flag > unconditionally into the now-empty PFN field (i.e. whether using v1 or > v2 flags) when accessed by an unprivileged process? > > I realise it's ugly from a kernel PoV and I feel a little bad for > suggesting it - but it would address points 1 and 2 for us (our > existing code just looks for changes in the pagemap entry, so sticking > the flag in there would cause it to do the right thing). > > I'm sorry to raise application-specific issues at this point; I > appreciate that your primary concern is to improve the kernel and > technically I like the approach that you've taken! I'll try and > provide more code-oriented feedback once I've tried out the changes. I prefer to backport v2 format (except soft-dirty bit and clear_refs) into older kernels. Page-shift bits are barely used so nobody will see the difference. -- Konstantin -- 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/