From: Paul Mackerras <paulus@samba.org>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
"agraf@suse.de" <agraf@suse.de>,
Yoder Stuart-B08248 <B08248@freescale.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>
Subject: Re: [PATCH 3/4] kvm: powerpc: define a linux pte lookup function
Date: Thu, 10 Oct 2013 10:52:17 +0000 [thread overview]
Message-ID: <20131010105217.GF9906@iris.ozlabs.ibm.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D071AF2DD@039-SN2MPN1-012.039d.mgd.msft.net>
On Thu, Oct 10, 2013 at 10:44:54AM +0000, Bhushan Bharat-R65777 wrote:
>
>
> > -----Original Message-----
> > From: Paul Mackerras [mailto:paulus@samba.org]
> > Sent: Thursday, October 10, 2013 4:06 PM
> > To: Wood Scott-B07421
> > Cc: Bhushan Bharat-R65777; Wood Scott-B07421; agraf@suse.de; Yoder Stuart-
> > B08248; kvm@vger.kernel.org; kvm-ppc@vger.kernel.org
> > Subject: Re: [PATCH 3/4] kvm: powerpc: define a linux pte lookup function
> >
> > On Wed, Oct 09, 2013 at 12:47:31PM -0500, Scott Wood wrote:
> > > On Wed, 2013-10-09 at 03:48 -0500, Bhushan Bharat-R65777 wrote:
> > > >
> > > > What lookup_linux_pte_and_update() does:-
> > > > - find_linux_pte_or_hugepte()
> > > > - does size and some other trivial checks
> > > > - Then atomically update the pte:-
> > > > => while()
> > > > => wait till _PAGE_BUSY is clear
> > > > => atomically update the pte
> > > > => if not updated then go back to while() above else break
> > > >
> > > >
> > > > While what lookup_linux_pte() does:-
> > > > - find_linux_pte_or_hugepte()
> > > > - does size and some other trivial checks
> > > > - wait till _PAGE_BUSY is clear
> > > > - return pte
> > > >
> > > > I am finding it difficult to call lookup_linux_pte() from
> > lookup_linux_pte_and_update().
> > >
> > > You could factor out a common lookup_linux_ptep().
> >
> > I don't really think it's enough code to be worth wringing out the last drop of
> > duplication. However, if he removed the checks for _PAGE_BUSY and _PAGE_PRESENT
> > as I suggested in another mail, and made it return the pte pointer rather than
> > the value, it would then essentially be a lookup_linux_ptep() as you suggest.
>
> Do we want to have lookup_linux_pte() or lookup_linux_ptep() or both where lookup_linux_pte() and lookup_linux_pte_and_update() calls lookup_linux_ptep() ?
I don't think we want both lookup_linux_pte() and lookup_linux_ptep().
Either have a lookup_linux_ptep() and call it from your book E code
and from lookup_linux_pte_and_update(), or keep a separate
lookup_linux_pte() and don't make the _and_update() version call it.
I don't really care; you decide which looks nicer in the end. Of
course someone will then tell you to do it the other way, but at that
point it's just a matter of taste.
Paul.
WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus@samba.org>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
"agraf@suse.de" <agraf@suse.de>,
Yoder Stuart-B08248 <B08248@freescale.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>
Subject: Re: [PATCH 3/4] kvm: powerpc: define a linux pte lookup function
Date: Thu, 10 Oct 2013 21:52:17 +1100 [thread overview]
Message-ID: <20131010105217.GF9906@iris.ozlabs.ibm.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D071AF2DD@039-SN2MPN1-012.039d.mgd.msft.net>
On Thu, Oct 10, 2013 at 10:44:54AM +0000, Bhushan Bharat-R65777 wrote:
>
>
> > -----Original Message-----
> > From: Paul Mackerras [mailto:paulus@samba.org]
> > Sent: Thursday, October 10, 2013 4:06 PM
> > To: Wood Scott-B07421
> > Cc: Bhushan Bharat-R65777; Wood Scott-B07421; agraf@suse.de; Yoder Stuart-
> > B08248; kvm@vger.kernel.org; kvm-ppc@vger.kernel.org
> > Subject: Re: [PATCH 3/4] kvm: powerpc: define a linux pte lookup function
> >
> > On Wed, Oct 09, 2013 at 12:47:31PM -0500, Scott Wood wrote:
> > > On Wed, 2013-10-09 at 03:48 -0500, Bhushan Bharat-R65777 wrote:
> > > >
> > > > What lookup_linux_pte_and_update() does:-
> > > > - find_linux_pte_or_hugepte()
> > > > - does size and some other trivial checks
> > > > - Then atomically update the pte:-
> > > > => while()
> > > > => wait till _PAGE_BUSY is clear
> > > > => atomically update the pte
> > > > => if not updated then go back to while() above else break
> > > >
> > > >
> > > > While what lookup_linux_pte() does:-
> > > > - find_linux_pte_or_hugepte()
> > > > - does size and some other trivial checks
> > > > - wait till _PAGE_BUSY is clear
> > > > - return pte
> > > >
> > > > I am finding it difficult to call lookup_linux_pte() from
> > lookup_linux_pte_and_update().
> > >
> > > You could factor out a common lookup_linux_ptep().
> >
> > I don't really think it's enough code to be worth wringing out the last drop of
> > duplication. However, if he removed the checks for _PAGE_BUSY and _PAGE_PRESENT
> > as I suggested in another mail, and made it return the pte pointer rather than
> > the value, it would then essentially be a lookup_linux_ptep() as you suggest.
>
> Do we want to have lookup_linux_pte() or lookup_linux_ptep() or both where lookup_linux_pte() and lookup_linux_pte_and_update() calls lookup_linux_ptep() ?
I don't think we want both lookup_linux_pte() and lookup_linux_ptep().
Either have a lookup_linux_ptep() and call it from your book E code
and from lookup_linux_pte_and_update(), or keep a separate
lookup_linux_pte() and don't make the _and_update() version call it.
I don't really care; you decide which looks nicer in the end. Of
course someone will then tell you to do it the other way, but at that
point it's just a matter of taste.
Paul.
next prev parent reply other threads:[~2013-10-10 10:52 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 6:03 [PATCH 0/4] kvm: powerpc: use cache attributes from linux pte Bharat Bhushan
2013-10-08 6:15 ` Bharat Bhushan
2013-10-08 6:03 ` [PATCH 1/4] kvm: booke: clear host tlb reference flag on guest tlb invalidation Bharat Bhushan
2013-10-08 6:15 ` Bharat Bhushan
2013-10-08 6:03 ` [PATCH 2/4] kvm: book3s: rename lookup_linux_pte() to lookup_linux_pte_and_update() Bharat Bhushan
2013-10-08 6:15 ` Bharat Bhushan
2013-10-08 6:03 ` [PATCH 3/4] kvm: powerpc: define a linux pte lookup function Bharat Bhushan
2013-10-08 6:15 ` Bharat Bhushan
2013-10-08 21:36 ` Scott Wood
2013-10-08 21:36 ` Scott Wood
2013-10-09 8:48 ` Bhushan Bharat-R65777
2013-10-09 8:48 ` Bhushan Bharat-R65777
2013-10-09 17:47 ` Scott Wood
2013-10-09 17:47 ` Scott Wood
2013-10-10 10:35 ` Paul Mackerras
2013-10-10 10:35 ` Paul Mackerras
2013-10-10 10:44 ` Bhushan Bharat-R65777
2013-10-10 10:52 ` Paul Mackerras [this message]
2013-10-10 10:52 ` Paul Mackerras
2013-10-15 5:07 ` Aneesh Kumar K.V
2013-10-15 5:19 ` Aneesh Kumar K.V
2013-10-10 10:33 ` Paul Mackerras
2013-10-10 10:33 ` Paul Mackerras
2013-10-15 5:05 ` Aneesh Kumar K.V
2013-10-15 5:17 ` Aneesh Kumar K.V
2013-10-08 6:03 ` [PATCH 4/4] kvm: powerpc: use caching attributes as per linux pte Bharat Bhushan
2013-10-08 6:15 ` Bharat Bhushan
-- strict thread matches above, loose matches on Subject: below --
2013-10-28 10:24 [PATCH 0/4] kvm: powerpc: use cache attributes from " Bharat Bhushan
2013-10-28 10:36 ` Bharat Bhushan
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=20131010105217.GF9906@iris.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=B07421@freescale.com \
--cc=B08248@freescale.com \
--cc=R65777@freescale.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.