public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Tejun Heo <htejun@gmail.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH scsi-misc-2.6 01/08] scsi: remove unused bounce-buffer release path
Date: Wed, 23 Mar 2005 16:27:50 +0100	[thread overview]
Message-ID: <20050323152750.GC16149@suse.de> (raw)
In-Reply-To: <424107F9.5070807@gmail.com>

On Wed, Mar 23 2005, Tejun Heo wrote:
> 
>  Hello, James.
> 
> James Bottomley wrote:
> >On Wed, 2005-03-23 at 11:14 +0900, Tejun Heo wrote:
> >
> >>01_scsi_remove_scsi_release_buffers.patch
> >>
> >>	Buffer bouncing hasn't been done inside the scsi midlayer for
> >>	quite sometime now, but bounce-buffer release paths are still
> >>	around.  This patch removes these unused paths.
> >
> >
> >Yes, but scsi_release_buffers isn't referring to bounce buffers anymore,
> >it's simply releasing the sg buffers.
> >
> 
>  That's what I did.  Replacing scsi_release_buffers() calls with calls 
> to scsi_free_sgtable().  The only logic removed is bounce-buffer 
> release/copy-back.
> 
> >[...]
> >
> >>-	else if (cmd->buffer != req->buffer) {
> >>-		if (rq_data_dir(req) == READ) {
> >>-			unsigned long flags;
> >>-			char *to = bio_kmap_irq(req->bio, &flags);
> >>-			memcpy(to, cmd->buffer, cmd->bufflen);
> >>-			bio_kunmap_irq(to, &flags);
> >>-		}
> >>-		kfree(cmd->buffer);
> >>-	}
> >
> >
> >I'll defer to Jens here, but I don't thing you can just remove this ...
> >sg_io with a misaligned buffer will fail without this.
> 
>  AFAIK, those are done by blk_rq_map_user() and blk_rq_unmap_user(), 
> both of which are invoked directly by sg_io().
> 
> >That rather nasty code freeing cmd->buffer needs to be in there as
> >well ... so it does make sense to keep this API
> 
>  That code is invoked only for REQ_BLOCK_PC requests without bio, and I 
> digged pretty hard but, in those cases, AFAICT, the callers are 
> responsible for supplying dma-able buffers and nothing seems to alter 
> cmd->buffer after the cmd gets initialized, but I might be missing 
> things here.  If so, please point out.

That did not use to be true - eg request coming from the CDROM layer to
sr had to be bounced in the scsi layer for isa host adapters. I bet that
is still true.

-- 
Jens Axboe


  reply	other threads:[~2005-03-23 15:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-23  2:14 [PATCH scsi-misc-2.6 00/08] scsi: small fixes & cleanups Tejun Heo
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 01/08] scsi: remove unused bounce-buffer release path Tejun Heo
2005-03-23  4:07   ` James Bottomley
2005-03-23  6:08     ` Tejun Heo
2005-03-23 15:27       ` Jens Axboe [this message]
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 02/08] scsi: don't use blk_insert_request() for requeueing Tejun Heo
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 03/08] scsi: remove unused scsi_cmnd->internal_timeout field Tejun Heo
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 04/08] scsi: remove meaningless volatile qualifiers from structure definitions Tejun Heo
2005-03-23  4:15   ` James Bottomley
2005-03-23  4:22     ` Jeff Garzik
2005-03-23  5:28       ` Tejun Heo
2005-03-23 15:16       ` James Bottomley
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 05/08] scsi: remove a timer race from scsi_queue_insert() and cleanup timer Tejun Heo
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 06/08] scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field Tejun Heo
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 07/08] scsi: remove bogus {get|put}_device() calls Tejun Heo
2005-03-23  4:15   ` James Bottomley
2005-03-23  9:13     ` Tejun Heo
2005-03-29 17:02       ` Patrick Mansfield
2005-03-23  2:14 ` [PATCH scsi-misc-2.6 08/08] scsi: fix hot unplug sequence Tejun Heo
2005-03-23  4:08   ` James Bottomley
2005-03-23  4:50     ` Tejun Heo
2005-03-23  7:19       ` Jens Axboe
2005-03-23 15:20         ` James Bottomley
2005-03-23 15:25           ` Jens Axboe
2005-03-25  0:45             ` James Bottomley
2005-03-25  3:15               ` Tejun Heo
2005-03-25  5:02                 ` James Bottomley
2005-03-25  5:38                   ` Tejun Heo
2005-03-25 19:19                     ` James Bottomley
2005-03-25 21:43                       ` Tejun Heo
2005-03-25 22:49                         ` James Bottomley
2005-03-26  7:27                       ` Kai Makisara
2005-03-26 14:48                         ` James Bottomley
2005-03-23 15:12       ` James Bottomley

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=20050323152750.GC16149@suse.de \
    --to=axboe@suse.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox