From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI) Date: Fri, 6 Jan 2017 08:55:03 -0800 Message-ID: References: <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> <75c31c99-cff7-72dc-f593-012fe5acd405@linux.intel.com> <7fbc4ca1-22ef-8ef5-5c1b-dd075852e512@oracle.com> <20170106091934.GF5556@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: Khalid Aziz , Michal Hocko Cc: Rob Gardner , davem@davemloft.net, corbet@lwn.net, arnd@arndb.de, akpm@linux-foundation.org, 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, 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, vdav List-Id: linux-arch.vger.kernel.org On 01/06/2017 08:22 AM, Khalid Aziz wrote: > On 01/06/2017 08:36 AM, Dave Hansen wrote: >> On 01/06/2017 07:32 AM, Khalid Aziz wrote: >>> I agree with you on simplicity first. Subpage granularity is complex, >>> but the architecture allows for subpage granularity. Maybe the right >>> approach is to support this at page granularity first for swappable >>> pages and then expand to subpage granularity in a subsequent patch? >>> Pages locked in memory can already use subpage granularity with my >>> patch. >> >> What do you mean by "locked in memory"? mlock()'d memory can still be >> migrated around and still requires "swap" ptes, for instance. > > You are right. Page migration can invalidate subpage granularity even > for locked pages. Is it possible to use cpusets to keep a task and its > memory locked on a single node? It's going to be hard to impossible to guarantee. mlock() doesn't guarantee that things won't change physical addresses. You'd have to change that guarantee or chase all the things in the kernel that might change physical addresses (compaction, ksm, etc...). Actually, that reminds me... How does your code interface with ksm? Or is there no interaction needed since you're always working on virtual addresses? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com ([192.55.52.43]:23397 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937085AbdAFQzF (ORCPT ); Fri, 6 Jan 2017 11:55:05 -0500 Subject: Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI) References: <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> <75c31c99-cff7-72dc-f593-012fe5acd405@linux.intel.com> <7fbc4ca1-22ef-8ef5-5c1b-dd075852e512@oracle.com> <20170106091934.GF5556@dhcp22.suse.cz> From: Dave Hansen Message-ID: Date: Fri, 6 Jan 2017 08:55:03 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Khalid Aziz , Michal Hocko Cc: Rob Gardner , davem@davemloft.net, corbet@lwn.net, arnd@arndb.de, akpm@linux-foundation.org, 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, 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: <20170106165503.uGWpo9uRBSHxTI7hc5MeBPhgD7f5CzLPbkU2FDB1SX0@z> On 01/06/2017 08:22 AM, Khalid Aziz wrote: > On 01/06/2017 08:36 AM, Dave Hansen wrote: >> On 01/06/2017 07:32 AM, Khalid Aziz wrote: >>> I agree with you on simplicity first. Subpage granularity is complex, >>> but the architecture allows for subpage granularity. Maybe the right >>> approach is to support this at page granularity first for swappable >>> pages and then expand to subpage granularity in a subsequent patch? >>> Pages locked in memory can already use subpage granularity with my >>> patch. >> >> What do you mean by "locked in memory"? mlock()'d memory can still be >> migrated around and still requires "swap" ptes, for instance. > > You are right. Page migration can invalidate subpage granularity even > for locked pages. Is it possible to use cpusets to keep a task and its > memory locked on a single node? It's going to be hard to impossible to guarantee. mlock() doesn't guarantee that things won't change physical addresses. You'd have to change that guarantee or chase all the things in the kernel that might change physical addresses (compaction, ksm, etc...). Actually, that reminds me... How does your code interface with ksm? Or is there no interaction needed since you're always working on virtual addresses?