kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
PATCH 1/1 kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node
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.
--- arch/x86/kernel/apic/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/io_apic.c +1 -1
@@ -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);
Signature · 1 line
1.7.9.5
Ingo Molnar
NAKQuoted 13 lines · Jia-Ju Bai
The function
__add_pin_to_irq_nodeis not called in atomic context. ThusGFP_ATOMICis not necessary, and it can be replaced withGFP_KERNEL.Signed-off-by Jia-Ju Bai <[email protected]>--- arch/x86/kernel/apic/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/apic/io_apic.c +0
-0
arch/x86/kernel/apic/io_apic.c static int __add_pin_to_irq_node(struct mp_chip_data *data, · line 385
Quoted 8 lines
arch/x86/kernel/apic/io_apic.c +1
-1@@ -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
Quoted 18 lines · Ingo Molnar
Quoted 16 lines · Jia-Ju Bai
The function
__add_pin_to_irq_nodeis not called in atomic context. ThusGFP_ATOMICis not necessary, and it can be replaced withGFP_KERNEL.Signed-off-by Jia-Ju Bai <[email protected]>--- arch/x86/kernel/apic/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/apic/io_apic.c +0
-0@@ -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 ;
Quoted 7 lines
arch/x86/kernel/apic/io_apic.c static int __add_pin_to_irq_node(struct mp_chip_data *data, · line 385
Quoted 5 lines
arch/x86/kernel/apic/io_apic.c +1
-1- 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
Quoted 27 lines · Thomas Gleixner
Quoted 18 lines · Ingo Molnar
Quoted 16 lines · Jia-Ju Bai
The function
__add_pin_to_irq_nodeis not called in atomic context. ThusGFP_ATOMICis not necessary, and it can be replaced withGFP_KERNEL.Signed-off-by Jia-Ju Bai <[email protected]>--- arch/x86/kernel/apic/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/apic/io_apic.c +0
-0@@ -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 ;Quoted 7 lines
arch/x86/kernel/apic/io_apic.c static int __add_pin_to_irq_node(struct mp_chip_data *data, · line 385
Quoted 5 lines
arch/x86/kernel/apic/io_apic.c +1
-1- 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 ...
Quoted 3 lines
The only invocation where this happens with IRQs disabled is the early
check_timer()code which runs _before_ the scheduler is working.GFP_KERNELis valid during that phase. All other call sites have interrupts enabled.
Yeah, so at minimum there's a mismatch between the changelog:
Quoted 1 line
Quoted 1 line
Quoted 1 line
The function
__add_pin_to_irq_nodeis not called in atomic context.
... and actual behavior. What you wrote should be part of the changelog I suspect.
Thanks,
Ingo
Quoted 32 lines · Ingo Molnar
Quoted 27 lines · Thomas Gleixner
Quoted 18 lines · Ingo Molnar
Quoted 16 lines · Jia-Ju Bai
The function
__add_pin_to_irq_nodeis not called in atomic context. ThusGFP_ATOMICis not necessary, and it can be replaced withGFP_KERNEL.Signed-off-by Jia-Ju Bai <[email protected]>--- arch/x86/kernel/apic/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/apic/io_apic.c +0
-0@@ -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 ;Quoted 7 lines
arch/x86/kernel/apic/io_apic.c static int __add_pin_to_irq_node(struct mp_chip_data *data, · line 385
Quoted 5 lines
arch/x86/kernel/apic/io_apic.c +1
-1- 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 ...
Quoted 3 lines
The only invocation where this happens with IRQs disabled is the early
check_timer()code which runs _before_ the scheduler is working.GFP_KERNELis valid during that phase. All other call sites have interrupts enabled.
Quoted 5 lines
Yeah, so at minimum there's a mismatch between the changelog:
Quoted 1 line
Quoted 1 line
Quoted 1 line
The function
__add_pin_to_irq_nodeis not called in atomic context.... and actual behavior. What you wrote should be part of the changelog I suspect.
Fair enough.