linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: block: only use __set_current_state() for polled IO
Date: Wed, 2 Jan 2019 11:14:37 -0700	[thread overview]
Message-ID: <9d2da835-fe54-947a-85da-cedb4423bca0@kernel.dk> (raw)
In-Reply-To: <CAHk-=whcmNjH+3pP_tgKbxe3iNu20eVVxfDyVXrKsNf7HiR0WA@mail.gmail.com>

On 1/2/19 11:11 AM, Linus Torvalds wrote:
> On Wed, Jan 2, 2019 at 10:07 AM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> Stop this craziness. The optimization is garbage. If you want to save
>> 15 cycles, get rid of code, don't add new code in an area where the
>> block maintainers have already shown that they can't get it right.
> 
> Side note: that argument is further strengthened by a very simple
> observation: if the code isn't going to sleep, then the whole state
> setting is entirely and utterly pointless.
> 
> So code like this:
> 
> +                       if (is_poll)
> +                               __set_current_state(TASK_UNINTERRUPTIBLE);
> 
> is *FUNDAMENTAL* garbage.
> 
> Seriously, stop playing stupid games. You're doing things wrong.
> 
> I'm doing to revert that buggy commit, and I will not pull any crazy
> code that tries to redo this kind of completely broken code.

Note that the blk-mq hunk is fine, since that's ONLY used for polling.
We should get rid of the state setting there completely though, which is
something we can do now that polling is strictly a non-IRQ type of IO.

The swap part may fall back to non-polled, so better safer than sorry on
that one.

-- 
Jens Axboe


  reply	other threads:[~2019-01-02 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 17:55 block: only use __set_current_state() for polled IO Jens Axboe
2019-01-02 18:07 ` Linus Torvalds
2019-01-02 18:10   ` Jens Axboe
2019-01-02 18:11   ` Linus Torvalds
2019-01-02 18:14     ` Jens Axboe [this message]
2019-01-02 18:55       ` Linus Torvalds
2019-01-02 18:59         ` Jens Axboe

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=9d2da835-fe54-947a-85da-cedb4423bca0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).