Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1552317

Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI)

From Khalid Aziz <khalid.aziz@oracle.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI)
Date 2017-01-05 21:40 +0100
Message-ID <sWmZk-7WS-35@gated-at.bofh.it> (permalink)
References (7 earlier) <sW3MZ-3wW-1@gated-at.bofh.it> <sW3MZ-3wW-3@gated-at.bofh.it> <sW3WG-3C0-3@gated-at.bofh.it> <sW46m-3Fd-17@gated-at.bofh.it> <sWlTz-7hx-11@gated-at.bofh.it>
Organization Oracle Corp

Show all headers | View raw


On 01/05/2017 12:22 PM, Dave Hansen wrote:
> 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.

Hi Dave,

Thanks for taking the time to review this. I appreciate your patience. I 
will add more details.

>
> 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.

It is very tempting to restrict tags to PAGE_SIZE granularity since it 
makes code noticeably simpler and that is indeed going to be the 
majority of cases. Sooner or later somebody would want to use multiple 
tags per page though. There can be 128 4-bit tags per 8K page which 
requires 64 bytes of tag storage for each page. This can add up. What I 
am considering doing is store the tag in swp pte if I find only one tag 
on the page. A VMA can cover multiple pages and we have unused bits in 
swp pte. It makes more sense to store the tags in swp pte. If I find 
more than one tag on the page, I can allocate memory, attach it to a 
data structure in mm_context_t and store the tags there. I will need to 
use an rb tree or some other way to keep the data sorted to make it 
quick to retrieve the tags for one of the millions of pages a task might 
have. As I said, it gets complex trying to store tags per cacheline as 
opposed to per page :)

--
Khalid

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 00:30 +0100
  Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 00:40 +0100
    Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 00:50 +0100
      Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 00:50 +0100
        Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 01:00 +0100
          Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 01:10 +0100
            Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 01:10 +0100
              Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 01:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 01:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 20:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 21:40 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Michal Hocko <mhocko@kernel.org> - 2017-01-06 10:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-06 16:40 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 17:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) David Miller <davem@redhat.com> - 2017-01-06 17:30 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-06 18:00 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) David Miller <davem@davemloft.net> - 2017-01-06 18:10 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 18:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-06 19:00 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 19:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-06 19:40 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 18:20 +0100
                Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-06 16:40 +0100
        Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Rob Gardner <rob.gardner@oracle.com> - 2017-01-05 01:00 +0100
    Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-05 00:50 +0100
  Re: [RFC PATCH v3] sparc64: Add support for Application Data  Integrity (ADI) Khalid Aziz <khalid.aziz@oracle.com> - 2017-01-05 00:50 +0100

csiph-web