linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid.aziz@oracle.com>
To: Dave Hansen <dave.hansen@linux.intel.com>,
	akpm@linux-foundation.org, davem@davemloft.net, arnd@arndb.de
Cc: kirill.shutemov@linux.intel.com, mhocko@suse.com,
	ross.zwisler@linux.intel.com, dave.jiang@intel.com,
	mgorman@techsingularity.net, willy@infradead.org,
	hughd@google.com, minchan@kernel.org, hannes@cmpxchg.org,
	shli@fb.com, mingo@kernel.org, jglisse@redhat.com, me@tobin.cc,
	anthony.yznaga@oracle.com, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	sparclinux@vger.kernel.org, Khalid Aziz <khalid@gonehiking.org>
Subject: Re: [PATCH v12 02/11] mm, swap: Add infrastructure for saving page metadata on swap
Date: Mon, 5 Mar 2018 14:14:39 -0700	[thread overview]
Message-ID: <b55a493a-3401-b493-d9fe-b873878e02e0@oracle.com> (raw)
In-Reply-To: <0709b55b-3b77-ba43-efbc-6f767714a0b7@linux.intel.com>

On 03/05/2018 02:04 PM, Dave Hansen wrote:
> On 03/05/2018 12:28 PM, Khalid Aziz wrote:
>>> Do you have a way to tell that data is not being thrown away?A  Like if
>>> the ADI metadata is different for two different cachelines within a
>>> single page?
>>
>> Yes, since access to tagged data is made using pointers with ADI tag
>> embedded in the top bits, any mismatch between what app thinks the ADI
>> tags should be and what is stored in the RAM for corresponding page will
>> result in exception. If ADI data gets thrown away, we will get an ADI
>> tag mismatch exception. If ADI tags for two different ADI blocks on a
>> page are different when app expected them to be the same, we will see an
>> exception on access to the block with wrong ADI data.
> 
> So, when an app has two different ADI tags on two parts of a page, the
> page gets swapped, and the ADI block size is under PAGE_SIZE, the app
> will get an ADI exception after swap-in through no fault of its own?
> 

Only if the kernel fails to re-establish ADI tags on the swapped in page 
which is why I added infrastructure to save the ADI tags for a page 
before it is swapped out and then re-establish those tags when the page 
is swapped back in. Kernel needs to save as many as ADI TAGS as may 
exist on each page, not just one tag per page. On sparc M7 8K pages, 
there are 128 ADI tags for the page, so kernel will store and restore 
128 ADI tags for each page on swap-out and swap-in. If kernel restores 
only one ADI tag for the page on swap in, app will get an exception and 
it will be kernel's fault.

--
Khalid

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2018-03-05 21:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 17:15 [PATCH v12 00/11] Application Data Integrity feature introduced by SPARC M7 Khalid Aziz
2018-02-21 17:15 ` [PATCH v12 02/11] mm, swap: Add infrastructure for saving page metadata on swap Khalid Aziz
2018-03-05 19:20   ` Dave Hansen
2018-03-05 19:29     ` Khalid Aziz
2018-03-05 19:35       ` Dave Hansen
2018-03-05 20:28         ` Khalid Aziz
2018-03-05 21:04           ` Dave Hansen
2018-03-05 21:14             ` Khalid Aziz [this message]
2018-03-06 22:47   ` Andrew Morton
2018-02-21 17:15 ` [PATCH v12 07/11] mm: Add address parameter to arch_validate_prot() Khalid Aziz
2018-02-26  5:54   ` Michael Ellerman
2018-03-06 22:48   ` Andrew Morton
2018-02-21 17:15 ` [PATCH v12 08/11] mm: Clear arch specific VM flags on protection change Khalid Aziz
2018-03-05 19:23   ` Dave Hansen
2018-03-05 20:38     ` Khalid Aziz
2018-03-06 22:48   ` Andrew Morton
2018-02-21 17:15 ` [PATCH v12 09/11] mm: Allow arch code to override copy_highpage() Khalid Aziz
2018-03-05 19:24   ` Dave Hansen
2018-03-05 20:42     ` Khalid Aziz
2018-03-05 20:56       ` Dave Hansen
2018-03-06 22:48   ` Andrew Morton
2018-02-21 17:15 ` [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity) Khalid Aziz
2018-02-23  2:50   ` kbuild test robot
2018-02-23 18:51     ` Khalid Aziz
2018-02-23 18:57       ` David Miller
2018-02-23 22:11         ` Khalid Aziz
2018-03-05 19:22   ` Dave Hansen
2018-03-05 21:14     ` Khalid Aziz
2018-03-05 21:26       ` Dave Hansen
2018-03-05 21:31       ` Dave Hansen
2018-03-05 22:55         ` Khalid Aziz
2018-03-05 21:26   ` Dave Hansen
2018-03-05 21:37     ` Khalid Aziz
2018-03-05 21:50       ` Dave Hansen
2018-03-18 15:08 ` [PATCH v12 00/11] Application Data Integrity feature introduced by SPARC M7 David Miller
2018-03-19 15:19   ` Khalid Aziz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b55a493a-3401-b493-d9fe-b873878e02e0@oracle.com \
    --to=khalid.aziz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=anthony.yznaga@oracle.com \
    --cc=arnd@arndb.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=davem@davemloft.net \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=jglisse@redhat.com \
    --cc=khalid@gonehiking.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=me@tobin.cc \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=shli@fb.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).