From: Tejun Heo <tj@kernel.org>
To: Allen <allen.lkml@gmail.com>
Cc: jiangshanlai@gmail.com, torvalds@linux-foundation.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
boqun.feng@gmail.com, tglx@linutronix.de, peterz@infradead.org,
romain.perier@gmail.com, mingo@kernel.org
Subject: Re: [PATCH 6/6] r8152: Convert from tasklet to BH workqueue
Date: Wed, 28 Feb 2024 07:49:40 -1000 [thread overview]
Message-ID: <Zd9yNByiBMcPxWbU@slm.duckdns.org> (raw)
In-Reply-To: <CAOMdWSLVDaN_XFD6Ov-=6VrH4wyBz-0wq_L3EzgdsJ5zJi47qQ@mail.gmail.com>
Hello,
On Wed, Feb 28, 2024 at 09:33:40AM -0800, Allen wrote:
> > @@ -6971,7 +6972,7 @@ static int rtl8152_open(struct net_device *netdev)
> > goto out_unlock;
> > }
> > napi_enable(&tp->napi);
> > - tasklet_enable(&tp->tx_tl);
> > + enable_work(&tp->tx_work);
>
> I think we are missing queue_work() above, right?
>
> To avoid such situations, could we combine enable_work() + queue_work(),
> into a single API?
Here, the device is newly being opened and the work item is just disabled
from the init. So, it doesn't need queueing.
> Perhaps, something like:
>
> static inline bool enable_and_queue_work(struct workqueue_struct *wq,
> struct work_struct *work)
> {
> if (enable_work(work))
> {
> queue_work(wq, work);
> return true;
> }
> return false;
> }
That said, this may still be nice to have.
Thanks.
--
tejun
next prev parent reply other threads:[~2024-02-28 17:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 17:28 [PATCHSET v3 wq/6.10] workqueue: Implement disable/enable_work() Tejun Heo
2024-02-27 17:28 ` [PATCH 1/6] workqueue: Preserve OFFQ bits in cancel[_sync] paths Tejun Heo
2024-02-27 17:28 ` [PATCH 2/6] workqueue: Implement disable/enable for (delayed) work items Tejun Heo
2024-02-27 17:28 ` [PATCH 3/6] workqueue: Remove WORK_OFFQ_CANCELING Tejun Heo
2024-02-27 17:28 ` [PATCH 4/6] workqueue: Remember whether a work item was on a BH workqueue Tejun Heo
2024-02-27 17:28 ` [PATCH 5/6] workqueue: Allow cancel_work_sync() and disable_work() from atomic contexts on BH work items Tejun Heo
2024-02-27 17:28 ` [PATCH 6/6] r8152: Convert from tasklet to BH workqueue Tejun Heo
2024-02-28 17:33 ` Allen
2024-02-28 17:49 ` Tejun Heo [this message]
2024-02-28 18:00 ` Allen
2024-02-28 18:01 ` Tejun Heo
2024-02-28 10:00 ` [PATCHSET v3 wq/6.10] workqueue: Implement disable/enable_work() Lai Jiangshan
2024-03-25 17:31 ` Tejun Heo
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=Zd9yNByiBMcPxWbU@slm.duckdns.org \
--to=tj@kernel.org \
--cc=allen.lkml@gmail.com \
--cc=boqun.feng@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=romain.perier@gmail.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®