Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1992107rdb; Wed, 31 Jan 2024 16:08:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwlVJzQV7jKSQLBepkeDWid9Ae2zEboqoYNOt9JPpyesowWsk1bc/1tna5IMHlfddG0ObB X-Received: by 2002:a92:d34e:0:b0:363:7f6e:e868 with SMTP id a14-20020a92d34e000000b003637f6ee868mr778778ilh.19.1706746095307; Wed, 31 Jan 2024 16:08:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706746095; cv=pass; d=google.com; s=arc-20160816; b=KXSxW5Ey73sz72P+OgJkKOp+J+N2XQv/BEn9UKAU38Oyj+7tOo0R8WJHOkOn5CoZOx seFivyE5imfYlAXzNNGB4bIGe67vnaiVsLo1qkJGFmaDvfDgDsMeR3PoktsOsH9HNnmF ND3vox/TNVZLnbGUp6bt0hrEVE4pGu8zr1Zhpzd1NEhNEzPjaS+idxVftHWiddT5Wo76 ZKkEcL+h5o+cBVXXP9LS5JArVRk3wzwKuqlE1T+y9F8+mhHuG1RE9TxKcPO0D36aLBxj qWxeMFhWt5ELVoR3bmXGDDUwDci5plhMeWG0iCCp58jeuNeTfocrrJAh6PRVjq56AgC/ QpzQ== 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; bh=qrs2I23dhH0mTURdgAb5k5EfiOmRT2De1cDkKW/nTGE=; fh=O6TqY+cS7iQteta09/lDpw2qSEIEUaeai3MzfQ6av2g=; b=FcvB0JLtgj03YNzZzqvrzyHsXFNv4lcSZ3EHsGOTlitHewXDBVSVJHsW1pcbTOLeoJ mdr/L7rTP/R4VXxLFmNYi9tUUSnudAJMqB4NA74TbzYF/ZzRdgW91vleaQhtVXvRGC9r F501AQrJ/1qglrWKbwH4+xOaBfuvhEGxSpjRAUOE/CndPrr7w114vLKw9cIi8aL61YwT lp2Wnj8LIz07U6HhokzKRcmJsh2J6jFb4IoaCAXPwa34bqSuLNzJJNjwbglvutwmzDkQ QZC052NnFKObrXQyykIU0JdVk4uPeHPC5UrSm68Y4C3mpJM7y0YULs0kqIX6Jf2Ihvzx gklg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-47410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVnsGCX8/iVEf/6HeFRJ1lcvTpyucyGNkojw/e6yT8xSPoRLwakyDV3j9mzZc+8jJBhV/GNsBVQuhyYlU1fUtm+Gzg8U4XYeZiy7Vi96g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u65-20020a637944000000b005d8e3490d49si4516302pgc.407.2024.01.31.16.08.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 16:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47410-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; arc=pass (i=1 spf=pass spfdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-47410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47410-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 E9DD528F508 for ; Thu, 1 Feb 2024 00:08:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BDC217FE; Thu, 1 Feb 2024 00:08:04 +0000 (UTC) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 4BBD137A for ; Thu, 1 Feb 2024 00:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706746084; cv=none; b=KFa3Hvqf/qhWFBnUIX6QBJHrvC1OZAH3ILH3A3wG9rZniCTqD6xBa689OzLfJtvGooh630WjZo3vDb5Q+aGq2vm1rafiqJFPnYhmmWI0HDPBiiMNbUODDhIa2WTiKOurwmuYvmTB/x9bNJmrf1I5aCgV11kqf9Yhy3m0nfVGvKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706746084; c=relaxed/simple; bh=38P365134+J9VPA+zhc8aLgUCIaPw0JB4YMCk+7cmFE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=may6KoRbiWsT5pu/ZXsUx76aoK8SaIXyV1uEQnnWaLzX/pJQfWmKdxt+WA0NWYWPimWLNpjyOwb6QnzLmReA/NqRMKkkKlpIE+tsCaUIKdQxBxFeny0I7QrBQUYDRo/6BJw5S3+OoE9OPqYYiJS8SCk+F2kjopKs8v3tNkzxNyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=redhat.com; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-68c3a14c6e7so1838696d6.1 for ; Wed, 31 Jan 2024 16:08:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706746081; x=1707350881; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qrs2I23dhH0mTURdgAb5k5EfiOmRT2De1cDkKW/nTGE=; b=HHUHTIYKqPhUek/9OPYZ7Ewq30Ixd/79JEfD0qwJBFxHbeWDjoXrjimvTEVUYB1opd 4P/hYn5nkJDHp9dfT7qbgv8IWHwTxyafPy7g+Kz2nvDd7/ClmboLoBaRBaUkDVacbjY0 PwWnI/uVTVl2NvpyZbt1LzuUroBbk+5Wpkgx0/RInMCwYlZM+1MTP102iqJE7SpbKisj +rD+RwsL52Cjh2eR52ZAZK9+vbCuVQR5W92w6Daf/wMkkXbTm/ip0RfissmvOlF6c4V5 lL/5hZ9yddAirpjp/7fQrRcKhFeiJAQi3FkWpZ3dP/BS1t1Va2u58c/4IA5719B9iGYe 3uhQ== X-Gm-Message-State: AOJu0Yw+Nz260kx+0LajWfRi4c0YJikfjF/hGXv0TuKbYyRNQsE4QSvh /scWKkOKsajxb3xlVnWdnDHFWGHT8PQ1VC3hkd5ddTPHZ4FlEM2kz3oXuzu/TA== X-Received: by 2002:a05:6214:4105:b0:68c:5d76:2ed7 with SMTP id kc5-20020a056214410500b0068c5d762ed7mr964043qvb.46.1706746081232; Wed, 31 Jan 2024 16:08:01 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXrW6E1QlCIEvdGVX53QLZt5ZxVN2lYtBdrwhU8x8EI350kfPWELndRJ9m3hjLrqF+OA/jmM3H433A6hI5canmqO5rNjU3V95LIVKL6r5bvMVucwZxjY7Wzn2rcDvGDRxumln2g6oX7csjzoMbiqW/eCVi5sErdBf16+SKQ8SY1sxd7+bPHOq0VAavE6BO5lo2F48H3ALmH8KxSXpUrjDb+z0hd0IBkZv5QxSXXm7wR9UfEyNOTJUBWCZ4cLl9NtY7aZLRhXZ0MWKYPYkznsLZg1emSIWIvH3Ve86QFjMtSR/nq29VR77c9OMtXj2RRM3nSay4IPh9wOmWV38a0pTd7XTaFvNETUlj+cs4k0igz3oC8gTNu2VEwG7nBTPlc+N2LOI/JiPsM51rCXhQvxizYKrDABHRCsJqH2yVYnuwFN8G6fbw6IDH1sa+Bnw== Received: from localhost ([107.173.73.29]) by smtp.gmail.com with ESMTPSA id pc4-20020a056214488400b0068c6d0c3f5esm265608qvb.58.2024.01.31.16.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 16:08:00 -0800 (PST) Date: Wed, 31 Jan 2024 19:07:57 -0500 From: Mike Snitzer To: Linus Torvalds Cc: Tejun Heo , Mikulas Patocka , linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev, 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, Alasdair Kergon Subject: Re: [PATCH 8/8] dm-verity: Convert from tasklet to BH workqueue Message-ID: References: <20240130091300.2968534-1-tj@kernel.org> <20240130091300.2968534-9-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=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 31 2024 at 6:19P -0500, Linus Torvalds wrote: > On Wed, 31 Jan 2024 at 13:32, Tejun Heo wrote: > > > > I don't know, so just did the dumb thing. If the caller always guarantees > > that the work items are never queued at the same time, reusing is fine. > > So the reason I thought it would be a good cleanup to introduce that > "atomic" workqueue thing (now "bh") was that this case literally has a > switch between "use tasklets' or "use workqueues". > > So it's not even about "reusing" the workqueue, it's literally a > matter of making it always just use workqueues, and the switch then > becomes just *which* workqueue to use - system or bh. DM generally always use dedicated workqueues instead of the system. The dm-crypt tasklet's completion path did punt to the workqueue otherwise there was use-after-free of the per-bio-data that included the tasklet. And for verity there was fallback to workqueue if tasklet-based verification failed. Didn't inspire confidence. > In fact, I suspect there is very little reason ever to *not* just use > the bh one, and even the switch could be removed. > > Because I think the only reason the "workqueue of tasklet" choice > existed in the first place was that workqueues were the "proper" data > structure, and the tasklet case was added later as a latency hack, and > everybody knew that tasklets were deprecated. Correct, abusing tasklets was a very contrived latency optimization. Happy to see it all go away! (hindsight: it never should have gone in). Mike