From: Daniel Wagner <dwagner@suse.de>
To: linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>,
James Smart <james.smart@broadcom.com>,
Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de>
Subject: [PATCH v3 09/16] nvmet-fc: free queue and assoc directly
Date: Mon, 18 Dec 2023 16:30:57 +0100 [thread overview]
Message-ID: <20231218153105.12717-10-dwagner@suse.de> (raw)
In-Reply-To: <20231218153105.12717-1-dwagner@suse.de>
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 <dwagner@suse.de>
---
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
--
2.43.0
next prev parent reply other threads:[~2023-12-18 15:53 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 15:30 [PATCH v3 00/17] enable nvmet-fc for blktests Daniel Wagner
2023-12-18 15:30 ` [PATCH v3 01/16] nvmet: report ioccsz and iorcsz for disc ctrl Daniel Wagner
2023-12-19 4:27 ` Christoph Hellwig
2023-12-20 0:50 ` Max Gurtovoy
2023-12-19 7:24 ` Hannes Reinecke
2023-12-19 15:15 ` Daniel Wagner
2023-12-18 15:30 ` [PATCH v3 02/16] nvmet-fc: remove unnecessary bracket Daniel Wagner
2023-12-19 4:27 ` Christoph Hellwig
2023-12-19 7:25 ` Hannes Reinecke
2023-12-18 15:30 ` [PATCH v3 03/16] nvmet-trace: avoid dereferencing pointer too early Daniel Wagner
2023-12-19 4:29 ` Christoph Hellwig
2023-12-18 15:30 ` [PATCH v3 04/16] nvmet-trace: null terminate device name string correctly Daniel Wagner
2023-12-19 4:29 ` Christoph Hellwig
2023-12-18 15:30 ` [PATCH v3 05/16] nvmet-fcloop: Remove remote port from list when unlinking Daniel Wagner
2023-12-19 4:31 ` Christoph Hellwig
2023-12-19 7:26 ` Hannes Reinecke
2023-12-18 15:30 ` [PATCH v3 06/16] nvme-fc: Do not wait in vain when unloading module Daniel Wagner
2023-12-19 4:35 ` Christoph Hellwig
2024-01-05 5:05 ` Keith Busch
2023-12-19 7:28 ` Hannes Reinecke
2023-12-18 15:30 ` [PATCH v3 07/16] nvmet-fc: Release reference on target port Daniel Wagner
2023-12-19 4:36 ` Christoph Hellwig
2023-12-19 7:28 ` Hannes Reinecke
2023-12-18 15:30 ` [PATCH v3 08/16] nvmet-fc: untangle cross refcounting objects Daniel Wagner
2023-12-19 5:16 ` Christoph Hellwig
2023-12-21 9:15 ` Daniel Wagner
2024-01-26 15:32 ` Daniel Wagner
2023-12-19 7:59 ` Hannes Reinecke
2023-12-18 15:30 ` Daniel Wagner [this message]
2023-12-19 7:59 ` [PATCH v3 09/16] nvmet-fc: free queue and assoc directly Hannes Reinecke
2023-12-18 15:30 ` [PATCH v3 10/16] nvmet-fc: hold reference on hostport match Daniel Wagner
2023-12-19 8:00 ` Hannes Reinecke
2023-12-18 15:30 ` [PATCH v3 11/16] nvmet-fc: remove null hostport pointer check Daniel Wagner
2023-12-19 11:37 ` Hannes Reinecke
2023-12-18 15:31 ` [PATCH v3 12/16] nvmet-fc: do not tack refs on tgtports from assoc Daniel Wagner
2023-12-19 11:38 ` Hannes Reinecke
2023-12-18 15:31 ` [PATCH v3 13/16] nvmet-fc: abort command if when there is binding Daniel Wagner
2023-12-19 11:39 ` Hannes Reinecke
2023-12-18 15:31 ` [PATCH v3 14/16] nvmet-fc: free hostport after release reference to tgtport Daniel Wagner
2023-12-19 11:41 ` Hannes Reinecke
2023-12-18 15:31 ` [PATCH v3 15/16] nvmet-fc: avoid deadlock on delete association path Daniel Wagner
2023-12-19 6:00 ` kernel test robot
2023-12-19 8:29 ` kernel test robot
2023-12-19 11:17 ` kernel test robot
2023-12-19 11:43 ` Hannes Reinecke
2023-12-18 15:31 ` [PATCH v3 16/16] nvmet-fc: take ref count on tgtport before delete assoc Daniel Wagner
2023-12-19 11:47 ` Hannes Reinecke
2023-12-18 15:31 ` [PATCH v3 17/17] nvmet-fc: add extensive debug logging Daniel Wagner
2023-12-19 11:54 ` Hannes Reinecke
2023-12-19 14:06 ` Daniel Wagner
2023-12-18 16:10 ` [PATCH v3 00/17] enable nvmet-fc for blktests Maurizio Lombardi
2024-01-02 21:36 ` Keith Busch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231218153105.12717-10-dwagner@suse.de \
--to=dwagner@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox