Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5210603ioo; Wed, 1 Jun 2022 00:09:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsfrfpYcwFL9LB7j+ukJuBkCbRaFq7E4pAkAoe3N4rImFlqrHD0AFSF0cfcifmVKBohcxB X-Received: by 2002:a05:6402:388d:b0:42a:ba9f:f85c with SMTP id fd13-20020a056402388d00b0042aba9ff85cmr69611884edb.292.1654067341087; Wed, 01 Jun 2022 00:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654067341; cv=none; d=google.com; s=arc-20160816; b=UzBvyRL8pfDG4MA+CullBGgqJRXMfSaprb35ycBoE1Pro4qPWVvRTCycmJD51W7DbN 7i3DYjwdCm/r1arrhAtMAmBFBh1Ki21Mq9TcDEkUUs/OXgYOz5vnAwWbH7L7h/qIugzj yM1ef4LmDye+5uYOqcgwYioQwf1QsSMm0nQrksJQjFpSKvZBeY6pO3E9A5I/qCvgcO3x N6ifSfVrsBTac4al2GKgCt2ilLkHOfz/pqDNyCjlraplv9SH14Z5YcUkKhXKYV674aOL yMR9saFvSHNcCapypOjLJH34+AGeHL94/ySOjFR1DmNtQdhGIckRTlVUBlJTGjshYC0W Giyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=98511zNeGmuATmXSMw77QsawkSzDgf65NH2AGeM39hE=; b=Jf4GmKVc5YPVzZ99FbRadCH0iHY0QCo6X39pLUIcQvWCdESpxM3eWCJRQh1LuC4jcf 0lMg/ILlyB5j4tm+3/9NiuoQ/mgufeiRBimubLtxFHG8+YCuHeUgrvQ7Tr9S4G6EQIiE fX+drN1PgINOwV3TOx9bzyT3K1kOBDikdgQ7bTnvlSS30fKkUmEPTqamqA5nLzVHL+eU 3xiwGwEfwL1Nj3HFPDhofmKWM/zESWBI5lRzUlBpOjDljI1HMWRHfH0j95o5WsREm3tv 4Hxw7Zbshy3L2LBmej2nyOAc+DXZcvCH7itvRW+CySYWh5c8NkpOwVXmOi0T2CFMdooZ PGpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js6-20020a17090797c600b00707aefb3cc2si611956ejc.510.2022.06.01.00.08.35; Wed, 01 Jun 2022 00:09:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347272AbiEaT17 (ORCPT + 99 others); Tue, 31 May 2022 15:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbiEaT15 (ORCPT ); Tue, 31 May 2022 15:27:57 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F077548E4A; Tue, 31 May 2022 12:27:55 -0700 (PDT) Received: from mail-yb1-f174.google.com ([209.85.219.174]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MWzXd-1oKV5n0CHh-00XJVd; Tue, 31 May 2022 21:27:54 +0200 Received: by mail-yb1-f174.google.com with SMTP id p13so14076781ybm.1; Tue, 31 May 2022 12:27:53 -0700 (PDT) X-Gm-Message-State: AOAM532f4dg8HULohbX6nQcM4xAEDG8av11mec3SxxLIq1EMnmBgGVrh SKJI7TDrIIrP+5s+889lTGQuaJ0ndxxsZQupSUA= X-Received: by 2002:a25:1209:0:b0:65d:63f9:e10a with SMTP id 9-20020a251209000000b0065d63f9e10amr2750286ybs.480.1654025272658; Tue, 31 May 2022 12:27:52 -0700 (PDT) MIME-Version: 1.0 References: <20220419211658.11403-1-apais@linux.microsoft.com> <20220419211658.11403-2-apais@linux.microsoft.com> <0A9EDEDC-9E6C-47F8-89C0-48DCDD3F9DE3@linux.microsoft.com> <708F627F-0F7D-477F-BDF7-274424501DA0@linux.microsoft.com> In-Reply-To: <708F627F-0F7D-477F-BDF7-274424501DA0@linux.microsoft.com> From: Arnd Bergmann Date: Tue, 31 May 2022 21:27:35 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 1/1] drivers/dma/*: replace tasklets with workqueue To: Allen Pais Cc: Arnd Bergmann , Vinod Koul , Linus Walleij , Vincent Guittot , olivier.dautricourt@orolia.com, Stefan Roese , Kees Cook , linux-hardening@vger.kernel.org, Ludovic Desroches , Tudor Ambarus , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list , Nicolas Saenz Julienne , Paul Cercueil , Eugeniy.Paltsev@synopsys.com, Gustavo Pimentel , Viresh Kumar , Andy Shevchenko , Leo Li , zw@zh-kernel.org, Zhou Wang , Shawn Guo , Sascha Hauer , Sean Wang , Matthias Brugger , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Logan Gunthorpe , Sanjay R Mehta , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Andy Gross , Bjorn Andersson , Krzysztof Kozlowski , green.wan@sifive.com, Orson Zhai , Baolin Wang , Lyra Zhang , Patrice CHOTARD , Chen-Yu Tsai , =?UTF-8?Q?Jernej_=C5=A0krabec?= , Samuel Holland , dmaengine@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:B22oMGCygCRXUXUiRid2wa6+BPuoeRZrXYWJD0/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RT7V4t0ZG4GDKywjqJocQRtPb1NGp/O 08/AR1B0XHi7XYPnGrsQ== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 31, 2022 at 8:19 PM Allen Pais wrote: > >>> That is a good idea, lot of drivers are waiting for completion which can > >>> be signalled from hardirq, this would also reduce the hops we have and > >>> help improve latency a bit. On the downside, some controllers provide > >>> error information, which would need to be dealt with. > >> > >> > >> I am not an expert in dma subsystem, but by using completion from > >> Hardirq context be a concern? Especially with latency. > > > > I don't see how: to the task waiting for the completion, there should > > be no difference, and for the irq handler sending it, it just avoids > > a few cycles going into softirq context. > > Thanks for clarification. > > If I have understood it correctly, your suggestion is to move the current > Callback mechanism out to dmaengine as a generic helper function > And introduce completion in dma_async_tx_descriptor to handle what > Tasklets currently do. Right: around half the callbacks are a trivial version that does nothing other than calling complete(), so these will benefit from skipping the softirq, while the others still need the callback. Arnd