Re: [PATCH] scsi: scsi_host_queue_ready: increase busy count early

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

 



On Thu, 2021-01-21 at 11:05 +0100, Martin Wilck wrote:
> On Thu, 2021-01-21 at 10:07 +0100, Donald Buczek wrote:
> > 
> > Unfortunately, this patch (on top of 6eb045e092ef) did not fix the
> > problem. Same error (""controller is offline: status code
> > 0x6100c"")

Rethinking, this patch couldn't have fixed your problem. I apologize
for the dumb suggestion.

However, I still believe I had a point in that patch, and would like to
ask the experts for an opinion.

Assume no commands in flight (busy == 0), host_blocked == 2, and that
two CPUs enter scsi_host_queue_ready() at the same time. Before
6eb045e092ef, it was impossible that the function returned 1 on either
CPU in this situation.

CPU 1                              CPU 2

scsi_host_queue_ready              scsi_host_queue_ready
   host_busy = 1                      host_busy = 2
      (busy = 0)                         (busy = 1)
   host_blocked = 1                   goto starved
   goto out_dec                       add sdev to starved list
   host_busy = 1                      host_busy = 0
   return 0                           return 0
                                      
With 6eb045e092ef (and without my patch), the result could be:

CPU 1                              CPU 2

scsi_host_queue_ready              scsi_host_queue_ready
  read scsi_host_busy() = 0          read scsi_host_busy() = 0
  host_blocked = 1                   host_blocked = 0
  goto out_dec                       remove sdev from starved list
  return 0                           set SCMD_STATE_INFLIGHT 
                                       (host_busy = 1)
                                     return 1
  
So now, one command can be sent, and the host is unblocked. A very
different outcome than before. Was this intentional?

Thanks
Martin






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux