From: David Rientjes <rientjes@google.com>
To: David Miller <davem@davemloft.net>
Cc: mroos@ut.ee, linux-mm@vger.kernel.org,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: THP bug and crash on sparc64 3.8
Date: Tue, 19 Feb 2013 11:37:30 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.02.1302191134570.790@chino.kir.corp.google.com> (raw)
In-Reply-To: <20130219.143320.1413047009797673492.davem@davemloft.net>
On Tue, 19 Feb 2013, David Miller wrote:
> diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c
> index 7f64743..338b406 100644
> --- a/arch/sparc/mm/tsb.c
> +++ b/arch/sparc/mm/tsb.c
> @@ -288,14 +288,13 @@ static unsigned long tsb_size_to_rss_limit(unsigned long new_size)
> * the number of entries that the current TSB can hold at once. Currently,
> * we trigger when the RSS hits 3/4 of the TSB capacity.
> */
> -void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss)
> +void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss, gfp_t gfp)
> {
> unsigned long max_tsb_size = 1 * 1024 * 1024;
> unsigned long new_size, old_size, flags;
> struct tsb *old_tsb, *new_tsb;
> unsigned long new_cache_index, old_cache_index;
> unsigned long new_rss_limit;
> - gfp_t gfp_flags;
>
> if (max_tsb_size > (PAGE_SIZE << MAX_ORDER))
> max_tsb_size = (PAGE_SIZE << MAX_ORDER);
> @@ -312,12 +311,11 @@ void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss)
> new_rss_limit = ~0UL;
>
> retry_tsb_alloc:
> - gfp_flags = GFP_KERNEL;
> if (new_size > (PAGE_SIZE * 2))
> - gfp_flags = __GFP_NOWARN | __GFP_NORETRY;
> + gfp = __GFP_NOWARN | __GFP_NORETRY;
The existing code here already looks buggy for a different reason, it
should be gfp |= __GFP_NOWARN | __GFP_NORETRY;
I was wondering if you could get away with just a simple one-liner fix
above by doing
gfp_flags = rss ? GFP_KERNEL : GFP_NOWAIT;
but I agree this is more robust.
next prev parent reply other threads:[~2013-02-19 19:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 11:56 Meelis Roos
2013-02-19 12:05 ` Meelis Roos
2013-02-19 18:17 ` David Miller
2013-02-19 19:33 ` David Miller
2013-02-19 19:37 ` David Rientjes [this message]
2013-02-19 19:46 ` David Miller
2013-02-20 6:41 ` David Miller
2013-02-20 13:35 ` Meelis Roos
2013-02-20 17:50 ` David Miller
2013-02-20 21:34 ` David Miller
2013-06-26 20:56 ` Meelis Roos
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=alpine.DEB.2.02.1302191134570.790@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@vger.kernel.org \
--cc=mroos@ut.ee \
--cc=sparclinux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®