From: Dave Hansen <dave.hansen@linux.intel.com>
To: Khalid Aziz <khalid.aziz@oracle.com>,
davem@davemloft.net, akpm@linux-foundation.org
Cc: corbet@lwn.net, bob.picco@oracle.com, steven.sistare@oracle.com,
pasha.tatashin@oracle.com, mike.kravetz@oracle.com,
rob.gardner@oracle.com, mingo@kernel.org,
nitin.m.gupta@oracle.com, anthony.yznaga@oracle.com,
kirill.shutemov@linux.intel.com, tom.hromatka@oracle.com,
allen.pais@oracle.com, tklauser@distanz.ch,
shannon.nelson@oracle.com, vijay.ac.kumar@oracle.com,
mhocko@suse.com, jack@suse.cz, punit.agrawal@arm.com,
hughd@google.com, thomas.tai@oracle.com,
ross.zwisler@linux.intel.com, dave.jiang@intel.com,
willy@infradead.org, minchan@kernel.org,
imbrenda@linux.vnet.ibm.com, aarcange@redhat.com,
kstewart@linuxfoundation.org, pombredanne@nexb.com,
tglx@linutronix.de, gregkh@linuxfoundation.org,
nagarathnam.muthusamy@oracle.com, linux@roeck-us.net,
jane.chu@oracle.com, dan.j.williams@intel.com,
jglisse@redhat.com, ktkhai@virtuozzo.com,
linux-doc@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 10/11] sparc64: Add support for ADI (Application Data Integrity)
Date: Mon, 5 Mar 2018 13:50:26 -0800 [thread overview]
Message-ID: <6d57c534-5696-e7a2-4b97-5521afcd072a@linux.intel.com> (raw)
In-Reply-To: <b241c894-7751-bd01-2658-4cb6b89f7454@oracle.com>
On 03/05/2018 01:37 PM, Khalid Aziz wrote:
>> How big can this storage get, btw?A Superficially it seems like it might
>> be able to be gigantic for a large, sparse VMA.
>>
> Tags are stored only for the pages being swapped out, not for the pages
> in entire vma. Each tag storage page can hold tags for 128 pages (each
> page has 128 4-bit tags, hence 64 bytes are needed to store tags for an
> entire page allowing each page to store tags for 128 pages). Sparse VMA
> does not cause any problems since holes do not have corresponding pages
> that will be swapped out. Tag storage pages are freed once all the pages
> they store tags for have been swapped back in, except for a small number
> of pages (maximum of 8) marked for emergency tag storage.
With a linear scan holding a process-wide spinlock? If you have a fast
swap device, does this become the bottleneck when swapping ADI-tagged
memory?
FWIW, this tag storage is complex and subtle enough code that it
deserves to be in its own well-documented patch, not buried in a
thousand-line patch.
> +tag_storage_desc_t *find_tag_store(struct mm_struct *mm,
> + struct vm_area_struct *vma,
> + unsigned long addr)
> +{
> + tag_storage_desc_t *tag_desc = NULL;
> + unsigned long i, max_desc, flags;
> +
> + /* Check if this vma already has tag storage descriptor
> + * allocated for it.
> + */
> + max_desc = PAGE_SIZE/sizeof(tag_storage_desc_t);
> + if (mm->context.tag_store) {
> + tag_desc = mm->context.tag_store;
> + spin_lock_irqsave(&mm->context.tag_lock, flags);
> + for (i = 0; i < max_desc; i++) {
> + if ((addr >= tag_desc->start) &&
> + ((addr + PAGE_SIZE - 1) <= tag_desc->end))
> + break;
> + tag_desc++;
> + }
> + spin_unlock_irqrestore(&mm->context.tag_lock, flags);
--
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>
next prev parent reply other threads:[~2018-03-05 21:50 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
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 [this message]
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=6d57c534-5696-e7a2-4b97-5521afcd072a@linux.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=allen.pais@oracle.com \
--cc=anthony.yznaga@oracle.com \
--cc=bob.picco@oracle.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=hughd@google.com \
--cc=imbrenda@linux.vnet.ibm.com \
--cc=jack@suse.cz \
--cc=jane.chu@oracle.com \
--cc=jglisse@redhat.com \
--cc=khalid.aziz@oracle.com \
--cc=khalid@gonehiking.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=kstewart@linuxfoundation.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@roeck-us.net \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
--cc=nagarathnam.muthusamy@oracle.com \
--cc=nitin.m.gupta@oracle.com \
--cc=pasha.tatashin@oracle.com \
--cc=pombredanne@nexb.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=tglx@linutronix.de \
--cc=thomas.tai@oracle.com \
--cc=tklauser@distanz.ch \
--cc=tom.hromatka@oracle.com \
--cc=vijay.ac.kumar@oracle.com \
--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