All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Hillf Danton <hdanton@sina.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Alex Elder <elder@linaro.org>,
	ohad@wizery.com, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] remoteproc: use freezable workqueue for crash notifications
Date: Mon, 31 May 2021 18:25:42 -0500	[thread overview]
Message-ID: <YLVwdsa97jYjKKU6@yoga> (raw)
In-Reply-To: <20210530030728.8340-1-hdanton@sina.com>

On Sat 29 May 22:07 CDT 2021, Hillf Danton wrote:

> On Sat, 29 May 2021 12:28:36 -0500 Bjorn Andersson wrote:
> >
> >Can you please explain why the mutex_lock() "requires" the context
> >executing it to be "unbound"? The lock is there to protect against
> >concurrent modifications of the state coming from e.g. sysfs.
> 
> There are simple and light events pending on the bound workqueue,
> 
> static void foo_event_fn(struct work_struct *w)
> {
> 	struct bar_struct *bar = container_of(w, struct bar_struct, work);
> 
> 	spin_lock_irq(&foo_lock);
> 	list_del(&bar->list);
> 	spin_unlock_irq(&foo_lock);
> 
> 	kfree(bar);
> 	return;
> or
> 	if (bar has waiter)
> 		wake_up();
> }
> 
> and they are not tough enough to tolerate a schedule() for which the unbound
> wq is allocated.

If you have work that is so latency sensitive that it can't handle other
work items sleeping momentarily, is it really a good idea to schedule
them on the system wide queues - or even schedule them at all?

That said, the proposed patch does not move the work from an unbound to
a bound queue, it simply moves it from one bound system queue to another
and further changes to this should be done in a separate patch - backed
by some measurements/data.

Thanks,
Bjorn

  parent reply	other threads:[~2021-05-31 23:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 23:44 [PATCH 0/1] remoteproc: avoid notification when suspended Alex Elder
2021-05-19 23:44 ` [PATCH 1/1] remoteproc: use freezable workqueue for crash notifications Alex Elder
2021-05-28  3:55   ` Bjorn Andersson
2021-05-28 15:09     ` Mathieu Poirier
2021-05-29  0:12     ` Siddharth Gupta
2021-06-04 20:46       ` Siddharth Gupta
     [not found]     ` <20210529024847.5164-1-hdanton@sina.com>
2021-05-29 17:28       ` Bjorn Andersson
     [not found]       ` <20210530030728.8340-1-hdanton@sina.com>
2021-05-31 23:25         ` Bjorn Andersson [this message]
2021-05-31 17:21     ` Mathieu Poirier
2021-05-31 23:13       ` Bjorn Andersson
2021-06-01 14:12       ` Alex Elder
2021-08-04 19:31 ` [PATCH 0/1] remoteproc: avoid notification when suspended patchwork-bot+linux-remoteproc

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=YLVwdsa97jYjKKU6@yoga \
    --to=bjorn.andersson@linaro.org \
    --cc=elder@linaro.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=ohad@wizery.com \
    /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.