From patchwork Mon Dec 18 15:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 180525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1342348dyi; Mon, 18 Dec 2023 08:02:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4GLnONrZvalpsh8Xt4UGW3Ehlx6PJyNEdJOBphmdZbAUBjG8hhzEwbIoUksv3R5EEO0rC X-Received: by 2002:a05:6a20:6a03:b0:18b:1f82:7d74 with SMTP id p3-20020a056a206a0300b0018b1f827d74mr23009146pzk.2.1702915322180; Mon, 18 Dec 2023 08:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702915322; cv=none; d=google.com; s=arc-20160816; b=LQBI0kzUnk+A9wjC511rR5iiUjkSqUuBqycCxyBTjIkbDvSdGy5tQTrOHq3ukMFs7Y Xfb8RK/9yVT09h8H83ApqpK3LaMDpSedyilZ7Gfj/XUZTF7BmSiZunRTnJCW1iFB82Up TVI7HeENDYdH6I/28afmN7I+PqHEg++Ym+6SCekWB0I4q9b2G0le8t0p8ljPjfuF5wzj FbOsKh6P6C0mNXMJNNBM8Re/djQgV81uvNDBnCKZjnkjHt1KCSRKuo7vl+e26OZaS2P4 BHVaM3yWoTTW3w2emBqNTdiSBUIDbDmQq6JvhqDh0YkC+mrW+MkYq7i9iBC3j0SROQad Xlew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=AQ1RlV6Acfe2YPkTy/Cr+JCfIF5qXbTv3BiW+9J+M4o=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=fTdVm0W4lsXrjq9G3esIcrkHh7EQMQBZwkAeHr+SH/wHqtQPyGWNihydgqEuNVUSqo 49agts+6gNHnQ1kjaYtuo3TIJAqLLUV2D5wf8P1oKzENSxaJdl0Y38bQUDnA1D4R/y+N l5ej/RUNjhbVxwafY8LjeYaKueFkdXibFm/pgA19xPHX5M4S3PuG9FL9iWFwS9eGZ9up gyekP+bV1z5NxSH4YFmvGmn07/V10Z3a79iWlkBUBArsVCy9SbLhPvobuQtv+Qmljmec y5NKx2lR5oWkQMrBcvNd+OzCIK4XHU//rtA4xgCyfT3dzoTfL0NpkO2tR0lnmGjFFAT8 ZKhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3989-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3989-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z5-20020a636505000000b005c1b2fdfe6dsi3601125pgb.573.2023.12.18.08.02.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 08:02:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3989-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3989-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3989-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6E76DB243EE for ; Mon, 18 Dec 2023 15:54:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21F504239B; Mon, 18 Dec 2023 15:53:57 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E1393A1D4 for ; Mon, 18 Dec 2023 15:53:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 575EE1F445; Mon, 18 Dec 2023 15:53:51 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 4271D13BC8; Mon, 18 Dec 2023 15:53:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 6iebDg9rgGXCAQAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 15:53:51 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , James Smart , Hannes Reinecke , Daniel Wagner Subject: [PATCH v3 09/16] nvmet-fc: free queue and assoc directly Date: Mon, 18 Dec 2023 16:30:57 +0100 Message-ID: <20231218153105.12717-10-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 575EE1F445 X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785636136898766451 X-GMAIL-MSGID: 1785636136898766451 Neither struct nvmet_fc_tgt_queue nor struct nvmet_fc_tgt_assoc are data structure which are used in a RCU context. So there is no reason to delay the free operation. Signed-off-by: Daniel Wagner Reviewed-by: Hannes Reinecke --- drivers/nvme/target/fc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index db992df13c73..0adf65154e27 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -145,7 +145,6 @@ struct nvmet_fc_tgt_queue { struct list_head avail_defer_list; struct workqueue_struct *work_q; struct kref ref; - struct rcu_head rcu; /* array of fcp_iods */ struct nvmet_fc_fcp_iod fod[] __counted_by(sqsize); } __aligned(sizeof(unsigned long long)); @@ -170,7 +169,6 @@ struct nvmet_fc_tgt_assoc { struct nvmet_fc_tgt_queue __rcu *queues[NVMET_NR_QUEUES + 1]; struct kref ref; struct work_struct del_work; - struct rcu_head rcu; }; @@ -854,7 +852,7 @@ nvmet_fc_tgt_queue_free(struct kref *ref) destroy_workqueue(queue->work_q); - kfree_rcu(queue, rcu); + kfree(queue); } static void @@ -1187,8 +1185,8 @@ nvmet_fc_target_assoc_free(struct kref *ref) dev_info(tgtport->dev, "{%d:%d} Association freed\n", tgtport->fc_target_port.port_num, assoc->a_id); - kfree_rcu(assoc, rcu); nvmet_fc_tgtport_put(tgtport); + kfree(assoc); } static void