Re: [PATCH] libata: remove unlock+relock cycle in ata_scsi_queuecmd

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

 



On Tue, Nov 16, 2010 at 10:29 PM, Jeff Garzik <jeff@xxxxxxxxxx> wrote:
>
> +       spin_lock(shost->host_lock);
> +       scsi_cmd_get_serial(shost, cmd);
>        spin_unlock(shost->host_lock);

This is just sad.

How important is that serial number? So important that we need to do a
spinlock over it here? And it _must_ be per-shost?

Because if you made it per-ap, you could easily just move that logic
down to after you get the ap lock.

Just add a "unsigned int serial_number" into the ata_port struct, and
do the same (trivial) logic for getting a non-zero serial number
there:

  n = ap->serial_number;
  if (!++n)
    n = 1
  ap->serial_number = n;
  cmd->serial_number = n;

or something. And then you'd _really_ not need to touch that totally
pointless host lock at all.

               Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux