linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Allen <allen.lkml@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	jes@trained-monkey.org, kda@linux-powerpc.org,
	cai.huoqing@linux.dev, dougmill@linux.ibm.com, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, aneesh.kumar@kernel.org,
	naveen.n.rao@linux.ibm.com, nnac123@linux.ibm.com,
	tlfalcon@linux.ibm.com, cooldavid@cooldavid.org,
	marcin.s.wojtas@gmail.com, mlindner@marvell.com,
	stephen@networkplumber.org, nbd@nbd.name, sean.wang@mediatek.com,
	Mark-MC.Lee@mediatek.com, lorenzo@kernel.org,
	matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
	borisp@nvidia.com, bryan.whitehead@microchip.com,
	UNGLinuxDriver@microchip.com, louis.peens@corigine.com,
	richardcochran@gmail.com, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-acenic@sunsite.dk,
	linux-net-drivers@amd.com, netdev@vger.kernel.org,
	Sunil Goutham <sgoutham@marvell.com>
Subject: Re: [net-next v3 05/15] net: cavium/liquidio: Convert tasklet API to new bottom half workqueue mechanism
Date: Mon, 5 Aug 2024 12:39:46 -0700	[thread overview]
Message-ID: <20240805123946.015b383f@kernel.org> (raw)
In-Reply-To: <CAOMdWSKRFXFdi4SF20LH528KcXtxD+OL=HzSh9Gzqy9HCqkUGw@mail.gmail.com>

On Mon, 5 Aug 2024 10:23:41 -0700 Allen wrote:
> Sure, please review the explanation below and let me
> know if it is clear enough:
> 
> tasklet_enable() is used to enable a tasklet, which defers
> work to be executed in an interrupt context. It relies on the
> tasklet mechanism for deferred execution.
> 
> enable_and_queue_work() combines enabling the work with
> scheduling it on a workqueue. This approach not only enables
> the work but also schedules it for execution by the workqueue
> system, which is more flexible and suitable for tasks needing
> process context rather than interrupt context.
> 
> enable_and_queue_work() internally calls enable_work() to enable
> the work item and then uses queue_work() to add it to the workqueue.
> This ensures that the work item is both enabled and explicitly
> scheduled for execution within the workqueue system's context.
> 
> As mentioned, "unconditionally scheduling the work item after
> enable_work() returns true should work for most users." This
> ensures that the work is consistently scheduled for execution,
> aligning with the typical workqueue usage pattern. Most users
> expect that enabling a work item implies it will be scheduled for
> execution without additional conditional logic.

This looks good for the explanation of the APIs, but you need to 
add another paragraph explaining why the conversion is correct
for the given user. Basically whether the callback is safe to 
be called even if there's no work. 

  reply	other threads:[~2024-08-05 19:39 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 18:33 [net-next v3 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
2024-07-30 18:33 ` [net-next v3 01/15] net: alteon: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
2024-07-30 18:33 ` [net-next v3 02/15] net: xgbe: " Allen Pais
2024-07-30 18:33 ` [net-next v3 03/15] net: cnic: " Allen Pais
2024-07-30 18:33 ` [net-next v3 04/15] net: macb: " Allen Pais
2024-07-30 18:33 ` [net-next v3 05/15] net: cavium/liquidio: " Allen Pais
2024-08-01  2:08   ` Jakub Kicinski
2024-08-01 22:00     ` Allen
2024-08-02  0:57       ` Jakub Kicinski
2024-08-05 17:23         ` Allen
2024-08-05 19:39           ` Jakub Kicinski [this message]
2024-08-07  3:15             ` Allen
2024-08-07 14:37               ` Jakub Kicinski
2024-08-09  2:31                 ` Allen
2024-08-10  3:36                   ` Jakub Kicinski
2024-08-15 16:45                     ` Allen
2024-08-15 23:49                       ` Jakub Kicinski
2024-08-17 16:27                         ` Allen
2024-07-30 18:33 ` [net-next v3 06/15] net: octeon: " Allen Pais
2024-07-30 18:33 ` [net-next v3 07/15] net: thunderx: " Allen Pais
2024-07-30 18:33 ` [net-next v3 08/15] net: chelsio: " Allen Pais
2024-07-30 18:33 ` [net-next v3 09/15] net: sundance: " Allen Pais
2024-07-30 18:33 ` [net-next v3 10/15] net: hinic: " Allen Pais
2024-07-30 18:33 ` [net-next v3 11/15] net: ehea: " Allen Pais
2024-07-30 18:34 ` [net-next v3 12/15] net: ibmvnic: " Allen Pais
2024-07-30 18:34 ` [net-next v3 13/15] net: jme: " Allen Pais
2024-07-30 18:34 ` [net-next v3 14/15] net: marvell: " Allen Pais
2024-07-30 20:39   ` Andrew Lunn
2024-07-30 22:22     ` Russell King (Oracle)
2024-07-31 20:46       ` Allen
2024-07-31 20:41     ` Allen
2024-07-30 18:34 ` [net-next v3 15/15] net: mtk-wed: " Allen Pais

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=20240805123946.015b383f@kernel.org \
    --to=kuba@kernel.org \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=allen.lkml@gmail.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=borisp@nvidia.com \
    --cc=bryan.whitehead@microchip.com \
    --cc=cai.huoqing@linux.dev \
    --cc=christophe.leroy@csgroup.eu \
    --cc=cooldavid@cooldavid.org \
    --cc=davem@davemloft.net \
    --cc=dougmill@linux.ibm.com \
    --cc=edumazet@google.com \
    --cc=jes@trained-monkey.org \
    --cc=kda@linux-powerpc.org \
    --cc=linux-acenic@sunsite.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=louis.peens@corigine.com \
    --cc=marcin.s.wojtas@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mlindner@marvell.com \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=nnac123@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sean.wang@mediatek.com \
    --cc=sgoutham@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=tlfalcon@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).