Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp636438lqh; Thu, 28 Mar 2024 11:32:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKY2M75ixM5nqjt3SKE8N/3/tnZYvxUkRDJEmL84tleU6AXj4t/jbvxEUDyxFGrO/b+FUKY/4hv7g5fpyO7jaeJSBJ2yi9JO6jn5ZaWg== X-Google-Smtp-Source: AGHT+IGJQFUqdf8Hi7ytfTas8cOWUrLPE7/BeG8+VW7q5NPY/W/90gxg8ZsrTr7lxMX4EoeVGxnt X-Received: by 2002:a05:6a20:7294:b0:1a5:6d7f:f1e9 with SMTP id o20-20020a056a20729400b001a56d7ff1e9mr267813pzk.27.1711650737222; Thu, 28 Mar 2024 11:32:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711650737; cv=pass; d=google.com; s=arc-20160816; b=ncZ5TyYHGAzjlEZ8/XJ12rzuEjlvLdnj56btc+j3XXYzgddjYfvIMEsPf1bADtcR/O H/yUWTHLF6S4Pz4iQTe/Aa9JsEc3tt5YD0LCJ6USN+KIxynEqg4NJT5oOGCA8EGSzyvr 2jRLT2qY9iI83NnJ0wTvuxyppxr+/n0QBu0WeIIb0W7kQmofGDkEk6bMQCpDt+8efamG MI9+IdM1l41NQsIDw2CJYz3pnE3aSwbCd2cC/PIxksIAw4vEifTfpkv52LegAHHCO2uE rGG1phsNRDLFcfwsSCQY94+isMj+aXPz+vI3H1ZlZIQ1MWcJDk42NZvkVbMATypHam5k 3Y3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3CoqXNTRcmwlCY/xhGyAVojJiT/UcLdDcoASRjE/JUY=; fh=+NqEQ/TpZobwcRh3UGFZNCl5VTi6H8UfesW2+lbohRo=; b=YQvELVG/xrOJ94eDI1ht1RjnjLp1huS5P2s+zAIAlMz9fMUiHptx7+gvMtcP3QqQLf jRPu0ekRVBx+9C3cHA+oQYrt18iU/WBk5xOPZTJOUlC0ZGkDWynFDk8OHtC2VOrYLHk4 QvH9n1k8Bcqfo1mNmiLiBIv6vj8uRNy3qCdPhgNvf8pYkEK7P5VYYqzBGiURy547F+hl 1gIxs/3d4H6PGEhvs85+T9RiyuotvgeUk2qDb5uu21tSWsFSSXR9alYERyQ0A/qfJd4q 6wuOMQw/LDfvoEjbC9AxB7f1MdLar/SA0rzIExGo5BoXRdB2/2frw3UtHZm1seGYhPDP A/TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QQ+Ol01e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t127-20020a628185000000b006e76a8d2cbesi1929032pfd.320.2024.03.28.11.32.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 11:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QQ+Ol01e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BEDC928EC6D for ; Thu, 28 Mar 2024 18:32:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC874137903; Thu, 28 Mar 2024 18:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QQ+Ol01e" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98A3C1327F8; Thu, 28 Mar 2024 18:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711650709; cv=none; b=SMfPpC/Ltxe6Y8bC5SBajqJZrUZLWeDjd2q2tPn0YmZY9VqROns4nCSEjN28OGtBPUoFVC6vNDa/1JN0QcGmhBt6aACp2g2UpXJYEOUrvYNlyQdao53zf+y/wfrcMLfoc7GQcKGxMhctD+J7/mfxBTufds1UkseUkYlu5fDxnxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711650709; c=relaxed/simple; bh=09Kq07Ctu1YK6YAopY47/y5AlbJwjHjNBMXfeYxKY3s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mc+bmHU7JCh9T2qz/jKyKISblvHUMRyjYOEKwefhMp+SpBo+KEZunCDaUOfyxVqaH2nRtbEFzsaXfY7St2PHPArtNQ18jv3kbP8sMNYjt2B8WRyDhc54G3/LIVhXybYiD9uu0NBwwzc92ifzdPX4yIYM9RzRZUURIOKxpkoXwjk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QQ+Ol01e; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9561C433C7; Thu, 28 Mar 2024 18:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711650709; bh=09Kq07Ctu1YK6YAopY47/y5AlbJwjHjNBMXfeYxKY3s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QQ+Ol01eGrtbmmXmm5UOF8z3YVrAFzrLyUinoyXQOw2oD/3BtgXxtRpcyL6qEGHMi Fuf1dGmu1+mXVCx0A2v+QG1OZmZa5GwKeTprSp0vXiGl5WvN4w7glf0wb/Ho4jGsI6 A7WhuNfxRZ+SYEDd2EHDavctgY396ec7mZY6h+UmOVbwQhncgmm56Grgtq512eTU0I juRVEJtAyO8mA2/2SAJmqgsMiWvU8lqDqaMAEVDmDUSGgn+tYLJ7mum23hafaIgM0S 0/cB+mlWradcKD4+nkGPqD1rFiy3Q7s73Qm1b4qRq5IHy2lK358t2WVn9s4EqNJkuF qXaWYWlrz6OoQ== Date: Fri, 29 Mar 2024 00:01:43 +0530 From: Vinod Koul To: Arnd Bergmann Cc: Allen Pais , linux-kernel@vger.kernel.org, Tejun Heo , Kees Cook , Hector Martin , Sven Peter , Florian Fainelli , Ray Jui , Scott Branden , Paul Cercueil , Eugeniy.Paltsev@synopsys.com, Manivannan Sadhasivam , Viresh Kumar , Frank Li , Leo Li , zw@zh-kernel.org, Zhou Wang , haijie1@huawei.com, Shawn Guo , Sascha Hauer , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Andreas =?iso-8859-1?Q?F=E4rber?= , logang@deltatee.com, Daniel Mack , Haojian Zhuang , Robert Jarzmik , Bjorn Andersson , Konrad Dybcio , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Linus Walleij , Chen-Yu Tsai , Jernej Skrabec , peter.ujfalusi@gmail.com, "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Jassi Brar , Mauro Carvalho Chehab , maintainers@bluecherrydvr.com, aubin.constans@microchip.com, Ulf Hansson , Manuel Lauss , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , "jh80.chung" , oakad@yahoo.com, Kunihiko Hayashi , Masami Hiramatsu , brucechang@via.com.tw, HaraldWelte@viatech.com, pierre@ossman.eu, duncan.sands@free.fr, Alan Stern , Oliver Neukum , openipmi-developer@lists.sourceforge.net, dmaengine@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-mediatek@lists.infradead.org, linux-actions@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, "linux-mmc @ vger . kernel . org" , Linux-OMAP , Linux-Renesas , linux-s390@vger.kernel.org, Netdev , linux-usb@vger.kernel.org Subject: Re: [PATCH 2/9] dma: Convert from tasklet to BH workqueue Message-ID: References: <20240327160314.9982-1-apais@linux.microsoft.com> <20240327160314.9982-3-apais@linux.microsoft.com> <2e9257af-c123-406b-a189-eaebeecc1d71@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2e9257af-c123-406b-a189-eaebeecc1d71@app.fastmail.com> On 28-03-24, 11:08, Arnd Bergmann wrote: > On Thu, Mar 28, 2024, at 06:55, Vinod Koul wrote: > > 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 > > I still feel that we want something different for dmaengine, > at least in the long run. As we have discussed in the past, > the tasklet context in these drivers is what the callbacks > from the dma client device is run in, and a lot of these probably > want something other than tasklet context, e.g. just call > complete() on a client-provided completion structure. > > Instead of open-coding the use of the system_bh_wq in each > dmaengine, how about we start with a custom WQ_BH > specifically for the dmaengine subsystem and wrap them > inside of another interface. > > Since almost every driver associates the tasklet with the > dma_chan, we could go one step further and add the > work_queue structure directly into struct dma_chan, > with the wrapper operating on the dma_chan rather than > the work_queue. I think that is very great idea. having this wrapped in dma_chan would be very good way as well Am not sure if Allen is up for it :-) -- ~Vinod