From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969717AbdAETXk (ORCPT ); Thu, 5 Jan 2017 14:23:40 -0500 Received: from mga09.intel.com ([134.134.136.24]:19355 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937990AbdAETWf (ORCPT ); Thu, 5 Jan 2017 14:22:35 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,322,1477983600"; d="scan'208";a="1079632298" From: Dave Hansen Subject: Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI) To: Khalid Aziz , Rob Gardner , davem@davemloft.net, corbet@lwn.net, arnd@arndb.de, akpm@linux-foundation.org References: <1483569999-13543-1-git-send-email-khalid.aziz@oracle.com> <6fcaab9f-40fb-fdfb-2c7e-bf21a862ab7c@linux.intel.com> <8612e7db-97c5-f757-0aae-24c3acedbc29@oracle.com> <2c0502d0-20ef-44ac-db5b-7f651a70b978@linux.intel.com> <5a0270ea-b29a-0751-a27f-2412a8588561@oracle.com> <7532a1d6-6562-b10b-dacd-931cb2a9e536@linux.intel.com> <92d55a69-b400-8461-53a1-d505de089700@oracle.com> Cc: hpa@zytor.com, viro@zeniv.linux.org.uk, nitin.m.gupta@oracle.com, chris.hyser@oracle.com, tushar.n.dave@oracle.com, sowmini.varadhan@oracle.com, mike.kravetz@oracle.com, adam.buchbinder@gmail.com, minchan@kernel.org, hughd@google.com, kirill.shutemov@linux.intel.com, keescook@chromium.org, allen.pais@oracle.com, aryabinin@virtuozzo.com, atish.patra@oracle.com, joe@perches.com, pmladek@suse.com, jslaby@suse.cz, cmetcalf@mellanox.com, paul.gortmaker@windriver.com, mhocko@suse.com, jmarchan@redhat.com, lstoakes@gmail.com, 0x7f454c46@gmail.com, vbabka@suse.cz, tglx@linutronix.de, mingo@redhat.com, dan.j.williams@intel.com, iamjoonsoo.kim@lge.com, mgorman@techsingularity.net, vdavydov.dev@gmail.com, hannes@cmpxchg.org, namit@vmware.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org, Khalid Aziz Message-ID: <75c31c99-cff7-72dc-f593-012fe5acd405@linux.intel.com> Date: Thu, 5 Jan 2017 11:22:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <92d55a69-b400-8461-53a1-d505de089700@oracle.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/2017 04:26 PM, Khalid Aziz wrote: ... > No, we do not have space to stuff PAGE_SIZE/64 version tags in swap pte. > There is enough space for just one tag per page. DaveM had suggested > doing this since the usual case is for a task to set one tag per page > even though MMU does not require it. I have implemented this as first > pass to start a discussion and get feedback on whether rest of the > swapping implementation and other changes look right, hence the patch is > "RFC". If this all looks good, I can expand swapping support in a > subsequent patch or iteration of this patch to allocate space in > mm_context_t possibly to store per cacheline tags. I am open to any > other ideas on storing this larger number of version tags. FWIW, This is the kind of thing that would be really useful to point out to reviewers instead of requiring them to ferret it out of the code. It has huge implications for how applications use this feature. As for where to store the tags... It's potentially a *lot* of data, so I think it'll be a pain any way you do it. If you, instead, can live with doing things on a PAGE_SIZE granularity like pkeys does, you could just store it in the VMA and have the kernel tag the data at the same time it zeroes the pages.