[PATCH-v4 04/10] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-06-01 Thread Nicholas A. Bellinger
From: Christoph Hellwig Clean up the mess of registered variables, and pass the isid mismatch flag explicitly instead of overloading the registration type. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_pr.c

[PATCH-v4 01/10] target: Convert se_node_acl->device_list[] to RCU hlist

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_node_acl->device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. It converts transport_lookup_*_lun() fast-path code to use RCU read path primitives when looking

[PATCH-v4 10/10] target: Drop left-over se_lun->lun_status

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Now that se_portal_group->tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun->lun_status usage. Reported-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_tpg.

[PATCH-v4 08/10] target: Drop unused se_lun->lun_acl_list

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_device.c | 15 --- drivers/target/target_core_tpg.c| 4 include/target/target_core_base.h | 3 --- 3 files

[PATCH-v4 06/10] target: Convert se_tpg->acl_node_lock to ->acl_node_mutex

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_tpg->acl_node_lock to struct mutex, so that ->acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold ->acl_node_mutex whe

Re: linux-next: manual merge of the target-updates tree with Linus' tree

2015-06-01 Thread Nicholas A. Bellinger
Hi Stephen, On Mon, 2015-06-01 at 20:48 +1000, Stephen Rothwell wrote: Hi Nicholas, Today's linux-next merge of the target-updates tree got a conflict in drivers/target/target_core_configfs.c between commit d588cf8f618d (target: Fix se_tpg_tfo-tf_subsys regression + remove tf_subsystem)

Re: linux-next: manual merge of the target-updates tree with the tree

2015-06-01 Thread Nicholas A. Bellinger
On Mon, 2015-06-01 at 21:22 +1000, Stephen Rothwell wrote: Hi Nicholas, Today's linux-next merge of the target-updates tree got so many conflicts against Linus' tree that I just gave up and dropped it completely. Please fix up this mess. Apologies for the conflicts vs. mainline in

