From: Chris Metcalf <cmetcalf@tilera.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: <linux-kernel@vger.kernel.org>, Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH 2/3] tile: remove irqsave pgd_lock locking
Date: Thu, 10 Nov 2011 13:50:05 -0500 [thread overview]
Message-ID: <4EBC1CDD.1020608@tilera.com> (raw)
In-Reply-To: <1320853639-18048-2-git-send-email-mhocko@suse.cz>
On 11/9/2011 10:47 AM, Michal Hocko wrote:
> a79e53d8: x86/mm: Fix pgd_lock deadlock dropped irqsave locking to fix a
> deadlock. pgd_lock is not used from an irq context so we can drop
> irqsave locking here as well.
> The original patch was x86 only but the same applies here
> because pgd_ctor (aka mm_alloc_pgd), pgd_dtor (aka mm_free_pgd),
> shatter_huge_page (not used anywhere) and vmalloc_sync_all are not used
> from an interrupt contexts.
In fact, shatter_huge_page() is used by some code in our internal version
of arch/tile/mm/homecache.c that we haven't yet pushed back to the
community, and that CAN be called from an interrupt context. (For example,
we may shatter a huge page to dynamically change the "home cache" of a
small page when it's allocated from the page allocator, causing us to need
to map all the memory under the old huge page with separate small pages
that can now each carry separate "home cache" locations for those pages.)
We don't suffer from the x86 deadlock risk, since we handle TLB flushing
using our hypervisor API, flush_remote(), which doesn't pay attention to
the irq-disabled state on the remote core.
So this patch would not be safe for our architecture, but thanks for
exploring the possibility. I'll add some comments explaining this (at the
definition of pgd_lock) to avoid confusion in the future. In fact,
reviewing the shatter_huge_page() code, I realize I should hold
init_mm.page_table_lock as well as pgtable_lock to guard against another
thread updating init_mm in parallel; I think this is only a theoretical
issue but I'll add the locking to be consistent.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
next prev parent reply other threads:[~2011-11-10 18:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 15:47 [PATCH 1/3] frv: remove irqsave pgd_lock locking Michal Hocko
2011-11-09 15:47 ` [PATCH 2/3] tile: " Michal Hocko
2011-11-10 18:50 ` Chris Metcalf [this message]
2011-11-11 8:15 ` Michal Hocko
2011-11-09 15:47 ` [PATCH 3/3] mn10300: " Michal Hocko
2011-12-01 14:19 ` Michal Hocko
2011-12-01 14:19 ` [PATCH 1/3] frv: " Michal Hocko
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=4EBC1CDD.1020608@tilera.com \
--to=cmetcalf@tilera.com \
--cc=aarcange@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
/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