Re: [PATCH 01/12] target: Convert se_node_acl->device_list[] to RCU hlist
From: Nicholas A. Bellinger
Date: Wed May 13 2015 - 01:09:00 EST
On Tue, 2015-05-12 at 13:58 -0700, Andy Grover wrote:
> On 05/12/2015 02:25 AM, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> >
> > 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.
> >
> > This includes changes to core_[enable,disable]_device_list_for_node()
> > rcu_assign_pointer() and invokes call_rcu() for releasing memory, along
> > with a number of RCU read path conversions in target_core_device.c code.
> >
> > Required for subsequent conversion of transport_lookup_cmd() to lock-less
> > RCU read path.
> >
> > Cc: Hannes Reinecke <hare@xxxxxxx>
> > Cc: Christoph Hellwig <hch@xxxxxx>
> > Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx>
> > Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
<SNIP>
> > diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
> > index 042a734..6fb38df 100644
> > --- a/include/target/target_core_base.h
> > +++ b/include/target/target_core_base.h
> > @@ -584,10 +584,12 @@ struct se_node_acl {
> > char acl_tag[MAX_ACL_TAG_SIZE];
> > /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */
> > atomic_t acl_pr_ref_count;
> > + struct hlist_head lun_entry_hlist;
> > struct se_dev_entry **device_list;
>
> Very nice to see all this posted!
>
> Patch 6 is where device_list is finally removed. Suggest squashing 1-6,
> maybe after review, I'm guessing they're not bisectable.
>
The series is bisectable. With patch #1 in place ->device_list[] is
still kzalloc()'ed, but new RCU pointer assignments are made into
lun_entry_hlist[].
Squashing the RCU reader paths (#2-6) for merge is OK, but it's still
nice to break up reader / updater changes into separate patches.
--nab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/