Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp672938lqh; Thu, 28 Mar 2024 12:40:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3YwxxpkweoTOTlmOg6aiW73oLh03cLaDDYN932l2i7XkZA5a1yLTwQPuew/2xDmX14yITvRnKPvSYU9d+WkaBCMqdBXw3p++6mHPFQg== X-Google-Smtp-Source: AGHT+IFN1ZzyP1fKzjbjkYX8C1zzBEJM7Gfe4oFlet25R5chLbX2c02tmpxI43DWIR6bHU9EJO2s X-Received: by 2002:a25:13c4:0:b0:dc6:d6f6:cc13 with SMTP id 187-20020a2513c4000000b00dc6d6f6cc13mr331073ybt.20.1711654808292; Thu, 28 Mar 2024 12:40:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711654808; cv=pass; d=google.com; s=arc-20160816; b=hywoB71ARrw5CvkY358PQhYJ/uCVIxJuyDfXO4LPIiQSRqNwLM+cr8im7wX1W560pd pmI/XkoV1/r8vCzzZsTHfUZR7QSIzQkD62gomX6r6aBgIxK8/jN91r91DPojzQgXVRlP ppYvJsqlegMZDla3RbRUwM35nKK5yGAC8ehsojZlTbNB1kEoGhUiLiLEohrtGhf3xADx tqM7SeHBg5ZqysRiQrdC7tK+xRiP7WFHjAcWdqAOYxiXqSpXncy7TqvgL9PI0Ce8uNEN cgRg47d9nmiv3IHPC57L5vNHd9lE5RAz9PIZLJwImwHvmUZ37MxuSjk6H/w9oOPVWne2 Gd+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=622VK9NVBI6NV/BHlHroiE+gl2GqatwpJmnEQrqKhSw=; fh=jMGYHu+4eKK4L9mEEBD50HWHXlYFITSu4STrGG3K11c=; b=AP8BNnMH+/rEUwkZsJwrS1g595CrPrtbk6j32im3o1/E0CeGqLQOdfdK2P2lhFid/S ePHm1bo1takKol6SWHV5X+ly1FQd/3IHP0tnN2GpZDNNk0rf8p1n1nVcyPBzDGG/fKcI AAErYDMPn4cNJM+c1r75KqSaOpW5mE43X4UVCUCJ0KnUYPtxlYgZvWOkJCUnipxgUvlc OAVwYsnFfID7efZThtxGxa0VROGejVQfCfDVS/BgFGOFpEGLbqT+NqV54kew9FySZhXH xYZr4MXi3s2qY3nVQazgSdB4r2k16cVmQD0x32j0cEvp7BKG2AuBw9rd7pnC/XotLQg3 uEoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="k/b7d3R1"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123490-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p15-20020a0ce18f000000b006967b19d984si2222839qvl.524.2024.03.28.12.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 12:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123490-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="k/b7d3R1"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-123490-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D9C601C260C0 for ; Thu, 28 Mar 2024 19:40:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC960139589; Thu, 28 Mar 2024 19:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k/b7d3R1" Received: from mail-vk1-f176.google.com (mail-vk1-f176.google.com [209.85.221.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B9A541757; Thu, 28 Mar 2024 19:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711654784; cv=none; b=Fy/MY4fagtOn21d9nuVTsBLvuRjeXh1EWpZu5TKedSwy4C1pJd5eShW7krXlmo4ChLTmJ0iHWdEn6drPUI8siJKjAHGOAmj0zR4oiHRrM0cwC9jEBeqfCADoKrH4NTWqij4FXx3XXBMACvb2p5gAdcgugf4g/9P5v0Lu72CX/8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711654784; c=relaxed/simple; bh=622VK9NVBI6NV/BHlHroiE+gl2GqatwpJmnEQrqKhSw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=AAiJpcXwdgg5DvIlDQ9mjTcXNUrXMnoZ692sxpEf1JCtuqpleI8IclxaGol+ttZ3HQqbDvg12OM68havwHG3iw8QheT18vBhOZbQKpmc+JItJVVaNbE0/dAXODpAOI5he/A8uthcNp2upuMMx47r5Mnd8RJAq8gyspqZtFMRpHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k/b7d3R1; arc=none smtp.client-ip=209.85.221.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-f176.google.com with SMTP id 71dfb90a1353d-4d43a1f0188so539825e0c.2; Thu, 28 Mar 2024 12:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711654782; x=1712259582; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=622VK9NVBI6NV/BHlHroiE+gl2GqatwpJmnEQrqKhSw=; b=k/b7d3R1fU5uK+kSotRkB0lCHcUaksiunEIO+7V/B4ZHd2mTvo0WZ83tSH/kXbEyoA caceaoMwHso01SQxXTjgUFOhd+76A6Wc4+kTngdWJuBIdQZ1u6BthS9JKwyxXUjfaFH1 KM8jWVzJg+wxcbf4Xpb1XzQw7hYBGxSmIeBOYQy4sj9MLKY0tXkKY64rtKpRqcDOOi/9 PA8t7rwlbEa9OqB5aG7zC1lR1MFamBHia2IlmQrpl4CiIdSB9WXEKGyEnfZjO6naNJOD na6U5pDUB/3VN6ICO/w1hxi0VB2RFyjqAj7crGbhWabVk0pqeDZgJWI2vykTaMHZ+Uxv C9oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711654782; x=1712259582; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=622VK9NVBI6NV/BHlHroiE+gl2GqatwpJmnEQrqKhSw=; b=gCr1ihnBI54swZRQY4zSQnn+LgOfMthcDa+naOl06FWwUNL3cXHsyACSaKmFiT+5gn u1l+1EXlRU/H+AeNKrjm36g5EyeztxavrKwZsjUgbYu9G64/3OSjwvMLHJmkplg5qVgc cKrZaz3AiJwTs81gX486x7t1zl/pihZxlwwNtTFbFzbG8OjUcPQ1SCb42jNsYdbC8gz2 qrDsuB3mk8GQ89MzzymDG/ar8OBm8Hen3WzE0tlflkRqEfLT0fkvP11Xji8NC0HzNWJz ESYUb4GI1+HDFqS8U8Kv+nCpPHxeXL2EsCQjY5Lpd3KCwU+l7n+14v9JeUXGtb/2QXE7 Br8A== X-Forwarded-Encrypted: i=1; AJvYcCWf1W2N+dIzvu1ZEcwy51w6Z80zLjimand/ShK4RyBCcJOv4ouZdTwD6Tdm/hs7qltF3cYHRm2yVhcKuVckxMgrb2ZaiEQnhWgj03I+50qae3dpybEcXuT+GEZ89atWWkSXoRwF2IZLEUgmt7Smgk4Wq/ApwcJUm954UI8fycvmP2jXUz5XXMab1eLr5accZ1THQ6y/vTcmLTZJzO5DZbRAAQNG99FQlZUbczVTA5jTZCZ1G1oYEufa9toyLjnFngqIzqHN2idPFdFkKYhCm674+TkVdlXmilhdY+F5fPB2r4QO5gjw5HFXKtBF7wU5qwNnXB5xKwKuDFUTf/2A893wkLyVeGuTY7AKR85Id+DYJBy1xwi9uiZEfdC5sWk5Mr69bbgKJWeXYDQiX48PYe/WgU7V/hAnV7SHfyfe10aFFyR4cuRCX9ZovdX0GmgW6LEPZugPuz5T5iu92dV6wpX6bvdIuj1/vwJQxjVFTLIWWmMyI659PTd5h2tJGVfNr+xOu3JNmFUhevlijdXXg5zVFDxymv3wB5OIN6EsxirJCG+Fx61d0qwF1hFS6g0r65zqzq5lZZkVgwlJSwzq1hI= X-Gm-Message-State: AOJu0YzfS/AMGNK0/ET20aRpT1/VuF8TPj9PhPtR8AL2+JXXpnTnAMrv qoxveckXjBDu4sU6SAmK0TP1BG4hbwwYqG+ygt4bK0e0EMk4YD/4nZ1rbjlMFy/5dT2yRsKFTkH xvhKqKpSpQbFqWzzJbGkWZ9BVp1o= X-Received: by 2002:a1f:c801:0:b0:4d4:1cca:1a72 with SMTP id y1-20020a1fc801000000b004d41cca1a72mr369742vkf.6.1711654781874; Thu, 28 Mar 2024 12:39:41 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240327160314.9982-1-apais@linux.microsoft.com> <20240327160314.9982-3-apais@linux.microsoft.com> <2e9257af-c123-406b-a189-eaebeecc1d71@app.fastmail.com> In-Reply-To: From: Allen Date: Thu, 28 Mar 2024 12:39:30 -0700 Message-ID: Subject: Re: [PATCH 2/9] dma: Convert from tasklet to BH workqueue To: Vinod Koul Cc: Arnd Bergmann , 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 , =?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?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 Content-Type: text/plain; charset="UTF-8" > > >> 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 :-) Thanks Arnd, I know we did speak about this at LPC. I did start working on using completion. I dropped it as I thought it would be easier to move to workqueues. Vinod, I would like to give this a shot and put out a RFC, I would really appreciate review and feedback. Thanks, Allen > > -- > ~Vinod >