Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp923599rdb; Tue, 30 Jan 2024 02:49:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSo3NDTNGnQ6xu5UyUJzZP0pfNJ3kA//QSy1SjL9oOUXQxtz/3gs6NKyl/So55KA1CoyNM X-Received: by 2002:a05:6402:26d4:b0:55d:2d9f:3334 with SMTP id x20-20020a05640226d400b0055d2d9f3334mr7052689edd.0.1706611775760; Tue, 30 Jan 2024 02:49:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706611775; cv=pass; d=google.com; s=arc-20160816; b=CLhpcuFI8yQ9ZeC3hraVCNK7ZAt2Nfk3Qoct++aZnlSgo0CVud/v6gSQXeV59ajJ/M eIDFFfdGQT5dMKVcABNehHpwUjY3M3j/MQvEtSObyBt+iGo/rHeimpRXtJgLaQgm4FPL w2VVNe9mwaBKcoOOjWkCUV6EnPxOcAB/kNgzFQ7lNgKAOn3hlLaH5GOaLLfrdJgNIrzV k6QWtFd9KhrPXtlU6wfjoCkw0TzN370Rdi2cmiaB3fXZC3isTn1hCTHGbcHadcaSGAvY tgww+TMzS1pnrUzei9MGyONK7t+8lD3dPTYPIvWDf9xr5vrY/NzgIKnz1tWn+LE56aN2 Pu4g== 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=jglZkCKiKZBorhtlJAzaJu8vNan4QCT2HLdU9knygeA=; fh=0s0DxH6HSFb8GP3SmfPAuyxweucyohelxdZi6IUGmWM=; b=y45Y/TF9N0sUxVKkaUjxDIcWEmpRxuRAKh1q7tGJxOrfhVD1W2iYkyJ4NxXQ9BsW4J E96Gt89NYuBE57gwU3WZaFGD4byLZecMY4P3TBrG4PHQfXLjcVT0nTGukSenAr43IjA4 fBlvQBdFshL/ozGQOuEvhEdaG3wkK4q6068Mc7d2FqP23XTs9qbrnSWOm3H30Ldh/ipy NyNE9TGRM7Vn4GDgoLPzpL4Ye1t2UzUqANCiqir+NU6qWBJrrjFCRu366iX+FnXVB9hU yOwuJ23gSt/RI/HWG2RLentjBlcZDlbHPNw5VZaYnr0b9CTMPnlvohAFLBAmVulspkcE G6oQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="WXJSp/EZ"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-44421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44421-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o7-20020aa7c507000000b0055ef4fb4170si2105270edq.56.2024.01.30.02.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:49:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="WXJSp/EZ"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-44421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44421-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 515981F268C5 for ; Tue, 30 Jan 2024 10:48:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4ECD67A12; Tue, 30 Jan 2024 10:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WXJSp/EZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="g9jOMurh" 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 5D80366B20; Tue, 30 Jan 2024 10:46:49 +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=1706611611; cv=none; b=Yh/Po9NIlXQT82CSKh8SLayQCs8FnSq9V9FaotwaZ59QAKdUj13o0szIz8UP30ENsZ1yaIIaTyTejuDIaVev3UqFRe+mYu5EmqaqQNSjtKqSo5HrF4VJwWyijViUNY7WhtUJNew3LXqjtjmYiX2kvpGfIeCvxPsGma46FcZ5kw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706611611; c=relaxed/simple; bh=z8HQZ1RIcZ9IQsXzY0ib1csxcJUvHVGeYNDGFA9KaCc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c63NRk1wrlolHwBiKujQyhWU25pfFwLfihMhlAUv21xXkEAtDEeh2d7tCBpWH5RF++KerrJ07bVBLsZ7tCXGg9ad9ycGn7m7KCDh4EtnaHP536vlx0TddwxH+Cvzt1veA2sWZYkVcBwwdAbGo+5OWMVgr82i5cyb2afah7/IJ/c= 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=WXJSp/EZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=g9jOMurh; 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:46:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706611607; 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=jglZkCKiKZBorhtlJAzaJu8vNan4QCT2HLdU9knygeA=; b=WXJSp/EZ1N/l9q1lUMdQ5hDV8/ys0TJGqlpxdzwZ7h1uL8kUAwDDr00WHuWUKbYOuUZ7KW nL4s+XDYJJ6pISw5YftB8Km+Fqzs2AhqB5AO3JXlG6SZgpdt7RacnZ+5u7ptl7kdcNDgN9 gF7Lti8PkBNyJk0DmGY9p5y8aPRhsUYi1qRBsvMEn63w94ovc3QQuE1P7hXrPF1Zy9XrWp qUh/YmqKqBYejBa49rNstydAg1DO/uKn0QOHuxP6aCTCgEdL6dbN4xNpCaFCX/oQs1FtAW mVNvRmS31aHJ86KQepO7oj2p8ekzXnEvNX7VnMIQBcawMRb7POuRPVQmWRLKig== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706611607; 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=jglZkCKiKZBorhtlJAzaJu8vNan4QCT2HLdU9knygeA=; b=g9jOMurhIPesxC/jgbn4sby1InW3YJmfL0KPXUeasEWNWb/AJmgVMipqcjLxe2GPieqSNA fuIygHbIQZJ/ugCA== 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, Alasdair Kergon , Mike Snitzer , tglx@linutronix.de Subject: Re: [PATCH 7/8] dm-crypt: Convert from tasklet to BH workqueue Message-ID: <20240130104645.Gvnx8KnC@linutronix.de> References: <20240130091300.2968534-1-tj@kernel.org> <20240130091300.2968534-8-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-8-tj@kernel.org> On 2024-01-29 23:11:54 [-1000], Tejun Heo wrote: > --- a/drivers/md/dm-crypt.c > +++ b/drivers/md/dm-crypt.c > @@ -2263,9 +2232,8 @@ static void kcryptd_queue_crypt(struct dm_crypt_io *io) /* * in_hardirq(): Crypto API's skcipher_walk_first() refuses to work in hard IRQ context. * irqs_disabled(): the kernel may run some IO completion from the idle thread, but * it is being executed with irqs disabled. */ > * it is being executed with irqs disabled. > */ > if (in_hardirq() || irqs_disabled()) { > - io->in_tasklet = true; > - tasklet_init(&io->tasklet, kcryptd_crypt_tasklet, (unsigned long)&io->work); > - tasklet_schedule(&io->tasklet); > + INIT_WORK(&io->work, kcryptd_crypt); > + queue_work(system_bh_wq, &io->work); Why do we need the tasklet here in the first place? Couldn't we use workqueue? As per comment, the request originates in hardirq and then it is moved to tasklet. Couldn't it be moved to workqueue regardless? > return; > } > Sebastian