From: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Matt Fleming
<matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Nathan Zimmer <nzimmer-sJ/iWh9BUns@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>,
x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [patch] x86/efi: use GFP_ATOMIC under spin_lock
Date: Fri, 7 Mar 2014 13:10:22 +0100 [thread overview]
Message-ID: <20140307121022.GA32575@gmail.com> (raw)
In-Reply-To: <20140307112055.GE2351-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
* Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> In phys_efi_get_time() we call efi_call_phys_prelog() with a spin_lock
> so this allocation should be atomic.
>
> Fixes: b8f2c21db390 ('efi, x86: Pass a proper identity mapping in efi_call_phys_prelog')
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>
> diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
> index 0c2a234fef1e..f5adcadb381b 100644
> --- a/arch/x86/platform/efi/efi_64.c
> +++ b/arch/x86/platform/efi/efi_64.c
> @@ -90,7 +90,7 @@ void __init efi_call_phys_prelog(void)
> local_irq_save(efi_flags);
>
> n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);
> - save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL);
> + save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_ATOMIC);
>
> for (pgd = 0; pgd < n_pgds; pgd++) {
> save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);
The allocation there, if it happens within a spinlocked path, is
probably a layering violation - and GFP_ATOMIC is at best a
workaround.
Thanks,
Ingo
next prev parent reply other threads:[~2014-03-07 12:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 11:20 [patch] x86/efi: use GFP_ATOMIC under spin_lock Dan Carpenter
[not found] ` <20140307112055.GE2351-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2014-03-07 12:10 ` Ingo Molnar [this message]
[not found] ` <20140307121022.GA32575-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-07 12:25 ` Dan Carpenter
2014-03-09 6:48 ` Ingo Molnar
2014-03-09 7:14 ` Dan Carpenter
2014-03-09 16:20 ` Matt Fleming
2014-03-09 16:31 ` Matthew Garrett
[not found] ` <20140309163141.GA18824-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2014-03-09 18:50 ` Matt Fleming
2014-03-09 19:00 ` Matthew Garrett
[not found] ` <20140309190053.GA29555-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2014-03-10 9:10 ` Matt Fleming
[not found] ` <20140309185028.GB10262-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-03-10 7:27 ` Jan Beulich
2014-03-10 7:37 ` Ingo Molnar
2014-03-10 7:45 ` Jan Beulich
2014-03-10 7:53 ` Ingo Molnar
2014-03-10 8:22 ` Jan Beulich
2014-03-10 10:43 ` Matt Fleming
[not found] ` <20140310104328.GG10262-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-03-10 11:05 ` Jan Beulich
[not found] ` <531DAA7602000078001224EF-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2014-03-10 16:10 ` Matt Fleming
2014-03-14 23:02 ` Matt Fleming
2014-03-10 9:12 ` Matt Fleming
2014-03-10 7:26 ` Jan Beulich
2014-03-10 17:07 ` Dan Carpenter
2014-03-09 7:36 ` Dan Carpenter
2014-03-10 16:47 ` H. Peter Anvin
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=20140307121022.GA32575@gmail.com \
--to=mingo-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
--cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=nzimmer-sJ/iWh9BUns@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).