Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1576668

Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix
Date 2017-02-08 17:00 +0100
Message-ID <t8CP0-2b0-13@gated-at.bofh.it> (permalink)
References <t8C2B-1TA-3@gated-at.bofh.it> <t8CP0-2b0-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Feb 08, 2017 at 03:56:22PM +0100, Thomas Gleixner wrote:
> On Wed, 8 Feb 2017, Mel Gorman wrote:
> 
> > preempt_enable_no_resched() was used based on review feedback that had no
> > strong objection at the time. It avoided introducing a preemption point
> > where one didn't exist before which was marginal at best.
> 
> Actually local_irq_enable() _IS_ a preemption point, indirect but still:
> 
>    local_irq_disable()
>    ....
> --> HW interrupt is raised
>    ....
>    local_irq_enable()
> 
>    handle_irq()
> 	set_need_resched()
>    ret_from_irq()
>      preempt()
> 
> while with preempt_disable that looks like this:
> 
>    preempt_disable()
>    ....
> --> HW interrupt is raised
>    handle_irq()
> 	set_need_resched()
>    ret_from_irq()
>    ....
>    preempt_enable()
>       preempt()
> 
> Now if you use preempt_enable_no_resched() then you miss the preemption and
> depending on the actual code path you might run something which takes ages
> without hitting a preemption point after that.
> 

Thanks for the education, I had missed it. The changelog should have been
"fix a dumb mistake and stick to preempt_enable".  Assuming Andrew picks
this patch up, it'll be folded into the patch that introduced the problem
in the first place and will the broken usage will never hit mainline.

> It's not only a problem for RT. It's also in mainline a violation of the
> preemption mechanism.
> 

Understood, thanks.

-- 
Mel Gorman
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe  requests -fix Mel Gorman <mgorman@techsingularity.net> - 2017-02-08 16:10 +0100
  Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe  requests -fix Mel Gorman <mgorman@techsingularity.net> - 2017-02-08 17:00 +0100
  Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe  requests -fix Thomas Gleixner <tglx@linutronix.de> - 2017-02-08 17:40 +0100

csiph-web