Re: [PATCH 4/9] target: Avoid extra t_state_lock access in __target_execute_cmd

2013-06-07 Thread Christoph Hellwig
On Fri, Jun 07, 2013 at 09:34:19PM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch makes target_execute_cmd() set CMD_T_BUSY|CMD_T_SENT while > holding se_cmd->t_state_lock, in order to avoid the extra aquire/release > in __target_execute_cmd(). Can you also do an a

Re: [PATCH 1/9] target: Add transport_cmd_check_stop write_pending bit

2013-06-07 Thread Christoph Hellwig
On Sat, Jun 08, 2013 at 12:00:36AM -0400, Jörn Engel wrote: > > -static int transport_cmd_check_stop(struct se_cmd *cmd, bool > > remove_from_lists) > > +static int transport_cmd_check_stop(struct se_cmd *cmd, bool > > remove_from_lists, > > + bool write_pending) > .

Re: [PATCH 1/9] target: Add transport_cmd_check_stop write_pending bit

2013-06-07 Thread Jörn Engel
On Fri, 7 June 2013 21:34:16 +, Nicholas A. Bellinger wrote: > > -static int transport_cmd_check_stop(struct se_cmd *cmd, bool > remove_from_lists) > +static int transport_cmd_check_stop(struct se_cmd *cmd, bool > remove_from_lists, > + bool write_pending) ..

[PATCH 0/3] target: Per session tag pooling WIP using lib/tags

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi folks. Here is an initial series for adding target descriptor pre-allocation support based upon Kent's excellent per-cpu struct tag_pool library code. It allows fabric drivers to avoid fast path memory allocation/free overhead up to the number of registered struct ta

[PATCH 3/3] vhost/scsi: Convert to generic tag_alloc + tag_free command map

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes vhost/scsi to use transport_init_session_tagpool() pre-allocation logic for per-cpu session tag pooling with internal tag_alloc() + tag_free() calls based upon the saved se_cmd->map_tag id. FIXME: Make transport_init_session_tagpool() number of tags co

[PATCH 2/3] target: Add transport_init_session_tagpool using per-cpu command map

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds lib/tag.c based transport_init_session_tagpool() logic that allows fabric drivers to setup a per-cpu se_sess->sess_tag_pool and associated se_sess->sess_cmd_map for basic tagged pre-allocation of fabric descriptor sized memory. Cc: Kent Overstreet Cc: Ro

[PATCH 1/3] Percpu tag allocator

2013-06-07 Thread Nicholas A. Bellinger
From: Kent Overstreet Allocates integers out of a predefined range - for use by e.g. a driver to allocate tags for communicating with the device. Signed-off-by: Kent Overstreet Cc: Tejun Heo Cc: Oleg Nesterov Cc: Christoph Lameter Cc: Ingo Molnar Cc: Michael S. Tsirkin Cc: Asias He Signed

[PATCH 4/9] target: Avoid extra t_state_lock access in __target_execute_cmd

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch makes target_execute_cmd() set CMD_T_BUSY|CMD_T_SENT while holding se_cmd->t_state_lock, in order to avoid the extra aquire/release in __target_execute_cmd(). It also clears these bits in case of a target_handle_task_attr() failure. Cc: Christoph Hellwig Cc:

[PATCH 2/9] target: Drop unnecessary CMD_T_DEV_ACTIVE check from transport_lun_remove_cmd

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch drops an unnecessary acquire/release of se_cmd->t_state_lock within transport_lun_remove_cmd() when checking CMD_T_DEV_ACTIVE for invoking target_remove_from_state_list(). For all fast path completion cases, transport_lun_remove_cmd() is always called ahead of

[PATCH 1/9] target: Add transport_cmd_check_stop write_pending bit

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a new transport_cmd_check_stop() parameter for signaling when TRANSPORT_WRITE_PENDING needs to be set. This allows transport_generic_new_cmd() to avoid the extra lock acquire/release of ->t_state_lock in the fast path for DMA_TO_DEVICE operations ahead of

[PATCH 8/9] vhost/scsi: Drop unnecessary wait_for_tasks=true usage with transport_generic_free_cmd

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes vhost_scsi_free_cmd() to call transport_generic_free_cmd() with wait_for_tasks=false in order to avoid the extra se_cmd->t_state_lock access for the wait_for_tasks=true case. This is unnecessary because vhost_scsi_free_cmd() is only ever called by vhos

[PATCH 6/9] iscsi-target: Avoid unnecessary t_state_lock during unsolicited data-out check

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger In modern iscsi-target code, the setup and I/O submission is done within a single process context, so there is no need to acquire se_cmd->t_state_lock while checking SCF_SUPPORTED_SAM_OPCODE for determining when unsolicited data-out should be dumped. Cc: Christoph Hellw

[PATCH 3/9] target: Remove legacy t_fe_count + avoid t_state_lock access in transport_put_cmd

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch removes legacy se_cmd->t_fe_count usage in order to avoid se_cmd->t_state_lock access within transport_put_cmd() during normal fast path se_cmd descriptor release. Also drop the left-over parameter usage within core_tmr_handle_tas_abort() Cc: Christoph Hellwi

