Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp320488lqh; Thu, 28 Mar 2024 03:09:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvLp3jfU6RqHHuAGdMyP41HnJm32XqOoL1aN09tyuUDCXJjZE8NXbGdvJLWVrijN8l4UEfK+jQl++yRs4hDZYRbb3fVcSmOhyw5KYKSA== X-Google-Smtp-Source: AGHT+IHO+CwotPPvAOWfPIaR6l49Oh6LIddS5bLXB7k8jfL4lFI1q7bZ0RogBclSVcIwCDw1MsCI X-Received: by 2002:a92:ce8d:0:b0:368:7147:250c with SMTP id r13-20020a92ce8d000000b003687147250cmr2882282ilo.14.1711620577443; Thu, 28 Mar 2024 03:09:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711620577; cv=pass; d=google.com; s=arc-20160816; b=ty/U2we/0GO8eClcmh9s6BlouFlsQhGMklQm/MJtOVaU2VPArbh2qYgayQMA6pXehP k4klSi6z9YxkaWx5NeUAY+ADyu2sZM0eI3/LvIzdP5Ez2BBQ6nuIMWqOYblAxTbeNQl6 QGVd7Y8DDw3mgjotZp5iVgaWpwdBFOFl0A9Uf3q5ZJ/yB3+CTkEsiUnlKdzhvmsoOXZr 6eBfJL8vjrp6T94+cdTXJ9dZwgeYKcTaL+gI531Oq3HyoBqiI40zKB5t/H6LseGemw4F xq0vZKEA2yUEkQK1siapEixJuqoxSrMtKqpr06vy7Wc9avchials2gcoa0GbFwvVSjFN oiEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=pYBjGEQadh25rkMc0fkoc5Y7p79L1tP3xKDkS0IogRA=; fh=aZm0jPwpO0Pq9a4iNhttOnDBe9kIKLLZl4jjMqnEB6U=; b=JZXlVzUryt414am/m/QvY/mBeRFdHOf8HZAUvzhLc+pCaHPW+7jmDDeBZCbRCIbUz0 HdO7mc3E9QQ2bz+mm44Jm6M5zVnINOe4itlAflTJcG/mdL/Sr7To03MQk3+37PczEzYo 1lXeJs6avktwXOClifHsknaxH3LRuQtwBOzSTM9/9niIvEjpaEYQqr7S2IIVn48QgGSP Ggmpx/8kmyQT2OnguSCo39yxsvlPH8H0JCmcgboBSpsGHpkiZ+m2lqpCG3Br5i138C2B 4b/IuRuA9rx1rEv1wiTtQdLCQuZclAdyQcs82OOGtmUzOeSB3oM8nTqxRiMYIbysTilS 2jdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=kuMfx8bc; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="E7CyJ3/s"; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-122745-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122745-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2-20020a639742000000b005f07f350e33si1127957pgo.139.2024.03.28.03.09.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 03:09:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122745-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=kuMfx8bc; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="E7CyJ3/s"; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-122745-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122745-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 EF651293C8A for ; Thu, 28 Mar 2024 10:09:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFAFD7CF25; Thu, 28 Mar 2024 10:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="kuMfx8bc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="E7CyJ3/s" Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (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 A118C53E28; Thu, 28 Mar 2024 10:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711620553; cv=none; b=EnaqEe2QUFIs8TC+WICkGDZbH4V8VpB9vOelr1DsNs9YtqAYOAIa/mBICx9YxJiwnEsxPvQS5vlFEWVUmlAvKQsRXykysudS9WqM7sEUZDvolOSPnv30jAG5PYAtHA2x8d5p0M4iPkY+BywZmg8+n+hp/he8ZVLTlPQr3XoCr1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711620553; c=relaxed/simple; bh=rjRj8lT9t8c0kTmFFh6anVK23ZDO/NaAc4KKhIVP/Dg=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=pgza2ybZzsFYyiDRMB00k8z+4gp+4nQ1/S3jErV3GuJ8R3SVhCGZn6iVeaacnIEWLdEE88n1HW1qqaHtFNDNDsP2T97nvLBlcTVTE6YnPn5VsxT50sYycS3D4MZCd64kB66n5ZcCtiHH575KJwjfztDT1XdLN/SnYNC1oghyDb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=kuMfx8bc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=E7CyJ3/s; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 93C1413800CC; Thu, 28 Mar 2024 06:09:10 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 28 Mar 2024 06:09:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1711620550; x=1711706950; bh=pYBjGEQadh 25rkMc0fkoc5Y7p79L1tP3xKDkS0IogRA=; b=kuMfx8bc1R4WUipcKL3tIzF3N4 t3zOBlcnNWDIjDe7ipHZ2vdT8gjFEPI1e+ODQbTkh7dUk5LNLdH719riG/7S23u9 309OowkR1D0rX5rjd1oDDkcNZe/zfRVVl/h7s7JfZ0aDU1bPjSm0hIEnzbFG9z5d fZQs/LIhA7ZaDgthlMZZPByr7T+nIaqNafh0zRk/d9JNzTnIwNM75wPeatuGsvJu Vq9S8uOTkkaEMlwp3RXo+JBYMzLwFYLCKo/A1UzzbQWuBCuXekHkJzt6XPQ8TNq0 tQYhv/S7h0++y+XLR2ohIzKvK/W4GKBW0sO7O0tHfshYhs7bYX0yHfgvb/2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1711620550; x=1711706950; bh=pYBjGEQadh25rkMc0fkoc5Y7p79L 1tP3xKDkS0IogRA=; b=E7CyJ3/sS3/gu76u1633stL9057wQIWYvG9vs6NHo239 7KFVH5M+YFwRBpbadfOh0IrOE9j4E7XE2sRBAIPKToAbDSVOK/ax1a0sOrbNo1ee HE2lX3ra68I5G6+wDY65qsdnqLej3HDSJFNyvB6/pL9He2U4fdOMxGYaZ0mva4gx tJF6Lfvk2fEXAm0uFD9oIE3EiQrZhWq8TW2d9nb3vmsns61RTvDrPIxeT4GFvMi/ wMG6FliHZtmYgvC6R+hGoAU23GBHUBuECiPfrHriLa5i6tczRd0gr63KSOr/UuG+ wWszyTwz22LUBqLfZhgf0rb6euQgm1MTKFDblo6DTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudduledgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E6410B6008D; Thu, 28 Mar 2024 06:09:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-333-gbfea15422e-fm-20240327.001-gbfea1542 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <2e9257af-c123-406b-a189-eaebeecc1d71@app.fastmail.com> In-Reply-To: References: <20240327160314.9982-1-apais@linux.microsoft.com> <20240327160314.9982-3-apais@linux.microsoft.com> Date: Thu, 28 Mar 2024 11:08:47 +0100 From: "Arnd Bergmann" To: "Vinod Koul" , "Allen Pais" Cc: 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" , =?UTF-8?Q?Andreas_F=C3=A4rber?= , 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?Q?Micha=C5=82_Miros=C5=82aw?= , "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 Content-Type: text/plain 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. Arnd