public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, dm-devel@redhat.com
Subject: Re: [RFC][PATCH] dm: Remove dm_bufio_cond_resched()
Date: Mon, 19 Sep 2016 12:47:52 +0200	[thread overview]
Message-ID: <20160919104752.GV5016@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.LRH.2.02.1609190542150.15526@file01.intranet.prod.int.rdu2.redhat.com>

On Mon, Sep 19, 2016 at 05:49:07AM -0400, Mikulas Patocka wrote:
> 
> 
> On Tue, 13 Sep 2016, Peter Zijlstra wrote:
> 
> > Hi all,
> > 
> > While grepping for PREEMPT_VOLUNTARY I ran into dm_bufio_cond_resched()
> > and wondered WTH it was about.
> 
> cond_resched() calls _cond_resched() even if when we have a preemptive 
> kernel - with preemptive kernel, calling cond_resched is pointless because 
> rescheduling is done peemtively.
> 
> So, I added that dm_bufio_cond_resched(), that does nothing on peemptive 
> kernels (and also on PREEMPT_NONE kernels where the user doesn't care 
> about latency).
> 
> What is the reason why cond_resched() tests for rescheduling with 
> preemptive kernel? Why should I use cond_resched() in that case?

Because every body else does too. 'Fixing' something like that in the dm
code is entirely the wrong place. Also, you loose out on the
might_sleep() warning implied in it.

As it happens, I have a patch fixing that somewhere, let me try and get
it merged.

But thanks for the reminder, I'll go write a Changelog for this so that
people can commit.

      reply	other threads:[~2016-09-19 10:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  8:45 [RFC][PATCH] dm: Remove dm_bufio_cond_resched() Peter Zijlstra
2016-09-13 12:49 ` Thomas Gleixner
2016-09-13 13:39 ` Mike Snitzer
2016-09-19 10:53   ` Peter Zijlstra
2016-09-22 20:53     ` Mikulas Patocka
2016-09-22 20:59       ` Thomas Gleixner
2016-09-23  7:34         ` Peter Zijlstra
2016-09-23  8:00           ` Thomas Gleixner
2016-09-23  9:05             ` Peter Zijlstra
2016-09-23  9:13               ` Thomas Gleixner
2016-09-23  9:26                 ` Ingo Molnar
2016-09-23 12:17             ` Mike Galbraith
2016-09-23 12:26               ` Peter Zijlstra
2016-09-23 12:39                 ` Mike Galbraith
2016-09-23 12:42                 ` Mike Snitzer
2016-09-23 12:46                   ` Peter Zijlstra
2016-09-23 14:32           ` [dm-devel] " Bart Van Assche
2016-09-19  9:49 ` Mikulas Patocka
2016-09-19 10:47   ` Peter Zijlstra [this message]

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=20160919104752.GV5016@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@redhat.com \
    --cc=tglx@linutronix.de \
    /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