Re: block: only use __set_current_state() for polled IO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/2/19 11:11 AM, Linus Torvalds wrote:
> On Wed, Jan 2, 2019 at 10:07 AM Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> 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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux