From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5076BCE7AA1 for ; Thu, 5 Sep 2024 22:36:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC1BB6B0083; Thu, 5 Sep 2024 18:36:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A70B86B0085; Thu, 5 Sep 2024 18:36:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 938606B0088; Thu, 5 Sep 2024 18:36:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 69CB56B0083 for ; Thu, 5 Sep 2024 18:36:02 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E0A491A0724 for ; Thu, 5 Sep 2024 22:36:01 +0000 (UTC) X-FDA: 82532143722.04.F13183E Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf08.hostedemail.com (Postfix) with ESMTP id B2848160016 for ; Thu, 5 Sep 2024 22:35:58 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uqBjHc1v; spf=pass (imf08.hostedemail.com: domain of ebiggers@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725575662; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NaYIkt1y9gUdd8ngG4CF0IzEtRVKBWy02Qt3KB9RCEs=; b=xB2WFsty+2EuxwO5tNdkqSSQCxL8s20WV5Zy9ahzQtX//UNAFznMPz303KKentP76E+pd8 x1cD/ZYUXYWPjvPAsNLKrN/FwMrtS8QjqzyQ9tXn1OVSs2Bga3jhFq/Or1bdPSuFMf6iYQ lGedLKmrsj4yplnWT94xaUwjMWbnQiM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725575662; a=rsa-sha256; cv=none; b=Sg3Xl+VgVIGjLXpOkjxaI0QhoqAHaSdnP+gxbMZfzPi0DTuNooWu6gNuuCO5Ot9xJOne8u 3odHiQGjYtnGxe7EB3w7Uvr/d8W0ivs+UVPV9Nv9QQvCkccv7iQqMBY5PHf0Hb9GD7IW9M p/dqxQ8ibM6yq20lVirPcV2k1cZJsbA= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uqBjHc1v; spf=pass (imf08.hostedemail.com: domain of ebiggers@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A2865A414AE; Thu, 5 Sep 2024 22:35:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50422C4CEC3; Thu, 5 Sep 2024 22:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725575757; bh=ZH7eakCEqONTQG+utGtrrkQgjtVFFzSSiYzeozJllEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uqBjHc1vPwX2LM3sHccZnVGzlDj+VO3Q6IAPs0JCljCw42+x7hzSiuWl/fGl7ITB5 /yamueN1OV31HWlB9WgD2cxkFcwWt4fohIUUBqJ3b0aCI/QVWGQrQhWHs3CnAm0beI dJi7XmqPAgfS3s2VsWcwOpfa6sFsUDwBLCNlA+uf8XiMlZfwhuGugTZq1+3R3A1E3h yu5AtTYFBYyd6CIvAVm6qjIuwqDu1GYpHxx4tyeyNjPyJGzt9wKAl/qhGK8QoAIVZ6 qYOpr445tekwhQAnywUGahiL2NU8NFg4u9kmQAwlrt3WFrZfY8lkczO7Kt2kcS4Kv5 1lgwxqS0S+piw== Date: Thu, 5 Sep 2024 15:35:55 -0700 From: Eric Biggers To: Mikulas Patocka Cc: dm-devel@lists.linux.dev, Alasdair Kergon , Mike Snitzer , Tejun Heo , Lai Jiangshan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sami Tolvanen Subject: Re: [PATCH] dm verity: don't use WQ_MEM_RECLAIM Message-ID: <20240905223555.GA1512@sol.localdomain> References: <20240904040444.56070-1-ebiggers@kernel.org> <086a76c4-98da-d9d1-9f2f-6249c3d55fe9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <086a76c4-98da-d9d1-9f2f-6249c3d55fe9@redhat.com> X-Rspamd-Queue-Id: B2848160016 X-Stat-Signature: mgzmnfo4y8codfrrxmr8j4cx9foqbiam X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1725575758-696337 X-HE-Meta: U2FsdGVkX18r5AyoBGmfe6eqflJTP2BKbit/1Un5LPa3Rhnto4TbOLNFPfNzhBPhdKM98/p/LS9x0ejTb07ch/9bHWIX+EwNWJrYgHY/oyL/M+o54gUx7+Yfl8sWQxY+kNJEB5MZ7NFZrr1vBDFWzu/Te6MsTN5TbqtwkkwEY8OjNvnFTShjjQd7bjOIHyZTBr+xi1wVXAC+p1Cre8Xmmm6LP7S6f5om0U3l3/s3UhFPl0PbwSkvBQgXItU3vqpCF3t1GRASpKzb5mqZGQIrHMTN9gJIG4/I5r3Ig2Gq4U5UqtIZdPxdK9MyD0WOopC6p/R4ujLDlcUqXxiDsFGwCTWvMS1h7Nr55vhyd3eRSQYSz2Zrcy+4VObCA4SPgdKsR0eZpDvHOEORC9FjBkxxIsuW8gUbrvWei+vFCjFIxrLG5LPaCSZSgrastS8hQpfZRF+7DfIQ/Xl/V3KfBhEIBrgUDvpFROGTWxtd9/ictX3WL9dHN/nlGaHI6im4mhrCvATLRbZgHbC/Y6BwTl224KwFq3kdq+sBL/VKFuPeGzQw5gjNwjOJRGoVyIlUMzGuWEU0SnjG+WRHjc7MvvLIbUQPbFbL5uDKD5o7/oOgyqvDtb7o8NvMC6MaskWvA5a7LqrGnSGakZQC8FiDQQ89qcE1m+a/fj4cD508Dr6lZvxj+y9bL5T+FtOhGfpu434y935/+usmTJhPEtWTZ5FzVr1p6rGfc7FIaoNrhI20RLAkfixHiYIr03KN7SRu1OwgPce2cucCgs6DuQ6vbc5OUygwVvCk5RmigWu5UXF0K0Uhd/ZSwAXAjRjvz5tpgafZi+f+gyOKlvJ8gps1IirUrti9darO6NUzLwHzgxveeK9uxczwaS5BBh60U5G5lpaDgQwViZ+Usbbdrphdxk0gy4MgHGCEuGcv7GLSV/IGIotAKM0yLmwvVzz30m63VMGBqe1E5+cb7R2PB2NzfBS QTWBp6xT vsGmY78HgW3MxEme7ScJ1ILYJ8yj2MCVxwEM9/4eUm6vGDVv7JKQbaCxBpRUg85pKmyTd8g66oPrbmFASQjdI75wdOle8e3YLmLIznQjmQGE8vfKL+7XsI6uwQDZ1B1giOtgRiOPr6xBjHjghQism0dudzli0F1z/RGRkA6H5PBlOSqOFQjAO8HrD16GUzzJdc1T5AFaESXIJ25wIlHPUkbuYygHTXXbW79pBPw8gSXpUXkPgj8G1ZiCLsB25ibdOu7MU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Sep 05, 2024 at 08:21:46PM +0200, Mikulas Patocka wrote: > > > On Tue, 3 Sep 2024, Eric Biggers wrote: > > > From: Eric Biggers > > > > Since dm-verity doesn't support writes, the kernel's memory reclaim code > > will never wait on dm-verity work. That makes the use of WQ_MEM_RECLAIM > > in dm-verity unnecessary. WQ_MEM_RECLAIM has been present from the > > beginning of dm-verity, but I could not find a justification for it; > > I suspect it was just copied from dm-crypt which does support writes. > > > > Therefore, remove WQ_MEM_RECLAIM from dm-verity. This eliminates the > > creation of an unnecessary rescuer thread per dm-verity device. > > > > Signed-off-by: Eric Biggers > > Hmm. I can think about a case where you have read-only dm-verity device, > on the top of that you have dm-snapshot device and on the top of that you > have a writable filesystem. > > When the filesystem needs to write data, it submits some write bios. When > dm-snapshot receives these write bios, it will read from the dm-verity > device and write to the snapshot's exception store device. So, dm-verity > needs WQ_MEM_RECLAIM in this case. > > Mikulas > Yes, unfortunately that sounds correct. This means that any workqueue involved in fulfilling block device I/O, regardless of whether that I/O is read or write, has to use WQ_MEM_RECLAIM. I wonder if there's any way to safely share the rescuer threads. - Eric