From: Ram Pai <linuxram@us.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
khandual@linux.vnet.ibm.com, bsingharora@gmail.com,
dave.hansen@intel.com, hbabu@us.ibm.com
Subject: Re: [RFC PATCH 1/7 v1]powerpc: Free up four PTE bits to accommodate memory keys
Date: Tue, 13 Jun 2017 14:52:24 -0700 [thread overview]
Message-ID: <20170613215224.GA5590@ram.oc3035372033.ibm.com> (raw)
In-Reply-To: <87tw3k1obo.fsf@skywalker.in.ibm.com>
On Tue, Jun 13, 2017 at 10:22:43AM +0530, Aneesh Kumar K.V wrote:
> Ram Pai <linuxram@us.ibm.com> writes:
>
> > Rearrange PTE bits to free up bits 3, 4, 5 and 6 for
> > memory keys. Bit 3, 4, 5, 6 and 57 shall be used for memory
> > keys.
> >
> > The patch does the following change to the 64K PTE format
> >
> > H_PAGE_BUSY moves from bit 3 to bit 7
> > H_PAGE_F_SECOND which occupied bit 4 moves to the second part
> > of the pte.
> > H_PAGE_F_GIX which occupied bit 5, 6 and 7 also moves to the
> > second part of the pte.
> >
> > The second part of the PTE will hold
> > a (H_PAGE_F_SECOND|H_PAGE_F_GIX) for 64K page backed pte,
> > and sixteen (H_PAGE_F_SECOND|H_PAGE_F_GIX) for 4k backed
> > pte.
> >
> > the four bits((H_PAGE_F_SECOND|H_PAGE_F_GIX) that represent a slot
> > is initialized to 0xF indicating a invalid slot. if a hashpage does
> > get allocated to the 0xF slot, it is released and not used. In
> > other words, even though 0xF is a valid slot we discard it and
> > consider it as invalid slot(HPTE_SOFT_INVALID). This gives us an
> > opportunity to not depend on a bit in the primary PTE in order to
> > determine the validity of a slot.
> >
> > When we release a 0xF slot we also release a legitimate primary
> > slot and unmap that entry. This is to ensure that we do get
> > a legimate non-0xF slot the next time we retry for a slot.
> >
> > Though treating 0xF slot as invalid reduces the number of available
> > slots and make have a effect on the performance, the probabilty
> > of hitting a 0xF is extermely low.
> >
> > Compared to the current scheme, the above described scheme reduces
> > the number of false hash table updates significantly and has the
> > added advantage of releasing four valuable PTE bits for other
> > purpose.
> >
> > This idea was jointly developed by Paul Mackerras, Aneesh, Michael
> > Ellermen and myself.
> >
> > 4K PTE format remain unchanged currently.
> >
>
> Can you also split this patch into two. One which changes
> __hash_page_4k() ie, linux pte format w.r.t 4k hash pte. Second patch
> with changes w.r.t __hash_page_64k() ie, pte format w.r.t 64k hash pte.
ok. A v2 version of the patch series will be out in a day or two.
RP
next prev parent reply other threads:[~2017-06-13 21:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-06 1:05 [RFC PATCH 0/7 v1] powerpc: Memory Protection Keys Ram Pai
2017-06-06 1:05 ` [RFC PATCH 1/7 v1]powerpc: Free up four PTE bits to accommodate memory keys Ram Pai
2017-06-12 6:57 ` Aneesh Kumar K.V
2017-06-12 22:20 ` Ram Pai
2017-06-13 2:02 ` Aneesh Kumar K.V
2017-06-13 21:51 ` Ram Pai
2017-06-13 4:52 ` Aneesh Kumar K.V
2017-06-13 21:52 ` Ram Pai [this message]
2017-06-06 1:05 ` [RFC PATCH 2/7 v1]powerpc: Implement sys_pkey_alloc and sys_pkey_free system call Ram Pai
2017-06-06 1:05 ` [RFC PATCH 3/7 v1]powerpc: store and restore the key state across context switches Ram Pai
2017-06-06 1:05 ` [RFC PATCH 4/7 v1]powerpc: Implementation for sys_mprotect_pkey() system call Ram Pai
2017-06-06 1:05 ` [RFC PATCH 5/7 v1]powerpc: Program HPTE key protection bits Ram Pai
2017-06-06 1:05 ` [RFC PATCH 6/7 v1]powerpc: Handle exceptions caused by violation of key protection Ram Pai
2017-06-06 1:05 ` [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation Ram Pai
2017-06-16 9:20 ` Anshuman Khandual
2017-06-16 10:33 ` Benjamin Herrenschmidt
2017-06-16 19:15 ` Ram Pai
2017-06-16 22:54 ` Benjamin Herrenschmidt
2017-06-22 21:41 ` Ram Pai
2017-06-16 19:10 ` Ram Pai
2017-06-16 11:18 ` Michael Ellerman
2017-06-16 19:35 ` Ram Pai
2017-06-20 7:07 ` [RFC PATCH 0/7 v1] powerpc: Memory Protection Keys Pavel Machek
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=20170613215224.GA5590@ram.oc3035372033.ibm.com \
--to=linuxram@us.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.com \
--cc=dave.hansen@intel.com \
--cc=hbabu@us.ibm.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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).