* [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
@ 2018-01-24 1:40 Jia-Ju Bai
2018-02-13 15:56 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Jia-Ju Bai @ 2018-01-24 1:40 UTC (permalink / raw)
To: tglx, mingo, hpa, jgross, douly.fnst, kkamagui, gregkh, mka
Cc: linux-kernel, x86, Jia-Ju Bai
The function __add_pin_to_irq_node is not called in atomic context.
Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 201579d..665c013 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -379,7 +379,7 @@ static int __add_pin_to_irq_node(struct mp_chip_data *data,
if (entry->apic == apic && entry->pin == pin)
return 0;
- entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node);
+ entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);
if (!entry) {
pr_err("can not alloc irq_pin_list (%d,%d,%d)\n",
node, apic, pin);
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
2018-01-24 1:40 [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node Jia-Ju Bai
@ 2018-02-13 15:56 ` Ingo Molnar
2018-02-13 16:12 ` Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2018-02-13 15:56 UTC (permalink / raw)
To: Jia-Ju Bai
Cc: tglx, mingo, hpa, jgross, douly.fnst, kkamagui, gregkh, mka,
linux-kernel, x86
* Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
> The function __add_pin_to_irq_node is not called in atomic context.
> Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
> arch/x86/kernel/apic/io_apic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index 201579d..665c013 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -379,7 +379,7 @@ static int __add_pin_to_irq_node(struct mp_chip_data *data,
> if (entry->apic == apic && entry->pin == pin)
> return 0;
>
> - entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node);
> + entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);
> if (!entry) {
> pr_err("can not alloc irq_pin_list (%d,%d,%d)\n",
> node, apic, pin);
NAK: this is called in an atomic section: with IRQs disabled ...
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
2018-02-13 15:56 ` Ingo Molnar
@ 2018-02-13 16:12 ` Thomas Gleixner
2018-02-13 16:16 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2018-02-13 16:12 UTC (permalink / raw)
To: Ingo Molnar
Cc: Jia-Ju Bai, mingo, hpa, jgross, douly.fnst, kkamagui, gregkh,
mka, linux-kernel, x86
On Tue, 13 Feb 2018, Ingo Molnar wrote:
> * Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
>
> > The function __add_pin_to_irq_node is not called in atomic context.
> > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
> >
> > Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> > ---
> > arch/x86/kernel/apic/io_apic.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> > index 201579d..665c013 100644
> > --- a/arch/x86/kernel/apic/io_apic.c
> > +++ b/arch/x86/kernel/apic/io_apic.c
> > @@ -379,7 +379,7 @@ static int __add_pin_to_irq_node(struct mp_chip_data *data,
> > if (entry->apic == apic && entry->pin == pin)
> > return 0;
> >
> > - entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node);
> > + entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);
> > if (!entry) {
> > pr_err("can not alloc irq_pin_list (%d,%d,%d)\n",
> > node, apic, pin);
>
> NAK: this is called in an atomic section: with IRQs disabled ...
The only invocation where this happens with IRQs disabled is the early
check_timer() code which runs _before_ the scheduler is working. GFP_KERNEL
is valid during that phase. All other call sites have interrupts enabled.
Thanks,
tglx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
2018-02-13 16:12 ` Thomas Gleixner
@ 2018-02-13 16:16 ` Ingo Molnar
2018-02-13 16:20 ` Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2018-02-13 16:16 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Jia-Ju Bai, mingo, hpa, jgross, douly.fnst, kkamagui, gregkh,
mka, linux-kernel, x86
* Thomas Gleixner <tglx@linutronix.de> wrote:
> On Tue, 13 Feb 2018, Ingo Molnar wrote:
> > * Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
> >
> > > The function __add_pin_to_irq_node is not called in atomic context.
> > > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
> > >
> > > Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> > > ---
> > > arch/x86/kernel/apic/io_apic.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> > > index 201579d..665c013 100644
> > > --- a/arch/x86/kernel/apic/io_apic.c
> > > +++ b/arch/x86/kernel/apic/io_apic.c
> > > @@ -379,7 +379,7 @@ static int __add_pin_to_irq_node(struct mp_chip_data *data,
> > > if (entry->apic == apic && entry->pin == pin)
> > > return 0;
> > >
> > > - entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node);
> > > + entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);
> > > if (!entry) {
> > > pr_err("can not alloc irq_pin_list (%d,%d,%d)\n",
> > > node, apic, pin);
> >
> > NAK: this is called in an atomic section: with IRQs disabled ...
>
> The only invocation where this happens with IRQs disabled is the early
> check_timer() code which runs _before_ the scheduler is working. GFP_KERNEL
> is valid during that phase. All other call sites have interrupts enabled.
Yeah, so at minimum there's a mismatch between the changelog:
> > > The function __add_pin_to_irq_node is not called in atomic context.
... and actual behavior. What you wrote should be part of the changelog I suspect.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
2018-02-13 16:16 ` Ingo Molnar
@ 2018-02-13 16:20 ` Thomas Gleixner
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2018-02-13 16:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: Jia-Ju Bai, mingo, hpa, jgross, douly.fnst, kkamagui, gregkh,
mka, linux-kernel, x86
On Tue, 13 Feb 2018, Ingo Molnar wrote:
> * Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Tue, 13 Feb 2018, Ingo Molnar wrote:
> > > * Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
> > >
> > > > The function __add_pin_to_irq_node is not called in atomic context.
> > > > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
> > > >
> > > > Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> > > > ---
> > > > arch/x86/kernel/apic/io_apic.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> > > > index 201579d..665c013 100644
> > > > --- a/arch/x86/kernel/apic/io_apic.c
> > > > +++ b/arch/x86/kernel/apic/io_apic.c
> > > > @@ -379,7 +379,7 @@ static int __add_pin_to_irq_node(struct mp_chip_data *data,
> > > > if (entry->apic == apic && entry->pin == pin)
> > > > return 0;
> > > >
> > > > - entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node);
> > > > + entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);
> > > > if (!entry) {
> > > > pr_err("can not alloc irq_pin_list (%d,%d,%d)\n",
> > > > node, apic, pin);
> > >
> > > NAK: this is called in an atomic section: with IRQs disabled ...
> >
> > The only invocation where this happens with IRQs disabled is the early
> > check_timer() code which runs _before_ the scheduler is working. GFP_KERNEL
> > is valid during that phase. All other call sites have interrupts enabled.
>
> Yeah, so at minimum there's a mismatch between the changelog:
>
> > > > The function __add_pin_to_irq_node is not called in atomic context.
>
> ... and actual behavior. What you wrote should be part of the changelog I suspect.
Fair enough.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-13 16:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 1:40 [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node Jia-Ju Bai
2018-02-13 15:56 ` Ingo Molnar
2018-02-13 16:12 ` Thomas Gleixner
2018-02-13 16:16 ` Ingo Molnar
2018-02-13 16:20 ` Thomas Gleixner
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®