Messages in this thread | | | From | Linus Torvalds <> | Date | Tue, 16 Nov 2010 22:44:14 -0800 | Subject | Re: [PATCH] libata: remove unlock+relock cycle in ata_scsi_queuecmd |
| |
On Tue, Nov 16, 2010 at 10:29 PM, Jeff Garzik <jeff@garzik.org> 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |