linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org, Li Zhong <zhong@linux.vnet.ibm.com>
Subject: Re: [RFC PATCH v2 3/4] powerpc: Don't bolt the hpte in kernel_map_linear_page()
Date: Mon, 15 Apr 2013 08:56:35 +0200	[thread overview]
Message-ID: <1366008995.24994.25.camel@pasglop> (raw)
In-Reply-To: <20130415035031.GA7494@iris.ozlabs.ibm.com>

On Mon, 2013-04-15 at 13:50 +1000, Paul Mackerras wrote:
> On Fri, Apr 12, 2013 at 10:16:59AM +0800, Li Zhong wrote:
> > It seems that in kernel_unmap_linear_page(), it only checks whether there
> > is a map in the linear_map_hash_slots array, so seems we don't need bolt
> > the hpte.
> 
> I don't exactly understand your rationale here, but I don't think it's
> safe not to have linear mapping pages bolted.  Basically, if a page
> will be used in the process of calling hash_page to demand-fault an
> HPTE into the hash table, then that page needs to be bolted, otherwise
> we can get an infinite recursion of HPT misses.  That includes all
> kernel stack pages, among other things, so I think we need to leave
> the HPTE_V_BOLTED in there.

I suspect Li's confusion comes from the fact that he doesn't realizes
that we might evict random hash slots. If the linear mapping hash
entries could only be thrown out via kernel_unmap_linear_page() then his
comment would make sense. However this isn't the case.

Li: When faulting something in, if both the primary and secondary
buckets are full, we "somewhat randomly" evict the content of a slot and
replace it. However we only do that on non-bolted slots.

This is why the linear mapping (and the vmemmap) must be bolted.

Cheers,
Ben.

  reply	other threads:[~2013-04-15  7:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  2:16 [RFC PATCH v2 0/4] try secondary hash before BUG in kernel_map_linear_page() Li Zhong
2013-04-12  2:16 ` [RFC PATCH v2 1/4] powerpc: Move the setting of rflags out of loop in __hash_page_huge Li Zhong
2013-04-15  6:32   ` Michael Ellerman
2013-04-15  8:17     ` Li Zhong
2013-04-12  2:16 ` [RFC PATCH v2 2/4] powerpc: Split the code trying to insert hpte repeatedly as an helper function Li Zhong
2013-04-12  2:16 ` [RFC PATCH v2 3/4] powerpc: Don't bolt the hpte in kernel_map_linear_page() Li Zhong
2013-04-15  3:50   ` Paul Mackerras
2013-04-15  6:56     ` Benjamin Herrenschmidt [this message]
2013-04-15  8:15       ` Li Zhong
2013-04-15 11:27         ` Benjamin Herrenschmidt
2013-04-16  2:51           ` Li Zhong
2013-04-12  2:17 ` [RFC PATCH v2 4/4] powerpc: Try to insert the hptes repeatedly " Li Zhong
2013-04-15  6:36   ` Michael Ellerman
2013-04-15  8:21     ` Li Zhong

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=1366008995.24994.25.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=zhong@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).