All of lore.kernel.org
 help / color / mirror / Atom feed
From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH 2/4] nvmet: ANA transition timeout handling
Date: Thu, 7 Jun 2018 16:12:25 +0300	[thread overview]
Message-ID: <fce82565-1975-2170-6257-a88729cd4419@grimberg.me> (raw)
In-Reply-To: <20180607073556.39050-3-hare@suse.de>


> +	INIT_DELAYED_WORK(&ev->work, nvmet_ana_state_change_work);
> +	ev->port = port;
> +	ev->grpid = grpid;
> +	ev->state = state;
> +	mutex_lock(&port->anatt_list_lock);
> +	list_add_tail(&ev->entry, &port->anatt_list);
> +	mutex_unlock(&port->anatt_list_lock);
> +	/*
> +	 * Reduce the delay by 1 sec to not accidentally trigger an
> +	 * ANA transition timeout failure on the host.
> +	 */
> +	queue_delayed_work(nvmet_ana_wq, &ev->work,
> +			   (port->anatt - 1) * HZ);

hmm, what is that giving us?

> +}
> +
>   int nvmet_register_transport(const struct nvmet_fabrics_ops *ops)
>   {
>   	int ret = 0;
> @@ -276,11 +336,22 @@ int nvmet_enable_port(struct nvmet_port *port)
>   void nvmet_disable_port(struct nvmet_port *port)
>   {
>   	const struct nvmet_fabrics_ops *ops;
> +	struct nvmet_ana_change_event *ev, *tmp;
>   
>   	lockdep_assert_held(&nvmet_config_sem);
>   
>   	port->enabled = false;
>   
> +	mutex_lock(&port->anatt_list_lock);
> +	list_for_each_entry_safe(ev, tmp, &port->anatt_list, entry) {
> +		if (ev->port == port) {
> +			list_del_init(&ev->entry);
> +			cancel_delayed_work_sync(&ev->work);
> +			kfree(ev);

I'd splice to a local list and cancel+free outside the mutex.

> +		}
> +	}
> +	mutex_unlock(&port->anatt_list_lock);
> +
>   	ops = nvmet_transports[port->disc_addr.trtype];
>   	ops->remove_port(port);
>   	module_put(ops->owner);
> @@ -1162,6 +1233,11 @@ static int __init nvmet_init(void)
>   {
>   	int error;
>   
> +	nvmet_ana_wq = alloc_workqueue("nvmet_ana_wq",
> +			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
> +	if (!nvmet_ana_wq)
> +		return -ENOMEM;
> +

Why a dedicated workqueue? and why a mem reclaim one?

whats wrong with system_wq/system_unbound_wq/system_long_wq?

  parent reply	other threads:[~2018-06-07 13:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07  7:35 [PATCH 0/4] nvme: ANATT handling Hannes Reinecke
2018-06-07  7:35 ` [PATCH 1/4] nvmet: make ANATT configurable Hannes Reinecke
2018-06-07 12:06   ` Christoph Hellwig
2018-06-07 12:42     ` Hannes Reinecke
2018-06-07 13:03   ` Sagi Grimberg
2018-06-07  7:35 ` [PATCH 2/4] nvmet: ANA transition timeout handling Hannes Reinecke
2018-06-07 12:07   ` Christoph Hellwig
2018-06-07 13:31     ` Hannes Reinecke
2018-06-07 13:41       ` Christoph Hellwig
2018-06-07 13:12   ` Sagi Grimberg [this message]
2018-06-07  7:35 ` [PATCH 3/4] nvme: " Hannes Reinecke
2018-06-07 12:09   ` Christoph Hellwig
2018-06-07 12:52     ` Hannes Reinecke
2018-06-07 13:11       ` Christoph Hellwig
2018-06-07 13:16   ` Sagi Grimberg
2018-06-07 13:26     ` Christoph Hellwig
2018-06-07  7:35 ` [PATCH 4/4] nvme: start ANATT timer on out-of-order state changes Hannes Reinecke
2018-06-07 12:11   ` Christoph Hellwig
2018-06-07 12:37     ` Hannes Reinecke
2018-06-07 13:10       ` Christoph Hellwig
2018-06-07 13:20         ` Hannes Reinecke
2018-06-07 13:46           ` Christoph Hellwig
2018-06-07 14:01             ` Hannes Reinecke
2018-06-07 14:22               ` Christoph Hellwig
2018-06-07 15:20                 ` Sagi Grimberg
2018-06-07 13:20   ` Sagi Grimberg

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=fce82565-1975-2170-6257-a88729cd4419@grimberg.me \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.