Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp912747rdb; Tue, 30 Jan 2024 02:20:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/ofeXZb6D+tswm9avZlRxdr+fCfJxzRi1Doj8TQUwRnO5lo1rteoI3TUKRm2hEPpOOEjI X-Received: by 2002:a17:906:81cb:b0:a26:c9e6:d5e0 with SMTP id e11-20020a17090681cb00b00a26c9e6d5e0mr5891574ejx.74.1706610040087; Tue, 30 Jan 2024 02:20:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706610040; cv=pass; d=google.com; s=arc-20160816; b=r3b6eaU5d66BNZA5zax7GmGo3T45oCxkJPXbRZlXXBZjbQX1645pDrsRNqse86HT2h GGQYZwLzzhpELW6/5urczwQKKdpxnyv6Lpgd2fdO/vBT48vdH7G4jjhbOdnXpSRawFbj u8pS600CngwJ9agbGcFlSeMFHQYAchX/TwPdHVROgpX9Lc4PRAMWPOn/F9UHIA5D3Ybf FI2CfzBB5+gE+pV0v+/mm/ywQTEaBfBSv2G1bC21H6uqXvCz7aE3seySzzMHH2/r7sSa iWpw5824I9EHnX4GbvuQobDkkqwPxK6/OMS0D9+yIySP8YjHHOKsceA0b3RbybnLV0cQ Lyfw== 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:dkim-signature:dkim-signature:date; bh=33I6KUptN215uQ8/TCY4CSKquwhpzQOMErJY2s/Iee0=; fh=n8I8Zgpk5ptkyXIE1+V5+5AoUrWFT6Pcx+ijIhQev9g=; b=eHSfPNVSHQn4Sd57ov+QkWVttQhPtZ5ZqXeTlSLqgsvbXjcjdPdD2p+fVKm5xJTijB FKiVRQTILdH+qh0g5L5S6hHTgSxmLxBgbxuqyiNEYtQn01vJ4B13A4hFxR0raG3zTWza 1xvd8GSsAF9S5E2dojCL2b/fsYzzv+bYr4asguvNFWM6pZUrh6wTDol77Equgy5e/f+K gk6lcU1Ghq9RhfqA2UD80UfmZov8m7/ZoRuInBmhuJP3a9ZdlzB4OSaQXetMigwAT8b5 l/BsYRwWv99uWy4ii13CSSXIPqAfjUuKLXrKAqWqd8amwodAz/dHrLH2qkYfe/mcJV2F F+pw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dbeFUlKH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=RmMuECqy; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-44371-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t10-20020a1709060c4a00b00a358bf1b1f2si2364050ejf.729.2024.01.30.02.20.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:20:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44371-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dbeFUlKH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=RmMuECqy; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-44371-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D2EEF1F23818 for ; Tue, 30 Jan 2024 10:20:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20E0460EDC; Tue, 30 Jan 2024 10:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dbeFUlKH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RmMuECqy" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 B019260B8D; Tue, 30 Jan 2024 10:20:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706610022; cv=none; b=dmKU2ink7UJ5bAfSH9KVRPm2YJDbt904E0L9trkqCKyvt/ryE+G0FKIW0M7bRSvq+LqEu5Y2KwbY1zhmLeqQ2aBHX9Wz7qYPNJs1is3XFIx22NnNbCtxRok1U7SyXg82Tbzds/6r/x200uI10Mx3sUga6nb0/MuUJB1Jc6xnLII= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706610022; c=relaxed/simple; bh=Vu3/rb2+o9A3xavD6zhieunf/6dYSlSau376+ZTpvg0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N+nHkcKbfCsxZ7bKvT/Iw0TRXEask8woEHkbzuCJViu4CMkHNTQCMCudM4riomvJR0vz+aVffuQRxvKTWAd1Nr08IVWU1x1aKD+BJia0xTRSCLJsknV86zq3EH4VEdrtqif/G3LG1Oul48DflOlQDM2MNZSJhq9TjTAWVtY/69A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dbeFUlKH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RmMuECqy; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 30 Jan 2024 11:20:11 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706610013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=33I6KUptN215uQ8/TCY4CSKquwhpzQOMErJY2s/Iee0=; b=dbeFUlKHES4fesoAHnLXHJ+VSYqlpTZw1eJPWS31UM8nLcj3mswTX5ykMcL2FtN/QiNDD2 fYKdSvcPQLz33oL+y/Xj3PL2IBBqzAZq0GCAIOMAvIn0vHHkERJMr3BCoCvCB/bLp/cRFn 8hPmIJKDqlDM82IvxIlTSu39xkFreBDnB/Jl4+B5Y1YoIVRHTIR2yGonu4WdLUvmrDV1xq GuHgWKh2dDJw77bwgVlUPXd56YEPBJyq1rRRTG+0U9w+Am3AdqiUynzZog8cejZDYibWmC aSSFol7cgwyOHlyoL+iX5KN0uj7Y2A/njaw2KtTYqMxPrSpV5bCSFeq0NsF1Lw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706610013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=33I6KUptN215uQ8/TCY4CSKquwhpzQOMErJY2s/Iee0=; b=RmMuECqyH8DIcdQfe7Trm2myMgd3pEznT6Bm+Y1jq2PCdSuiRKCXyvehmLz1jJDFtmE4Av KcY1D98rUSikL6DA== From: Sebastian Andrzej Siewior To: Tejun Heo Cc: torvalds@linux-foundation.org, mpatocka@redhat.com, linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev, msnitzer@redhat.com, ignat@cloudflare.com, damien.lemoal@wdc.com, bob.liu@oracle.com, houtao1@huawei.com, peterz@infradead.org, mingo@kernel.org, netdev@vger.kernel.org, allen.lkml@gmail.com, kernel-team@meta.com, tglx@linutronix.de Subject: Re: [PATCHSET wq/for-6.9] workqueue: Implement BH workqueue and convert several tasklet users Message-ID: <20240130102011.rX9Qjnp1@linutronix.de> References: <20240130091300.2968534-1-tj@kernel.org> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240130091300.2968534-1-tj@kernel.org> On 2024-01-29 23:11:47 [-1000], Tejun Heo wrote: > Hello, Hi, > As suggested, this patchset implements BH workqueues which are like regular > workqueues but executes work items in the BH (softirq) context and converts > several tasklet users. > > - The name bh is used instead of the suggested atomic as it's more in line > with widely used execution context interface - local_bh_enable/disable() > and friends. > > - The system default BH workqueues - system_bh_wq and system_bh_highpri_wq - > are provided. As queue-wide flushing doesn't exist in tasklet, all > existing tasklet users should be able to use the system BH workqueues > without creating their own. > > - BH workqueues currently use tasklet to run the work items to avoid > priority inversions involving tasklet_hi and WQ_BH | WQ_HIGHPRI. Once all > tasklet users are converted, tasklet code can be removed and BH workqueues > can take over its softirqs. If one context creates multiple work item which are then moved to tasklet I don't see the difference vs workqueue with a bh_disable() around it. Looking at the USB changes, I would prefer to see it converted to threaded interrupts instead of using tasklet or workqueue. Both approaches (current tasklet, suggested workqueue) lose the original context where the request was created. Having threaded interrupts would allow to keep everything in the same "context" so you could prioritize according to your needs. Sebastian