[PATCH-v3 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is v3 series with HCH's recent changes to go ahead and drop all se_port + t10_alua_tg_pt_gp_member usage within target-core in favor of direct se_lun pointer dereference. This includes the original patch + minor fixes, along with two

Re: [PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-06-01 Thread Nicholas A. Bellinger
On Tue, 2015-05-26 at 11:41 +0200, Hannes Reinecke wrote: On 05/26/2015 08:25 AM, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is -v3 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU

[PATCH-v4 01/10] target: Convert se_node_acl-device_list[] to RCU hlist

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts se_node_acl-device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. It converts transport_lookup_*_lun() fast-path code to use RCU read path primitives

[PATCH-v4 10/10] target: Drop left-over se_lun-lun_status

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Now that se_portal_group-tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun-lun_status usage. Reported-by: Christoph Hellwig h...@lst.de Reviewed-by: Hannes Reinecke h...@suse.de Signed-off-by: Nicholas Bellinger n...@linux

[PATCH-v4 02/10] target/pr: Use atomic bitop for se_dev_entry-deve_flags reservation check

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the core_scsi3_pr_seq_non_holder() check for non reservation holding registrations to use an atomic bitop in -deve_flags to determine if a registration is currently active. It also includes associated a set_bit

[PATCH-v4 07/10] target: Convert core_tpg_deregister to use list splice

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts core_tpg_deregister() to perform a list splice for any remaining dynamically generated se_node_acls attached to se_tpg, before calling kfree(nacl) to free memory. Reviewed-by: Hannes Reinecke h...@suse.de Cc: Christoph Hellwig h

[PATCH-v4 09/10] target: Only reset specific dynamic entries during lun_group creation

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch changes core_tpg_add_node_to_devs() to avoid unnecessarly resetting every se_dev_entry in se_node_acl-tpg_lun_hlist when the operation is driven by an explicit configfs se_lun-lun_group creation via core_dev_add_lun() to only update

[PATCH-v4 03/10] target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch changes __core_scsi3_do_alloc_registration() code to drop pr_reg-pr_reg_tg_pt_lun pointer usage in favor of a new pr_reg RPTI + existing pr_reg-pr_aptpl_target_lun used by APTPL metadata logic. It also includes changes to REGISTER

[PATCH-v4 00/10] target: se_node_acl + se_lun RCU conversions

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is -v4 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU (read-copy-update) hlist_heads. This turns fast-path I/O into a lock-less RCU reader using existing percpu based se_lun

[PATCH-v4 05/10] target: Convert se_portal_group-tpg_lun_list[] to RCU hlist

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the fixed size se_portal_group-tpg_lun_list[] to use modern RCU with hlist_head in order to support an arbitary number of se_lun ports per target endpoint. It includes dropping core_tpg_alloc_lun() from core_dev_add_lun

[PATCH-v4 08/10] target: Drop unused se_lun-lun_acl_list

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Reviewed-by: Hannes Reinecke h...@suse.de Cc: Christoph Hellwig h...@lst.de Cc: Sagi Grimberg sa...@mellanox.com Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target/target_core_device.c | 15 --- drivers/target

[PATCH-v4 06/10] target: Convert se_tpg-acl_node_lock to -acl_node_mutex

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts se_tpg-acl_node_lock to struct mutex, so that -acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold -acl_node_mutex when calling

[PATCH-v4 04/10] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-06-01 Thread Nicholas A. Bellinger
From: Christoph Hellwig h...@lst.de Clean up the mess of registered variables, and pass the isid mismatch flag explicitly instead of overloading the registration type. Signed-off-by: Christoph Hellwig h...@lst.de Reviewed-by: Hannes Reinecke h...@suse.de Signed-off-by: Nicholas Bellinger n

[PATCH-v3 1/4] target: Subsume se_port + t10_alua_tg_pt_gp_member into se_lun

2015-06-01 Thread Nicholas A. Bellinger
-off-by: Christoph Hellwig h...@lst.de Reviewed-by: Hannes Reinecke h...@suse.de Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target/target_core_alua.c| 394 ++- drivers/target/target_core_alua.h| 14 +- drivers/target

[PATCH-v3 2/4] target: Drop lun_sep_lock for se_lun-lun_se_dev RCU usage

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org With se_port and t10_alua_tg_pt_gp_member being absored into se_lun, there is no need for an extra lock to protect se_lun-lun_se_dev assignment. This patch also converts backend drivers to use call_rcu() release to allow any se_device readers

[PATCH-v3 3/4] target: Drop se_lun-lun_active for existing percpu lun_ref

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org With se_port_t and t10_alua_tg_pt_gp_member being absored into se_lun, there is no need for an extra atomic_t based reference count for PR ALL_TG_PT=1 and ALUA access state transition. Go ahead and use the existing percpu se_lun-lun_ref instead

[PATCH-v3 4/4] target: Drop unnecessary core_tpg_register TFO parameter

2015-06-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch drops unnecessary target_core_fabric_ops parameter usage for core_tpg_register() during fabric driver TFO-fabric_make_tpg() se_portal_group creation callback execution. Instead, use the existing se_wwn-wwn_tf-tf_ops pointer to ensure

Re: [PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

2015-05-30 Thread Nicholas A. Bellinger
On Thu, 2015-05-28 at 08:57 -0700, Paul E. McKenney wrote: > On Wed, May 27, 2015 at 11:02:10PM -0700, Nicholas A. Bellinger wrote: > > On Wed, 2015-05-27 at 14:04 -0700, Paul E. McKenney wrote: > > > On Tue, May 26, 2015 at 10:29:45PM -0700, Nicholas

[GIT PULL] target fixes for v4.1-rc6

2015-05-30 Thread Nicholas A. Bellinger
): target: Fix bidi command handling target: Add missing parentheses Christoph Hellwig (1): target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem Evgenii Lepikhin (1): ISCSI: fix minor memory leak Nicholas Bellinger (1): target: Drop signal_pending checks after interruptible l

[GIT PULL] target fixes for v4.1-rc6

2015-05-30 Thread Nicholas A. Bellinger
): target: Fix bidi command handling target: Add missing parentheses Christoph Hellwig (1): target: Fix se_tpg_tfo-tf_subsys regression + remove tf_subsystem Evgenii Lepikhin (1): ISCSI: fix minor memory leak Nicholas Bellinger (1): target: Drop signal_pending checks after interruptible lock

Re: [PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun-lun_se_dev RCU usage

2015-05-30 Thread Nicholas A. Bellinger
On Thu, 2015-05-28 at 08:57 -0700, Paul E. McKenney wrote: On Wed, May 27, 2015 at 11:02:10PM -0700, Nicholas A. Bellinger wrote: On Wed, 2015-05-27 at 14:04 -0700, Paul E. McKenney wrote: On Tue, May 26, 2015 at 10:29:45PM -0700, Nicholas A. Bellinger wrote: SNIP In this particular

Re: [PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

2015-05-28 Thread Nicholas A. Bellinger
On Wed, 2015-05-27 at 14:04 -0700, Paul E. McKenney wrote: > On Tue, May 26, 2015 at 10:29:45PM -0700, Nicholas A. Bellinger wrote: > > On Tue, 2015-05-26 at 16:30 +0200, Bart Van Assche wrote: > > > On 05/26/15 08:57, Nicholas A. Bellinger wrote: > > >

Re: [PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun-lun_se_dev RCU usage

2015-05-28 Thread Nicholas A. Bellinger
On Wed, 2015-05-27 at 14:04 -0700, Paul E. McKenney wrote: On Tue, May 26, 2015 at 10:29:45PM -0700, Nicholas A. Bellinger wrote: On Tue, 2015-05-26 at 16:30 +0200, Bart Van Assche wrote: On 05/26/15 08:57, Nicholas A. Bellinger wrote: @@ -625,6 +626,7 @@ int

Re: [PATCH-v2 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-05-27 Thread Nicholas A. Bellinger
On Wed, 2015-05-27 at 13:36 -0700, Paul E. McKenney wrote: > On Tue, May 26, 2015 at 10:13:02PM -0700, Nicholas A. Bellinger wrote: > > On Tue, 2015-05-26 at 14:44 +0200, Bart Van Assche wrote: > > > On 05/26/15 08:57, Nicholas A. Bellinger wrote: > > > >

Re: [PATCH-v2 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-05-27 Thread Nicholas A. Bellinger
On Wed, 2015-05-27 at 13:36 -0700, Paul E. McKenney wrote: On Tue, May 26, 2015 at 10:13:02PM -0700, Nicholas A. Bellinger wrote: On Tue, 2015-05-26 at 14:44 +0200, Bart Van Assche wrote: On 05/26/15 08:57, Nicholas A. Bellinger wrote: - Add various rcu_dereference

Re: [PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

2015-05-26 Thread Nicholas A. Bellinger
On Tue, 2015-05-26 at 16:30 +0200, Bart Van Assche wrote: > On 05/26/15 08:57, Nicholas A. Bellinger wrote: > > @@ -625,6 +626,7 @@ int core_dev_add_initiator_node_lun_acl( > > u32 lun_access) > > { > > struct se_node_acl *nacl = lacl->se_lun_nacl;

Re: [PATCH-v2 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-05-26 Thread Nicholas A. Bellinger
On Tue, 2015-05-26 at 14:44 +0200, Bart Van Assche wrote: > On 05/26/15 08:57, Nicholas A. Bellinger wrote: > >- Add various rcu_dereference and lockless_dereference RCU notation > > Hello Nic, > > Feedback from an RCU expert (which I'm not) would be appreciated here. &

[PATCH-v2 3/4] target: Drop se_lun->lun_active for existing percpu lun_ref

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With se_port_t and t10_alua_tg_pt_gp_member being absored into se_lun, there is no need for an extra atomic_t based reference count for PR ALL_TG_PT=1 and ALUA access state transition. Go ahead and use the existing percpu se_lun->lun_ref instead, and convert the

[PATCH-v2 1/4] target: Subsume se_port + t10_alua_tg_pt_gp_member into se_lun

2015-05-26 Thread Nicholas A. Bellinger
off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_alua.c| 392 ++- drivers/target/target_core_alua.h| 14 +- drivers/target/target_core_configfs.c| 11 +- drivers/target/target_core_device.c |

[PATCH-v3 01/10] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_node_acl->device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. It converts transport_lookup_*_lun() fast-path code to use RCU read path primitives when looking

[PATCH-v2 4/4] target: Drop unnecessary core_tpg_register TFO parameter

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch drops unnecessary target_core_fabric_ops parameter usage for core_tpg_register() during fabric driver TFO->fabric_make_tpg() se_portal_group creation callback execution. Instead, use the existing se_wwn->wwn_tf->tf_ops pointer to ensure fabr

[PATCH-v2 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi all, Here is v2 series with HCH's recent changes to go ahead and drop all se_port + t10_alua_tg_pt_gp_member usage within target-core in favor of direct se_lun pointer dereference. This includes the original patch + minor fixes, along with two other improvements

[PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With se_port and t10_alua_tg_pt_gp_member being absored into se_lun, there is no need for an extra lock to protect se_lun->lun_se_dev assignment. This patch also converts backend drivers to use call_rcu() release to allow any se_device readers to complete. The call_

[PATCH-v3 02/10] target/pr: Use atomic bitop for se_dev_entry->deve_flags reservation check

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts the core_scsi3_pr_seq_non_holder() check for non reservation holding registrations to use an atomic bitop in ->deve_flags to determine if a registration is currently active. It also includes associated a set_bit() in __core_scsi3_add_registrat

[PATCH-v3 05/10] target: Convert se_portal_group->tpg_lun_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts the fixed size se_portal_group->tpg_lun_list[] to use modern RCU with hlist_head in order to support an arbitary number of se_lun ports per target endpoint. It includes dropping core_tpg_alloc_lun() from core_dev_add_lun(), and calling it direc

[PATCH-v3 08/10] target: Drop unused se_lun->lun_acl_list

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_device.c | 15 --- drivers/target/target_core_tpg.c| 4 include/target/target_core_base.h | 3 --- 3 files changed

[PATCH-v3 07/10] target: Convert core_tpg_deregister to use list splice

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts core_tpg_deregister() to perform a list splice for any remaining dynamically generated se_node_acls attached to se_tpg, before calling kfree(nacl) to free memory. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas

[PATCH-v3 03/10] target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes __core_scsi3_do_alloc_registration() code to drop pr_reg->pr_reg_tg_pt_lun pointer usage in favor of a new pr_reg RPTI + existing target_lun. It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL feature bit codepaths. Cc: Hannes Reine

[PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi all, Here is -v3 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU hlist_heads. This turns fast-path I/O into a lock-less RCU reader using existing percpu based se_lun->lun_ref logic, and converts the

[PATCH-v3 06/10] target: Convert se_tpg->acl_node_lock to ->acl_node_mutex

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_tpg->acl_node_lock to struct mutex, so that ->acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold ->acl_node_mutex whe

[PATCH-v3 07/10] target: Convert core_tpg_deregister to use list splice

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts core_tpg_deregister() to perform a list splice for any remaining dynamically generated se_node_acls attached to se_tpg, before calling kfree(nacl) to free memory. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas

[PATCH-v3 06/10] target: Convert se_tpg->acl_node_lock to ->acl_node_mutex

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_tpg->acl_node_lock to struct mutex, so that ->acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold ->acl_node_mutex whe

[PATCH-v3 10/10] target: Drop left-over se_lun->lun_status

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Now that se_portal_group->tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun->lun_status usage. Reported-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_tpg.c | 6 -- include/

[PATCH-v3 03/10] target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes __core_scsi3_do_alloc_registration() code to drop pr_reg->pr_reg_tg_pt_lun pointer usage in favor of a new pr_reg RPTI + existing target_lun. It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL feature bit codepaths. Cc: Hannes Reine

[PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi all, Here is -v3 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU hlist_heads. This turns fast-path I/O into a lock-less RCU reader using existing percpu based se_lun->lun_ref logic, and converts the

[PATCH-v3 08/10] target: Drop unused se_lun->lun_acl_list

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_device.c | 15 --- drivers/target/target_core_tpg.c| 4 include/target/target_core_base.h | 3 --- 3 files changed

[PATCH-v3 09/10] target: Only reset specific dynamic entries during lun_group creation

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes core_tpg_add_node_to_devs() to avoid unnecessarly resetting every se_dev_entry in se_node_acl->tpg_lun_hlist when the operation is driven by an explicit configfs se_lun->lun_group creation via core_dev_add_lun() to only update a single

[PATCH-v3 04/10] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-05-26 Thread Nicholas A. Bellinger
From: Christoph Hellwig Clean up the mess of registered variables, and pass the isid mismatch flag explicitly instead of overloading the registration type. Signed-off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_pr.c | 44

[PATCH-v3 02/10] target/pr: Use atomic bitop for se_dev_entry->deve_flags reservation check

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts the core_scsi3_pr_seq_non_holder() check for non reservation holding registrations to use an atomic bitop in ->deve_flags to determine if a registration is currently active. It also includes associated a set_bit() in __core_scsi3_add_registrat

Re: [PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-05-26 Thread Nicholas A. Bellinger
Please ignore this resend.. On Tue, 2015-05-26 at 06:40 +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hi all, > > Here is -v3 series for converting LIO target se_node_acl + se_lun > mapping tables from fixed size arrays to dynamic RCU hlist_heads. > &

[PATCH-v3 01/10] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_node_acl->device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. It converts transport_lookup_*_lun() fast-path code to use RCU read path primitives when looking

[PATCH-v3 05/10] target: Convert se_portal_group->tpg_lun_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts the fixed size se_portal_group->tpg_lun_list[] to use modern RCU with hlist_head in order to support an arbitary number of se_lun ports per target endpoint. It includes dropping core_tpg_alloc_lun() from core_dev_add_lun(), and calling it direc

[PATCH-v3 09/10] target: Only reset specific dynamic entries during lun_group creation

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes core_tpg_add_node_to_devs() to avoid unnecessarly resetting every se_dev_entry in se_node_acl->tpg_lun_hlist when the operation is driven by an explicit configfs se_lun->lun_group creation via core_dev_add_lun() to only update a single

[PATCH-v3 04/10] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-05-26 Thread Nicholas A. Bellinger
From: Christoph Hellwig Clean up the mess of registered variables, and pass the isid mismatch flag explicitly instead of overloading the registration type. Signed-off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_pr.c | 44

[PATCH-v3 10/10] target: Drop left-over se_lun->lun_status

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Now that se_portal_group->tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun->lun_status usage. Reported-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_tpg.c | 6 -- include/

Re: [PATCH-v2 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-05-26 Thread Nicholas A. Bellinger
On Tue, 2015-05-26 at 14:44 +0200, Bart Van Assche wrote: On 05/26/15 08:57, Nicholas A. Bellinger wrote: - Add various rcu_dereference and lockless_dereference RCU notation Hello Nic, Feedback from an RCU expert (which I'm not) would be appreciated here. But my understanding

Re: [PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun-lun_se_dev RCU usage

2015-05-26 Thread Nicholas A. Bellinger
On Tue, 2015-05-26 at 16:30 +0200, Bart Van Assche wrote: On 05/26/15 08:57, Nicholas A. Bellinger wrote: @@ -625,6 +626,7 @@ int core_dev_add_initiator_node_lun_acl( u32 lun_access) { struct se_node_acl *nacl = lacl-se_lun_nacl; + struct se_device *dev

[PATCH-v3 09/10] target: Only reset specific dynamic entries during lun_group creation

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch changes core_tpg_add_node_to_devs() to avoid unnecessarly resetting every se_dev_entry in se_node_acl-tpg_lun_hlist when the operation is driven by an explicit configfs se_lun-lun_group creation via core_dev_add_lun() to only update

[PATCH-v3 04/10] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-05-26 Thread Nicholas A. Bellinger
From: Christoph Hellwig h...@lst.de Clean up the mess of registered variables, and pass the isid mismatch flag explicitly instead of overloading the registration type. Signed-off-by: Christoph Hellwig h...@lst.de Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target

[PATCH-v3 02/10] target/pr: Use atomic bitop for se_dev_entry-deve_flags reservation check

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the core_scsi3_pr_seq_non_holder() check for non reservation holding registrations to use an atomic bitop in -deve_flags to determine if a registration is currently active. It also includes associated a set_bit

[PATCH-v3 08/10] target: Drop unused se_lun-lun_acl_list

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Cc: Hannes Reinecke h...@suse.de Cc: Christoph Hellwig h...@lst.de Cc: Sagi Grimberg sa...@mellanox.com Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target/target_core_device.c | 15 --- drivers/target

[PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is -v3 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU hlist_heads. This turns fast-path I/O into a lock-less RCU reader using existing percpu based se_lun-lun_ref logic

[PATCH-v3 03/10] target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch changes __core_scsi3_do_alloc_registration() code to drop pr_reg-pr_reg_tg_pt_lun pointer usage in favor of a new pr_reg RPTI + existing target_lun. It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL feature bit codepaths

Re: [PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-05-26 Thread Nicholas A. Bellinger
Please ignore this resend.. On Tue, 2015-05-26 at 06:40 +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is -v3 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU hlist_heads

[PATCH-v3 01/10] target: Convert se_node_acl-device_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts se_node_acl-device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. It converts transport_lookup_*_lun() fast-path code to use RCU read path primitives

[PATCH-v3 05/10] target: Convert se_portal_group-tpg_lun_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the fixed size se_portal_group-tpg_lun_list[] to use modern RCU with hlist_head in order to support an arbitary number of se_lun ports per target endpoint. It includes dropping core_tpg_alloc_lun() from core_dev_add_lun

[PATCH-v3 10/10] target: Drop left-over se_lun-lun_status

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Now that se_portal_group-tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun-lun_status usage. Reported-by: Christoph Hellwig h...@lst.de Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target

[PATCH-v3 06/10] target: Convert se_tpg-acl_node_lock to -acl_node_mutex

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts se_tpg-acl_node_lock to struct mutex, so that -acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold -acl_node_mutex when calling

[PATCH-v3 05/10] target: Convert se_portal_group-tpg_lun_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the fixed size se_portal_group-tpg_lun_list[] to use modern RCU with hlist_head in order to support an arbitary number of se_lun ports per target endpoint. It includes dropping core_tpg_alloc_lun() from core_dev_add_lun

[PATCH-v3 02/10] target/pr: Use atomic bitop for se_dev_entry-deve_flags reservation check

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the core_scsi3_pr_seq_non_holder() check for non reservation holding registrations to use an atomic bitop in -deve_flags to determine if a registration is currently active. It also includes associated a set_bit

[PATCH-v3 06/10] target: Convert se_tpg-acl_node_lock to -acl_node_mutex

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts se_tpg-acl_node_lock to struct mutex, so that -acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold -acl_node_mutex when calling

[PATCH-v3 10/10] target: Drop left-over se_lun-lun_status

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Now that se_portal_group-tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun-lun_status usage. Reported-by: Christoph Hellwig h...@lst.de Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target

[PATCH-v3 00/10] target: se_node_acl + se_lun RCU conversions

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is -v3 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU hlist_heads. This turns fast-path I/O into a lock-less RCU reader using existing percpu based se_lun-lun_ref logic

[PATCH-v3 07/10] target: Convert core_tpg_deregister to use list splice

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts core_tpg_deregister() to perform a list splice for any remaining dynamically generated se_node_acls attached to se_tpg, before calling kfree(nacl) to free memory. Cc: Hannes Reinecke h...@suse.de Cc: Christoph Hellwig h...@lst.de

[PATCH-v3 09/10] target: Only reset specific dynamic entries during lun_group creation

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch changes core_tpg_add_node_to_devs() to avoid unnecessarly resetting every se_dev_entry in se_node_acl-tpg_lun_hlist when the operation is driven by an explicit configfs se_lun-lun_group creation via core_dev_add_lun() to only update

[PATCH-v3 04/10] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-05-26 Thread Nicholas A. Bellinger
From: Christoph Hellwig h...@lst.de Clean up the mess of registered variables, and pass the isid mismatch flag explicitly instead of overloading the registration type. Signed-off-by: Christoph Hellwig h...@lst.de Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target

[PATCH-v3 03/10] target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch changes __core_scsi3_do_alloc_registration() code to drop pr_reg-pr_reg_tg_pt_lun pointer usage in favor of a new pr_reg RPTI + existing target_lun. It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL feature bit codepaths

[PATCH-v3 07/10] target: Convert core_tpg_deregister to use list splice

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts core_tpg_deregister() to perform a list splice for any remaining dynamically generated se_node_acls attached to se_tpg, before calling kfree(nacl) to free memory. Cc: Hannes Reinecke h...@suse.de Cc: Christoph Hellwig h...@lst.de

[PATCH-v3 08/10] target: Drop unused se_lun-lun_acl_list

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Cc: Hannes Reinecke h...@suse.de Cc: Christoph Hellwig h...@lst.de Cc: Sagi Grimberg sa...@mellanox.com Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target/target_core_device.c | 15 --- drivers/target

[PATCH-v2 4/4] target: Drop unnecessary core_tpg_register TFO parameter

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch drops unnecessary target_core_fabric_ops parameter usage for core_tpg_register() during fabric driver TFO-fabric_make_tpg() se_portal_group creation callback execution. Instead, use the existing se_wwn-wwn_tf-tf_ops pointer to ensure

[PATCH-v3 01/10] target: Convert se_node_acl-device_list[] to RCU hlist

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts se_node_acl-device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. It converts transport_lookup_*_lun() fast-path code to use RCU read path primitives

[PATCH-v2 0/4] target: Eliminate se_port + t10_alua_tg_pt_gp_member

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org Hi all, Here is v2 series with HCH's recent changes to go ahead and drop all se_port + t10_alua_tg_pt_gp_member usage within target-core in favor of direct se_lun pointer dereference. This includes the original patch + minor fixes, along with two

[PATCH-v2 2/4] target: Drop lun_sep_lock for se_lun-lun_se_dev RCU usage

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org With se_port and t10_alua_tg_pt_gp_member being absored into se_lun, there is no need for an extra lock to protect se_lun-lun_se_dev assignment. This patch also converts backend drivers to use call_rcu() release to allow any se_device readers

[PATCH-v2 3/4] target: Drop se_lun-lun_active for existing percpu lun_ref

2015-05-26 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org With se_port_t and t10_alua_tg_pt_gp_member being absored into se_lun, there is no need for an extra atomic_t based reference count for PR ALL_TG_PT=1 and ALUA access state transition. Go ahead and use the existing percpu se_lun-lun_ref instead

[PATCH-v2 1/4] target: Subsume se_port + t10_alua_tg_pt_gp_member into se_lun

2015-05-26 Thread Nicholas A. Bellinger
-off-by: Christoph Hellwig h...@lst.de Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/target/target_core_alua.c| 392 ++- drivers/target/target_core_alua.h| 14 +- drivers/target/target_core_configfs.c| 11 +- drivers

Re: [PATCH-v2 1/9] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-25 Thread Nicholas A. Bellinger
On Mon, 2015-05-25 at 15:14 -0700, Nicholas A. Bellinger wrote: > On Fri, 2015-05-22 at 13:31 +0200, Christoph Hellwig wrote: > > On Fri, May 22, 2015 at 01:55:30AM -0700, Nicholas A. Bellinger wrote: > > > > > + kref_put(>pr_k

Re: [PATCH 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

2015-05-25 Thread Nicholas A. Bellinger
rently requires that each driver do it's own call_rcu(). >From c933729d347fcb3d226500346ed06deb011e73bb Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Sat, 23 May 2015 23:35:56 -0700 Subject: [PATCH] target: Convert to backend driver call_rcu release Reported-by: Christoph Hellwig Signed-off-by: Nicholas Bellinge

Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check

2015-05-25 Thread Nicholas A. Bellinger
On Fri, 2015-05-22 at 13:52 +0200, Christoph Hellwig wrote: > > > > -/* > > - * this function can be called with struct se_device->dev_reservation_lock > > - * when register_move = 1 > > - */ > > static void __core_scsi3_add_registration( > > struct se_device *dev, > > struct

Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check

2015-05-25 Thread Nicholas A. Bellinger
On Fri, 2015-05-22 at 13:34 +0200, Christoph Hellwig wrote: > On Fri, May 22, 2015 at 02:05:57AM -0700, Nicholas A. Bellinger wrote: > > On Fri, 2015-05-22 at 10:26 +0200, Christoph Hellwig wrote: > > > On Fri, May 22, 2015 at 06:11:04AM +, Nicholas

Re: [PATCH-v2 1/9] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-25 Thread Nicholas A. Bellinger
On Fri, 2015-05-22 at 13:31 +0200, Christoph Hellwig wrote: > On Fri, May 22, 2015 at 01:55:30AM -0700, Nicholas A. Bellinger wrote: > > > This update will now be racy, ditto for the read/write_bytes update > > > later. > > > > This should become an atomic_

Re: [PATCH-v2 0/9] target: se_node_acl + se_lun RCU conversions

2015-05-25 Thread Nicholas A. Bellinger
On Fri, 2015-05-22 at 12:15 +0200, Bart Van Assche wrote: > On 05/22/15 08:11, Nicholas A. Bellinger wrote: > > Here is -v2 series for converting LIO target se_node_acl + se_lun > > mapping tables from fixed size arrays to dynamic RCU hlist_heads. > > The full list o

Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check

2015-05-25 Thread Nicholas A. Bellinger
On Fri, 2015-05-22 at 12:12 +0200, Bart Van Assche wrote: > On 05/22/15 08:11, Nicholas A. Bellinger wrote: > > diff --git a/include/target/target_core_base.h > > b/include/target/target_core_base.h > > index e2c0eaf..def5bc8 100644 > > --- a/include/target/target_co

Re: [PATCH-v2 0/9] target: se_node_acl + se_lun RCU conversions

2015-05-25 Thread Nicholas A. Bellinger
On Fri, 2015-05-22 at 12:15 +0200, Bart Van Assche wrote: On 05/22/15 08:11, Nicholas A. Bellinger wrote: Here is -v2 series for converting LIO target se_node_acl + se_lun mapping tables from fixed size arrays to dynamic RCU hlist_heads. The full list of new sparse warnings introduced

<    1   2   3   4   5   6   7   8   9   10   >