All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [RFC PATCH-mm] scsi: use unaligned endian helpers rather than byteshifting
Date: Wed, 3 Dec 2008 13:15:06 -0700	[thread overview]
Message-ID: <20081203201505.GE25548@parisc-linux.org> (raw)
In-Reply-To: <1228333043.5412.35.camel@brick>

On Wed, Dec 03, 2008 at 11:37:23AM -0800, Harvey Harrison wrote:
> Depends on the unaligned access work in -mm.  Just so you can see what the
> transition would look like.  See in particular the READ/WRITE6 bits
> as just reading the full 32 bits and masking ends up being better on
> lots of arches. (x86/powerpc/SH at least)

>  		case WRITE_6:
>  		case READ_6:
> -			lba = ((scsicmd->cmnd[1] & 0x1F) << 16) |
> -			    (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];
> +			lba = load_be32_noalign((__be32 *)&scsicmd->cmnd[0]) & 0x1fffff;
>  			break;

That may well generate better code, but I have a hard time convincing
myself that it's correct.  This badly needs to be abstracted into
something *THAT MAKES SENSE FOR SCSI*.

James, if I resend my patches that introduce scsi_get_u24() et al, will
you apply them?  I'm tired of having to nack all the crazy patches that
Harvey keeps sending.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2008-12-03 20:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 19:37 [RFC PATCH-mm] scsi: use unaligned endian helpers rather than byteshifting Harvey Harrison
2008-12-03 20:15 ` Matthew Wilcox [this message]
2008-12-03 20:27   ` Harvey Harrison
2008-12-03 20:33 ` James Bottomley
2008-12-05  9:07   ` Harvey Harrison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081203201505.GE25548@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.