From: Allen <allen.lkml@gmail.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: imx@lists.linux.dev, ulf.hansson@linaro.org, oneukum@suse.com,
duncan.sands@free.fr, hayashi.kunihiko@socionext.com,
linux-mmc@vger.kernel.org, aubin.constans@microchip.com,
linus.walleij@linaro.org, Frank.Li@nxp.com,
linux-hyperv@vger.kernel.org, linux-mips@vger.kernel.org,
paul@crapouillou.net, linux-tegra@vger.kernel.org,
netdev@vger.kernel.org, maintainers@bluecherrydvr.com,
peter.ujfalusi@gmail.com, manivannan.sadhasivam@linaro.org,
linux-riscv@lists.infradead.org, kys@microsoft.com,
robert.jarzmik@free.fr, haijie1@huawei.com,
linux-renesas-soc@vger.kernel.org, wei.liu@kernel.org,
linux-omap@vger.kernel.org, florian.fainelli@broadcom.com,
linux-rdma@vger.kernel.org, vireshk@kernel.org,
jassisinghbrar@gmail.com, decui@microsoft.com,
HaraldWelte@viatech.com, jernej.skrabec@gmail.com,
jh80.chung@samsung.com, zw@zh-kernel.org, wens@csie.org,
stern@rowland.harvard.edu, linux-arm-msm@vger.kernel.org,
orsonzhai@gmail.com, pierre@ossman.eu, linux-usb@vger.kernel.org,
Eugeniy.Paltsev @synopsys.com, patrice.chotard@foss.st.com,
asahi@lists.linux.dev, brucechang@via.com.tw,
keescook@chromium.org, oakad@yahoo.com, sven@svenpeter.dev,
rjui@broadcom.com, s.hauer@pengutronix.de,
sean.wang@mediatek.com, linux-actions@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, haojian.zhuang@gmail.com,
mirq-linux@rere.qmqm.pl, dmaengine@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-rpi-kernel@lists.infradead.org,
baolin.wang@linux.alibaba.com, matthias.bgg@gmail.com,
openipmi-developer@lists.sourceforge.net, mchehab@kernel.org,
Allen Pais <apais@linux.microsoft.com>,
linux-arm-kernel@lists.infradead.org,
angelogioacchino.delregno@collabora.com, sbranden@broadcom.com,
logang@deltatee.com, andersson@kernel.org, marcan@marcan.st,
haiyangz@microsoft.com, linux-kernel@vger.kernel.org,
leoyang.li@nxp.com, konrad.dybcio@linaro.org,
linux-sunxi@lists.linux.dev, wangzhou1@hisilicon.com,
linux-s390@vger.kernel.org, mhiramat@kernel.org,
zhang.lyra@gmail.com, tj@kernel.org, ma nuel.lauss@gmail.com,
linux-media@vger.kernel.org, shawnguo@kernel.org,
afaerber@suse.de, daniel@zonque.org
Subject: Re: [PATCH 2/9] dma: Convert from tasklet to BH workqueue
Date: Thu, 28 Mar 2024 10:49:51 -0700 [thread overview]
Message-ID: <CAOMdWSJxDAFKLVbH7wrB16m2nNXHm0b45dCRhvitVCP1Wf1aEg@mail.gmail.com> (raw)
In-Reply-To: <ZgUGXTKPVhrA1tam@matsya>
>
> Subsytem is dmaengine, can you rename this to dmaengine: ...
My apologies, will have it fixed in v2.
>
> On 27-03-24, 16:03, Allen Pais wrote:
> > The only generic interface to execute asynchronously in the BH context is
> > tasklet; however, it's marked deprecated and has some design flaws. To
> > replace tasklets, BH workqueue support was recently added. A BH workqueue
> > behaves similarly to regular workqueues except that the queued work items
> > are executed in the BH context.
>
> Thanks for conversion, am happy with BH alternative as it helps in
> dmaengine where we need shortest possible time between tasklet and
> interrupt handling to maximize dma performance
>
> >
> > This patch converts drivers/dma/* from tasklet to BH workqueue.
>
> >
> > Based on the work done by Tejun Heo <tj@kernel.org>
> > Branch: git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
> >
> > Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> > ---
> > drivers/dma/altera-msgdma.c | 15 ++++----
> > drivers/dma/apple-admac.c | 15 ++++----
> > drivers/dma/at_hdmac.c | 2 +-
> > drivers/dma/at_xdmac.c | 15 ++++----
> > drivers/dma/bcm2835-dma.c | 2 +-
> > drivers/dma/dma-axi-dmac.c | 2 +-
> > drivers/dma/dma-jz4780.c | 2 +-
> > .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +-
> > drivers/dma/dw-edma/dw-edma-core.c | 2 +-
> > drivers/dma/dw/core.c | 13 +++----
> > drivers/dma/dw/regs.h | 3 +-
> > drivers/dma/ep93xx_dma.c | 15 ++++----
> > drivers/dma/fsl-edma-common.c | 2 +-
> > drivers/dma/fsl-qdma.c | 2 +-
> > drivers/dma/fsl_raid.c | 11 +++---
> > drivers/dma/fsl_raid.h | 2 +-
> > drivers/dma/fsldma.c | 15 ++++----
> > drivers/dma/fsldma.h | 3 +-
> > drivers/dma/hisi_dma.c | 2 +-
> > drivers/dma/hsu/hsu.c | 2 +-
> > drivers/dma/idma64.c | 4 +--
> > drivers/dma/img-mdc-dma.c | 2 +-
> > drivers/dma/imx-dma.c | 27 +++++++-------
> > drivers/dma/imx-sdma.c | 6 ++--
> > drivers/dma/ioat/dma.c | 17 ++++-----
> > drivers/dma/ioat/dma.h | 5 +--
> > drivers/dma/ioat/init.c | 2 +-
> > drivers/dma/k3dma.c | 19 +++++-----
> > drivers/dma/mediatek/mtk-cqdma.c | 35 ++++++++++---------
> > drivers/dma/mediatek/mtk-hsdma.c | 2 +-
> > drivers/dma/mediatek/mtk-uart-apdma.c | 4 +--
> > drivers/dma/mmp_pdma.c | 13 +++----
> > drivers/dma/mmp_tdma.c | 11 +++---
> > drivers/dma/mpc512x_dma.c | 17 ++++-----
> > drivers/dma/mv_xor.c | 13 +++----
> > drivers/dma/mv_xor.h | 5 +--
> > drivers/dma/mv_xor_v2.c | 23 ++++++------
> > drivers/dma/mxs-dma.c | 13 +++----
> > drivers/dma/nbpfaxi.c | 15 ++++----
> > drivers/dma/owl-dma.c | 2 +-
> > drivers/dma/pch_dma.c | 17 ++++-----
> > drivers/dma/pl330.c | 31 ++++++++--------
> > drivers/dma/plx_dma.c | 13 +++----
> > drivers/dma/ppc4xx/adma.c | 17 ++++-----
> > drivers/dma/ppc4xx/adma.h | 5 +--
> > drivers/dma/pxa_dma.c | 2 +-
> > drivers/dma/qcom/bam_dma.c | 35 ++++++++++---------
> > drivers/dma/qcom/gpi.c | 18 +++++-----
> > drivers/dma/qcom/hidma.c | 11 +++---
> > drivers/dma/qcom/hidma.h | 5 +--
> > drivers/dma/qcom/hidma_ll.c | 11 +++---
> > drivers/dma/qcom/qcom_adm.c | 2 +-
> > drivers/dma/sa11x0-dma.c | 27 +++++++-------
> > drivers/dma/sf-pdma/sf-pdma.c | 23 ++++++------
> > drivers/dma/sf-pdma/sf-pdma.h | 5 +--
> > drivers/dma/sprd-dma.c | 2 +-
> > drivers/dma/st_fdma.c | 2 +-
> > drivers/dma/ste_dma40.c | 17 ++++-----
> > drivers/dma/sun6i-dma.c | 33 ++++++++---------
> > drivers/dma/tegra186-gpc-dma.c | 2 +-
> > drivers/dma/tegra20-apb-dma.c | 19 +++++-----
> > drivers/dma/tegra210-adma.c | 2 +-
> > drivers/dma/ti/edma.c | 2 +-
> > drivers/dma/ti/k3-udma.c | 11 +++---
> > drivers/dma/ti/omap-dma.c | 2 +-
> > drivers/dma/timb_dma.c | 23 ++++++------
> > drivers/dma/txx9dmac.c | 29 +++++++--------
> > drivers/dma/txx9dmac.h | 5 +--
> > drivers/dma/virt-dma.c | 9 ++---
> > drivers/dma/virt-dma.h | 9 ++---
> > drivers/dma/xgene-dma.c | 21 +++++------
> > drivers/dma/xilinx/xilinx_dma.c | 23 ++++++------
> > drivers/dma/xilinx/xilinx_dpdma.c | 21 +++++------
> > drivers/dma/xilinx/zynqmp_dma.c | 21 +++++------
> > 74 files changed, 442 insertions(+), 395 deletions(-)
> >
> > diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c
> > index a8e3615235b8..611b5290324b 100644
> > --- a/drivers/dma/altera-msgdma.c
> > +++ b/drivers/dma/altera-msgdma.c
> > @@ -20,6 +20,7 @@
> > #include <linux/platform_device.h>
> > #include <linux/slab.h>
> > #include <linux/of_dma.h>
> > +#include <linux/workqueue.h>
> >
> > #include "dmaengine.h"
> >
> > @@ -170,7 +171,7 @@ struct msgdma_sw_desc {
> > struct msgdma_device {
> > spinlock_t lock;
> > struct device *dev;
> > - struct tasklet_struct irq_tasklet;
> > + struct work_struct irq_work;
>
> Can we name these as bh_work to signify that we are always in bh
> context? here and everywhere please
Sure, will address it in v2.
>
>
> > struct list_head pending_list;
> > struct list_head free_list;
> > struct list_head active_list;
> > @@ -676,12 +677,12 @@ static int msgdma_alloc_chan_resources(struct dma_chan *dchan)
> > }
> >
> > /**
> > - * msgdma_tasklet - Schedule completion tasklet
> > + * msgdma_work - Schedule completion work
>
> ..
>
> > @@ -515,7 +516,7 @@ struct gpii {
> > enum gpi_pm_state pm_state;
> > rwlock_t pm_lock;
> > struct gpi_ring ev_ring;
> > - struct tasklet_struct ev_task; /* event processing tasklet */
> > + struct work_struct ev_task; /* event processing work */
> > struct completion cmd_completion;
> > enum gpi_cmd gpi_cmd;
> > u32 cntxt_type_irq_msk;
> > @@ -755,7 +756,7 @@ static void gpi_process_ieob(struct gpii *gpii)
> > gpi_write_reg(gpii, gpii->ieob_clr_reg, BIT(0));
> >
> > gpi_config_interrupts(gpii, MASK_IEOB_SETTINGS, 0);
> > - tasklet_hi_schedule(&gpii->ev_task);
> > + queue_work(system_bh_highpri_wq, &gpii->ev_task);
>
> This is good conversion, thanks for ensuring system_bh_highpri_wq is
> used here
Thank you very much for the review, will have v2 sent soon.
- Allen
> --
> ~Vinod
>
next prev parent reply other threads:[~2024-03-28 21:59 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 16:03 [PATCH 0/9] Convert Tasklets to BH Workqueues Allen Pais
2024-03-27 16:03 ` [PATCH 1/9] hyperv: Convert from tasklet to BH workqueue Allen Pais
2024-04-03 16:43 ` Allen
2024-03-27 16:03 ` [PATCH 2/9] dma: " Allen Pais
2024-03-28 5:55 ` Vinod Koul
2024-03-28 10:08 ` Arnd Bergmann
2024-03-28 18:31 ` Vinod Koul
2024-03-28 19:39 ` Allen
2024-03-28 19:49 ` Arnd Bergmann
2024-03-28 20:01 ` Allen
2024-03-29 16:38 ` Vinod Koul
2024-03-29 16:39 ` Vinod Koul
2024-03-28 17:49 ` Allen [this message]
2024-04-02 12:25 ` Linus Walleij
2024-04-02 13:11 ` Vinod Koul
2024-03-27 16:03 ` [PATCH 3/9] IB: " Allen Pais
2024-03-27 16:03 ` [PATCH 4/9] USB: " Allen Pais
2024-03-27 16:20 ` Duncan Sands
2024-03-27 16:55 ` Greg KH
2024-03-27 16:58 ` Allen
2024-03-27 17:55 ` Alan Stern
2024-03-28 17:54 ` Allen
2024-03-27 16:03 ` [PATCH 5/9] mailbox: " Allen Pais
2024-03-27 16:03 ` [PATCH 6/9] ipmi: " Allen Pais
2024-03-27 17:58 ` Corey Minyard
2024-03-28 17:52 ` Allen
2024-03-28 19:23 ` Corey Minyard
2024-03-28 19:41 ` Allen
2024-03-28 19:52 ` Corey Minyard
2024-03-28 19:58 ` Allen
2024-03-27 16:03 ` [PATCH 7/9] s390: " Allen Pais
2024-04-02 12:48 ` Alexandra Winter
2024-04-03 13:33 ` Allen
2024-03-27 16:03 ` [PATCH 8/9] drivers/media/*: " Allen Pais
2024-03-27 16:03 ` [PATCH 9/9] mmc: " Allen Pais
2024-03-27 19:35 ` Jernej Škrabec
2024-03-28 10:16 ` Christian Loehle
2024-03-28 17:47 ` Allen
2024-03-28 12:53 ` Ulf Hansson
2024-03-28 13:37 ` Linus Walleij
2024-03-28 16:21 ` Tejun Heo
2024-04-02 10:15 ` Ulf Hansson
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=CAOMdWSJxDAFKLVbH7wrB16m2nNXHm0b45dCRhvitVCP1Wf1aEg@mail.gmail.com \
--to=allen.lkml@gmail.com \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=Frank.Li@nxp.com \
--cc=HaraldWelte@viatech.com \
--cc=andersson@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=apais@linux.microsoft.com \
--cc=asahi@lists.linux.dev \
--cc=aubin.constans@microchip.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=brucechang@via.com.tw \
--cc=decui@microsoft.com \
--cc=dmaengine@vger.kernel.org \
--cc=duncan.sands@free.fr \
--cc=florian.fainelli@broadcom.com \
--cc=haijie1@huawei.com \
--cc=haiyangz@microsoft.com \
--cc=haojian.zhuang@gmail.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=imx@lists.linux.dev \
--cc=jassisinghbrar@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=keescook@chromium.org \
--cc=konrad.dybcio@linaro.org \
--cc=kys@microsoft.com \
--cc=leoyang.li@nxp.com \
--cc=linus.walleij@linaro.org \
--cc=linux-actions@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=logang@deltatee.com \
--cc=maintainers@bluecherrydvr.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=marcan@marcan.st \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=mhiramat@kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.org \
--cc=oakad@yahoo.com \
--cc=oneukum@suse.com \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=orsonzhai@gmail.com \
--cc=patrice.chotard@foss.st.com \
--cc=paul@crapouillou.net \
--cc=peter.ujfalusi@gmail.com \
--cc=pierre@ossman.eu \
--cc=rjui@broadcom.com \
--cc=robert.jarzmik@free.fr \
--cc=s.hauer@pengutronix.de \
--cc=sbranden@broadcom.com \
--cc=sean.wang@mediatek.com \
--cc=stern@rowland.harvard.edu \
--cc=sven@svenpeter.dev \
--cc=tj@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vireshk@kernel.org \
--cc=vkoul@kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=wei.liu@kernel.org \
--cc=wens@csie.org \
--cc=zhang.lyra@gmail.com \
--cc=zw@zh-kernel.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;
as well as URLs for NNTP newsgroup(s).