linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Mel Gorman <mgorman@techsingularity.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Michal Hocko <mhocko@kernel.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix
Date: Wed, 8 Feb 2017 15:56:22 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1702081550440.3536@nanos> (raw)
In-Reply-To: <20170208143128.25ahymqlyspjcixu@techsingularity.net>

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.

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

Thanks,

	tglx



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-02-08 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 14:31 Mel Gorman
2017-02-08 14:56 ` Thomas Gleixner [this message]
2017-02-08 15:12   ` Mel Gorman

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=alpine.DEB.2.20.1702081550440.3536@nanos \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vbabka@suse.cz \
    /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