Re: [PATCH 15/18] scsi: allocate scsi_cmnd structures as part of struct request

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

 



On Wed, 2017-01-25 at 18:25 +0100, Christoph Hellwig wrote:
> -unsigned char *scsi_alloc_sense_buffer(struct Scsi_Host *shost, gfp_t gfp_mask,
> -               int numa_node)
> +static unsigned char *scsi_alloc_sense_buffer(struct Scsi_Host *shost,
> +       gfp_t gfp_mask, int numa_node)
>  {
>         return kmem_cache_alloc_node(scsi_select_sense_cache(shost), gfp_mask,
>                         numa_node);
> @@ -697,14 +696,13 @@ static bool scsi_end_request(struct request *req, int error,
>  
>                 if (bidi_bytes)
>                         scsi_release_bidi_buffers(cmd);
> +               scsi_release_buffers(cmd);
> +               scsi_put_command(cmd);
>  
>                 spin_lock_irqsave(q->queue_lock, flags);
>                 blk_finish_request(req, error);
>                 spin_unlock_irqrestore(q->queue_lock, flags);
>  
> -               scsi_release_buffers(cmd);
> -
> -               scsi_put_command(cmd);
>                 scsi_run_queue(q);
>         }

Hello Christoph,

Why have the scsi_release_buffers() and scsi_put_command(cmd) calls been
moved up? I haven't found an explanation for this change in the patch
description.

Please also consider to remove the cmd->request->special = NULL assignments
via this patch. Since this patch makes the lifetime of struct scsi_cmnd and
struct request identical these assignments are no longer needed.

This patch introduces the function scsi_exit_rq(). Having two functions
for the single-queue path that release resources (scsi_release_buffers()
and scsi_exit_rq()) is confusing. Since every scsi_release_buffers() call
is followed by a blk_unprep_request() call, have you considered to move
the scsi_release_buffers() call into scsi_unprep_fn() via an additional
patch?

Thanks,

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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux