lkml.org 
[lkml]   [2010]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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/

\
 
 \ /
  Last update: 2010-11-17 07:47    [W:0.055 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site