linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid.aziz@oracle.com>
To: Anthony Yznaga <anthony.yznaga@oracle.com>
Cc: David Miller <davem@davemloft.net>,
	dave.hansen@linux.intel.com, corbet@lwn.net,
	Bob Picco <bob.picco@oracle.com>,
	STEVEN_SISTARE <steven.sistare@oracle.com>,
	Pasha Tatashin <pasha.tatashin@oracle.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Rob Gardner <rob.gardner@oracle.com>,
	mingo@kernel.org, Nitin Gupta <nitin.m.gupta@oracle.com>,
	kirill.shutemov@linux.intel.com,
	Tom Hromatka <tom.hromatka@oracle.com>,
	Eric Saint Etienne <eric.saint.etienne@oracle.com>,
	Allen Pais <allen.pais@oracle.com>,
	cmetcalf@mellanox.com, akpm@linux-foundation.org,
	geert@linux-m68k.org, pmladek@suse.com, tklauser@distanz.ch,
	Atish Patra <atish.patra@oracle.com>,
	Shannon Nelson <shannon.nelson@oracle.com>,
	Vijay Kumar <vijay.ac.kumar@oracle.com>,
	peterz@infradead.org, mhocko@suse.com, jack@suse.cz,
	lstoakes@gmail.com, punit.agrawal@arm.com, hughd@google.com,
	thomas.tai@oracle.com, paul.gortmaker@windriver.com,
	ross.zwisler@linux.intel.com, dave.jiang@intel.com,
	willy@infradead.org, ying.huang@intel.com, zhongjiang@huawei.com,
	minchan@kernel.org, imbrenda@linux.vnet.ibm.com,
	aneesh.kumar@linux.vnet.ibm.com, aarcange@redhat.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	Khalid Aziz <khalid@gonehiking.org>
Subject: Re: [PATCH v8 9/9] sparc64: Add support for ADI (Application Data Integrity)
Date: Fri, 13 Oct 2017 10:18:34 -0600	[thread overview]
Message-ID: <ce3a91db-0fa0-8dda-492d-2ddd281070a7@oracle.com> (raw)
In-Reply-To: <44c3473b-a8fb-197e-7fd3-03613569f339@oracle.com>

On 10/13/2017 08:14 AM, Khalid Aziz wrote:
> On 10/12/2017 02:27 PM, Anthony Yznaga wrote:
>>
>>> On Oct 12, 2017, at 7:44 AM, Khalid Aziz <khalid.aziz@oracle.com> wrote:
>>>
>>>
>>> On 10/06/2017 04:12 PM, Anthony Yznaga wrote:
>>>>> On Sep 25, 2017, at 9:49 AM, Khalid Aziz <khalid.aziz@oracle.com> 
>>>>> wrote:
>>>>>
>>>>> This patch extends mprotect to enable ADI (TSTATE.mcde), 
>>>>> enable/disable
>>>>> MCD (Memory Corruption Detection) on selected memory ranges, enable
>>>>> TTE.mcd in PTEs, return ADI parameters to userspace and 
>>>>> save/restore ADI
>>>>> version tags on page swap out/in or migration. ADI is not enabled by
>>>> I still don't believe migration is properly supported.A  Your
>>>> implementation is relying on a fault happening on a page while its
>>>> migration is in progress so that do_swap_page() will be called, but
>>>> I don't see how do_swap_page() will be called if a fault does not
>>>> happen until after the migration has completed.
>>>
>>> User pages are on LRU list and for the mapped pages on LRU list, 
>>> migrate_pages() ultimately calls try_to_unmap_one and makes a 
>>> migration swap entry for the page being migrated. This forces a page 
>>> fault upon access on the destination node and the page is swapped 
>>> back in from swap cache. The fault is forced by the migration swap 
>>> entry, rather than fault being an accidental event. If page fault 
>>> happens on the destination node while migration is in progress, 
>>> do_swap_page() waits until migration is done. Please take a look at 
>>> the code in __unmap_and_move().
>>
>> I looked at the code again, and I now believe ADI tags are never 
>> restored for migrated pages.A  Here's why:
>>
> 
> I will take a look at it again. I have run extensive tests migrating 
> pages of a process across multiple NUMA nodes over and over again and 
> ADI tags were never lost, so this does work. I won't rule out the 
> possibility of having missed a code path where tags are not restored and 
> I will look for it.

Anthony,

I just ran my migration test again which:

- malloc's 16 GB of memory
- Assigns a rotating ADI tag every 64 bytes to the malloc'd buffer
- Writes a pattern to the entire buffer
- Verifies the pattern it wrote using ADI tagged addresses.

While this test was running, I had a script migrate test program pages 
across two NUMA nodes every 30 seconds using migratepages command. I did 
not see an ADI tag mismatch over multiple runs of this test. This test 
shows migration is working.

Can you give me a test that shows the failure you think we should see 
and I will debug it.

Thanks,
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:[~2017-10-13 16:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 16:48 [PATCH v8 0/9] Application Data Integrity feature introduced by SPARC M7 Khalid Aziz
2017-09-25 16:48 ` [PATCH v8 2/9] mm, swap: Add infrastructure for saving page metadata as well on swap Khalid Aziz
2017-09-25 16:48 ` [PATCH v8 7/9] mm: Add address parameter to arch_validate_prot() Khalid Aziz
2017-09-25 16:48 ` [PATCH v8 8/9] mm: Clear arch specific VM flags on protection change Khalid Aziz
2017-09-25 16:49 ` [PATCH v8 9/9] sparc64: Add support for ADI (Application Data Integrity) Khalid Aziz
2017-10-06 22:12   ` Anthony Yznaga
2017-10-12 14:44     ` Khalid Aziz
2017-10-12 20:27       ` Anthony Yznaga
2017-10-13 14:14         ` Khalid Aziz
2017-10-13 16:18           ` Khalid Aziz [this message]
2017-10-13 17:19             ` Anthony Yznaga

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=ce3a91db-0fa0-8dda-492d-2ddd281070a7@oracle.com \
    --to=khalid.aziz@oracle.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=allen.pais@oracle.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=anthony.yznaga@oracle.com \
    --cc=atish.patra@oracle.com \
    --cc=bob.picco@oracle.com \
    --cc=cmetcalf@mellanox.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=davem@davemloft.net \
    --cc=eric.saint.etienne@oracle.com \
    --cc=geert@linux-m68k.org \
    --cc=hughd@google.com \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=jack@suse.cz \
    --cc=khalid@gonehiking.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=nitin.m.gupta@oracle.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=punit.agrawal@arm.com \
    --cc=rob.gardner@oracle.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=shannon.nelson@oracle.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=steven.sistare@oracle.com \
    --cc=thomas.tai@oracle.com \
    --cc=tklauser@distanz.ch \
    --cc=tom.hromatka@oracle.com \
    --cc=vijay.ac.kumar@oracle.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=zhongjiang@huawei.com \
    /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