Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756676AbbEVIsX (ORCPT ); Fri, 22 May 2015 04:48:23 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:54198 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756229AbbEVIsU (ORCPT ); Fri, 22 May 2015 04:48:20 -0400 Message-ID: <1432284498.898.16.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH-v2 5/9] target: Convert se_portal_group->tpg_lun_list[] to RCU hlist From: "Nicholas A. Bellinger" To: Christoph Hellwig Cc: "Nicholas A. Bellinger" , target-devel , linux-scsi , linux-kernel , Hannes Reinecke , Sagi Grimberg , "Paul E. McKenney" , Chris Boot Date: Fri, 22 May 2015 01:48:18 -0700 In-Reply-To: <20150522083113.GC24640@lst.de> References: <1432275071-28882-1-git-send-email-nab@daterainc.com> <1432275071-28882-6-git-send-email-nab@daterainc.com> <20150522083113.GC24640@lst.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1603 Lines: 40 On Fri, 2015-05-22 at 10:31 +0200, Christoph Hellwig wrote: > > 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 directly from target_fabric_make_lun() to allocate > > a new se_lun. > > > > Also add a new target_fabric_port_release() configfs item callback > > to invoke kfree_rcu() to release memory during se_lun->lun_group > > shutdown. > > > > Also now that se_node_acl->lun_entry_hlist is using RCU, convert > > existing tpg_lun_lock to struct mutex so core_tpg_add_node_to_devs() > > can perform RCU updater logic without releasing ->tpg_lun_mutex. > > Still doesn't explain why core_tpg_clear_object_luns also disappears. It's duplicate logic in iscsi-target to delete active TPG LUNs. Adding a comment to clarify the removal. > > > + hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) { > > if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) > > continue; > > lun_status will always be active here as that's set and cleared at the > same time as the list addition / removal. Which means that lun_status > should go away in this patch. > Yes, thanks for the reminder. Dropping lun_status now. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/