Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6100519pxu; Wed, 23 Dec 2020 13:34:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJywu8MHOVFDCl4cdk6i+r3+SCHnDOsn5ROfnMiSnp1Zf1LyR1QmOpNIwzD9gax1uq/fIbS1 X-Received: by 2002:a17:906:74e:: with SMTP id z14mr25075589ejb.362.1608759250196; Wed, 23 Dec 2020 13:34:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608759250; cv=none; d=google.com; s=arc-20160816; b=EqMdpPhyMCwLxRB5qbLIjo7lsG+DpYKdA9E0chu7yQXo3v+M1MyJhLcOdJAEFoiIo3 Fa+k1eWgVF5iOF4N9q7eruGWL0exMWrE8PP9DuxRmxc25B99D/8u8WuhpFXIn0KX53zM W+cxNMgI817//8YDjobysn9uPsvwU+3x/8bTpi/VNheVe2AOQJKd3lpqeV6aSUPYzQT3 gp1/tX1e/ZNJEK5O6S68U7EeKaDX9UA0CTsYXbJ8bio6kgxipe5gMnhQPBS7Twu2/R/B KH3NX4epUuhn5OTyTCwdqMZUHxYftDo9bwVJWpp2V0/lRYyFdsFAKnaK09BEN030RlDi Ge9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QbxsWfgRlzCJgOBxqB1SwxZEGeePTfdrMkj+YGC6JAo=; b=VMEojMcKpUJT+h/x7A94J9GfGSzotbS/WU7YoTM0D8XXE3nKJY4aHsOePxisKNHFM2 rHAtdyPCIcXxpLhZn2uzCA4zJGCBEGpq+ExQ/xLmbODTgjWv6hkpJounQSmgI2tUkUpY qIDQ+JuLGuwvJWmrvTFa3ncCfZ6Liz242hljwUub/fTELI8vTFF9cZwBK37HDMYlR9mG eOLhV9htNEe9ui62thprahsuh4FXOcnv1ulMAhPT9K+7ekFj1H/ayIh3g5NnBpuk4LL7 pE3ulq4X7XTblgmvkVRYQQB+Tog9IiiRWiGH04xyhPwwjS/A6rqdoDfoZJC5d/B/CvUr gltw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=Z9K6Fn4h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si13235460eje.368.2020.12.23.13.33.48; Wed, 23 Dec 2020 13:34:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=Z9K6Fn4h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727134AbgLWVcc (ORCPT + 99 others); Wed, 23 Dec 2020 16:32:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbgLWVcb (ORCPT ); Wed, 23 Dec 2020 16:32:31 -0500 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B87CC061794 for ; Wed, 23 Dec 2020 13:31:41 -0800 (PST) Received: by mail-il1-x130.google.com with SMTP id t9so399396ilf.2 for ; Wed, 23 Dec 2020 13:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QbxsWfgRlzCJgOBxqB1SwxZEGeePTfdrMkj+YGC6JAo=; b=Z9K6Fn4hT/nSk9i8CErJ6bmQCsMMOcNp7Bt7j+01+MHkB6QJ/NqED08RvBk4ZkwDs4 ep+q+MMmoC3gCyMErKrgsjZHvjFx7zubx/VOHVC5THt50fvDcCaq04C137s/L91FSa6l XfRTwdgR+Q1Kz7Yulcnw4FYxkwjUFPJX9v73k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QbxsWfgRlzCJgOBxqB1SwxZEGeePTfdrMkj+YGC6JAo=; b=W7plzYTHp/16KavpWuR0yxqzDZ4dewBMVqfg+Z6AzzL+A3X1Xq9BNFC+/h3rJ8WS0u Fh/tpVwSb3aJHLyiRPYpxouTt6WHJkR3K4WzANPY4fflGq5ZtmxOXMbnXGGXd1GidllC ayCZirz5e5exx8AHGFK5cX7ADaY7GEs6gOd+ctbW6iIPQr7AmXUB4zW5LcHTufWB4PMH kjBi7AZU6ffiMu6Eyy7N3G5xZzwr8eYfcTLIQAly4SscFOXBNPeyURW32tpXgpAkmGF/ RFYXWiHtB9QUpMg0v9Ebg0QkraJiACix4UUNC3QgIS6iIzi1rnOmx42anyfJIgZIp08K kSYA== X-Gm-Message-State: AOAM531d2DEkFrPUgvAgMROtuTOvmv2t6Rx2Ch0dd/Tj2IZ927Fsdp19 2a5Hgk+hLWOnIa4vkI3+1JgLYHq1VCoi7sWlHZ7kvDxssv9mdVSZT/0= X-Received: by 2002:a05:6e02:10c3:: with SMTP id s3mr27679093ilj.269.1608759100500; Wed, 23 Dec 2020 13:31:40 -0800 (PST) MIME-Version: 1.0 References: <16ffadab-42ba-f9c7-8203-87fda3dc9b44@maciej.szmigiero.name> <74c7129b-a437-ebc4-1466-7fb9f034e006@maciej.szmigiero.name> In-Reply-To: From: Ignat Korchagin Date: Wed, 23 Dec 2020 21:31:29 +0000 Message-ID: Subject: Re: dm-crypt with no_read_workqueue and no_write_workqueue + btrfs scrub = BUG() To: "Maciej S. Szmigiero" Cc: Alasdair G Kergon , Mike Snitzer , device-mapper development , dm-crypt@saout.de, linux-kernel , Eric Biggers , Damien Le Moal , Mikulas Patocka , Herbert Xu , kernel-team , Nobuto Murata , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-crypto Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 23, 2020 at 9:20 PM Maciej S. Szmigiero wrote: > > On 23.12.2020 22:09, Ignat Korchagin wrote: > (..) > > I've been looking into this for the last couple of days because of > > other reports [1]. > > Just finished testing a possible solution. Will submit soon. > > Thanks for looking into it. > > By the way, on a bare metal I am actually hitting a different problem > (scheduling while atomic) when scrubbing a btrfs filesystem, just as one > of your users from that GitHub report had [1]. That is because dm-crypt calls "wait_for_completion" in rare cases when Crypto API (cryptd) backlogs the decryption request. I've reproduced that one as well (even with no FS). We never hit these problems in the original testing probably due to the fact we mostly used xtsproxy custom crypto module, which is totally synchronous. I did test it later with standard crypto, but did not encounter these problems as well most likely because it is also depends which storage driver underneath we are using: most of them do not submit read requests to dm-crypt in irq/softirq context in the first place > I've pasted that backtrace in my original Dec 14 message. > > Thanks, > Maciej > > [1]: https://github.com/cloudflare/linux/issues/1#issuecomment-736734243 Regards, Ignat