[PATCH 9/9] vhost/scsi: Convert to se_cmd->cmd_kref TARGET_SCF_ACK_KREF usage

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch coverts vhost/scsi to se_cmd->cmd_kref TARGET_SCF_ACK_KREF usage, instead of assuming that vhost_scsi_free_cmd() is always called before TCM processing is completed in the response fast path. This includes adding vhost_scsi_check_stop_free() -> target_put_sess

[PATCH 5/9] target: Drop unnecessary t_state_lock access for SCF_SUPPORTED_SAM_OPCODE assignment

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch drops the se_cmd->t_state_lock access around SCF_SUPPORTED_SAM_OPCODE assignment within target_setup_cmd_from_cdb(). Original v4.0 target code required this as fabrics would be checking for this values in different process contexts for setup and I/O submission

[PATCH 7/9] target: Drop legacy se_cmd->check_release bit

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Now with iscsi-target using modern se_cmd->cmd_kref accounting in v3.10 code, it's safe to go ahead and drop the legacy release codepath + se_cmd->check_release bit in transport_release_cmd() Cc: Christoph Hellwig Cc: Roland Dreier Cc: Kent Overstreet Cc: Or Gerlitz

[PATCH 0/9] target: Optimizations + cleanups for v3.11

2013-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi folks, This series contains a number of target optimizations added during recent prototype scsi-mq performance profiling in order to avoid unnecessary se_cmd->t_state_lock acquire/release in fast path I/O submission and completion code. All of the target optimization

Re: [PATCH 0/10] qla2xxx: Reduce the number of Coverity warnings

2013-06-07 Thread Saurav Kashyap
Hi Bart, Thanks for the patches. Please share the warnings reported by Coverity, so that its easy for us to review the patches. Thanks, ~Saurav >The current implementation of the qla2xxx Fibre Channel initiator driver >triggers multiple warnings when analyzed with the Coverity static >analyzer.

Re: [PATCH 3/4] scsi: improved eh timeout handler

2013-06-07 Thread Jörn Engel
On Thu, 6 June 2013 11:43:54 +0200, Hannes Reinecke wrote: > > + spin_lock_irqsave(&sdev->list_lock, flags); > + list_for_each_entry_safe(scmd, tmp, &sdev->eh_abort_list, eh_entry) { > + list_del_init(&scmd->eh_entry); > + spin_unlock_irqrestore(&sdev->list_lock, fl

Re: [PATCH 0/4] New SCSI command timeout handler

2013-06-07 Thread Jörn Engel
On Fri, 7 June 2013 14:54:16 +0800, Ren Mingxin wrote: > On 06/06/2013 05:43 PM, Hannes Reinecke wrote: > > This approach may not work for some LLDDs as you said, but I wonder > whether SAS is applicable(whether there will be later patches for > SAS). We have tested a derived patch on SAS and it

[PATCH 2/3] [SCSI] megaraid: Remove local (struct pci_dev) pdev's

2013-06-07 Thread Myron Stowe
With the driver now setup for default 32-bit DMA capabilities, remove the broken make_local_pdev() implementation and usages. Signed-off-by: Myron Stowe --- drivers/scsi/megaraid.c | 98 --- 1 files changed, 16 insertions(+), 82 deletions(-) diff -

[PATCH 3/3] [SCSI] megaraid: Remove 64-bit DMA related dead code

2013-06-07 Thread Myron Stowe
With the driver now setup for default 32-bit DMA capabilities, remove the 64-bit DMA related dead code. Signed-off-by: Myron Stowe --- drivers/scsi/megaraid.c | 45 + drivers/scsi/megaraid.h |1 - 2 files changed, 9 insertions(+), 37 deletions(-

[PATCH 1/3] [SCSI] megaraid: Remove 64-bit DMA_BIT_MASK capability

2013-06-07 Thread Myron Stowe
If the megaraid device is 64-bit DMA capable then, once it is setup, any subsequent DMA allocations for "internal commands" would not be properly restricted due to megaraid_probe_one() having called pci_set_dma_mask() on pdev with DMA_BIT_MASK(64). The driver attempts to solve this by using make_l

[PATCH 0/3] [SCSI] megaraid: Remove local (struct pci_dev) pdev's

2013-06-07 Thread Myron Stowe
While the megaraid device itself may be 64-bit DMA capable, 32-bit address restricted DMA buffers are apparently required for "internal commands" as is denoted by a couple of comments - "For all internal commands, the buffer must be allocated in <4GB address range" - within the driver. If the devi

Re: [PATCH 0/4] New SCSI command timeout handler

2013-06-07 Thread Hannes Reinecke
On 06/07/2013 08:54 AM, Ren Mingxin wrote: > Hi, Hannes: > > On 06/06/2013 05:43 PM, Hannes Reinecke wrote: >> this is the first step towards a new non-blocking >> error handler. This patch implements a new command >> timeout handler which will be sending command aborts >> inline without engaging

Re: [PATCH 0/4] New SCSI command timeout handler

2013-06-07 Thread Ren Mingxin
Hi, Hannes: On 06/06/2013 05:43 PM, Hannes Reinecke wrote: this is the first step towards a new non-blocking error handler. This patch implements a new command timeout handler which will be sending command aborts inline without engaging SCSI EH. In addition the commands will be returned directl