mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix v2
Subsystems (2)
PATCH 1/1 mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix v2
preempt_enable_no_resched() was used based on review feedback that had no strong objection at the time. The thinking was that it avoided adding a preemption point where one didn't exist before so the feedback was applied. This reasoning was wrong.
There was an indirect preemption point as explained by Thomas Gleixner where an interrupt could set_need_resched() followed by preempt_enable being a preemption point that matters. This use of preempt_enable_no_resched is bad from both a mainline and RT perspective and a violation of the preemption mechanism. Peter Zijlstra noted that "the only acceptable use of preempt_enable_no_resched() is if the next statement is a schedule() variant".
The usage was outright broken and I should have stuck to preempt_enable() as it was originally developed. It's known from previous tests that there was no detectable difference to the performance by using preempt_enable_no_resched().
This is a fix to the mmotm patch mm-page_alloc-only-use-per-cpu-allocator-for-irq-safe-requests.patch
--- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_alloc.c +2 -2
@@ -2520,7 +2520,7 @@ void free_hot_cold_page(struct page *page, bool cold) } out: -preempt_enable_no_resched (); +preempt_enable (); }/*
@@ -2686,7 +2686,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,__count_zid_vm_events (PGALLOC ,page_zonenum (page),1 << order);zone_statistics (preferred_zone, zone); } -preempt_enable_no_resched (); +preempt_enable ();return page; }
Signature · 8 lines
Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 18 lines · Mel Gorman
preempt_enable_no_resched()was used based on review feedback that had no strong objection at the time. The thinking was that it avoided adding a preemption point where one didn't exist before so the feedback was applied. This reasoning was wrong.There was an indirect preemption point as explained by Thomas Gleixner where an interrupt could
set_need_resched()followed bypreempt_enablebeing a preemption point that matters. This use ofpreempt_enable_no_reschedis bad from both a mainline and RT perspective and a violation of the preemption mechanism. Peter Zijlstra noted that "the only acceptable use ofpreempt_enable_no_resched()is if the next statement is aschedule()variant".The usage was outright broken and I should have stuck to
preempt_enable()as it was originally developed. It's known from previous tests that there was no detectable difference to the performance by usingpreempt_enable_no_resched().
Quoted 4 lines
This is a fix to the mmotm patch mm-page_alloc-only-use-per-cpu-allocator-for-irq-safe-requests.patch
Signed-off-by Mel Gorman <[email protected]>
Quoted 31 lines
--- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/page_alloc.c +2
-2@@ -2520,7 +2520,7 @@ void free_hot_cold_page(struct page *page, bool cold) } out: -preempt_enable_no_resched (); +preempt_enable (); }/* @@ -2686,7 +2686,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,__count_zid_vm_events (PGALLOC ,page_zonenum (page),1 << order);zone_statistics (preferred_zone, zone); } -preempt_enable_no_resched (); +preempt_enable ();return page; }Signature · 3 lines
-- Mel Gorman SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 19 lines · Mel Gorman
preempt_enable_no_resched()was used based on review feedback that had no strong objection at the time. The thinking was that it avoided adding a preemption point where one didn't exist before so the feedback was applied. This reasoning was wrong.There was an indirect preemption point as explained by Thomas Gleixner where an interrupt could
set_need_resched()followed bypreempt_enablebeing a preemption point that matters. This use ofpreempt_enable_no_reschedis bad from both a mainline and RT perspective and a violation of the preemption mechanism. Peter Zijlstra noted that "the only acceptable use ofpreempt_enable_no_resched()is if the next statement is aschedule()variant".The usage was outright broken and I should have stuck to
preempt_enable()as it was originally developed. It's known from previous tests that there was no detectable difference to the performance by usingpreempt_enable_no_resched().
Quoted 5 lines
This is a fix to the mmotm patch mm-page_alloc-only-use-per-cpu-allocator-for-irq-safe-requests.patch
Signed-off-by Mel Gorman <[email protected]>---
Thanks for fixing it.
Quoted 17 lines
mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/page_alloc.c +1
-1@@ -2520,7 +2520,7 @@ void free_hot_cold_page(struct page *page, bool cold) } out: -preempt_enable_no_resched (); +preempt_enable (); }/*
mm/page_alloc.c static struct page *rmqueue_pcplist(struct zone *preferred_zone, · line 2692
Quoted 8 lines
mm/page_alloc.c +1
-1@@ -2686,7 +2686,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,__count_zid_vm_events (PGALLOC ,page_zonenum (page),1 << order);zone_statistics (preferred_zone, zone); } -preempt_enable_no_resched (); +preempt_enable ();return page; }
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>