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 027E2C433EF for ; Thu, 17 Mar 2022 19:26:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F27D8D0002; Thu, 17 Mar 2022 15:26:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47A758D0001; Thu, 17 Mar 2022 15:26:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F6468D0002; Thu, 17 Mar 2022 15:26:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id 1DBEE8D0001 for ; Thu, 17 Mar 2022 15:26:56 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CE64FA0F8C for ; Thu, 17 Mar 2022 19:26:55 +0000 (UTC) X-FDA: 79254860790.20.426B68B Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf25.hostedemail.com (Postfix) with ESMTP id 475C5A0035 for ; Thu, 17 Mar 2022 19:26:54 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id g17so10718210lfh.2 for ; Thu, 17 Mar 2022 12:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kld44BtN3rNiFeHs8eqamOSFXSi6G0Opd+8/ljmh7IE=; b=aKUrlosQ/9HfOXQQwNdHeJfbdj6COyNpFJt+90/nk3eG+hm/7ahcfqx8JRd6Enx5Zd qbllDAtGaAxjsCoL0umx6EmEc9sKvG1fp+yQBmtND7UETKMwdzRSahFjsF1ERXx++3Qt 87+Ue7rFm3KGaX8La/yPJQpzPxff/HSYVrV20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kld44BtN3rNiFeHs8eqamOSFXSi6G0Opd+8/ljmh7IE=; b=jxqrd2BjItV31l+qnCV3Keq1lKBZ/S8lIqHFK04cCiQpPDvlRSavwIOWbOijbn7d4V 5gY9wImmnTt7YFEhRfiOFHsPk+bWrTOg89aOPfOiJVFSTHJ3MfE7BK8IDgNyhpPZ6SWi +LleacuJDsMk1yBD2BQS5m2MYIELC5aP98ZlQFgyyy9/U9F096cKAwVRwW+t/HmtFXPw UVgMi8LorQLnFx4s6G6uyDZe/oPXS+Ipjq44wIYCZVgzFBwK9KCKqMYgFynR2wB3KVH9 P3Fg6bu5LCtFtG/Cz5mVsRdfF6xbg+L24wzhYdD3jU45UtaadMpwbJoyTQvMsUjYxgb8 PLLA== X-Gm-Message-State: AOAM530N2vpJl6oXPxa5qFQqZme4CvGi1CwKZ8NWNcNH1LfuyjnlHP0S rHDv6hDCiJZfaW9My4IBZJ3SNY6RWvLRsL58n7E= X-Google-Smtp-Source: ABdhPJxf+U4ZdfZmFFVUeMbY4chzM+PDu5vIqBlB7zeOuypmnrgHLS0RIghXmnsaHPFhynT8ThfL1A== X-Received: by 2002:ac2:5def:0:b0:448:294e:df56 with SMTP id z15-20020ac25def000000b00448294edf56mr3851087lfq.421.1647545213728; Thu, 17 Mar 2022 12:26:53 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id u4-20020ac258c4000000b00448392ecb4dsm513881lfo.176.2022.03.17.12.26.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Mar 2022 12:26:52 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id h14so10646401lfk.11 for ; Thu, 17 Mar 2022 12:26:51 -0700 (PDT) X-Received: by 2002:ac2:4f92:0:b0:448:7eab:c004 with SMTP id z18-20020ac24f92000000b004487eabc004mr3766610lfs.27.1647545211431; Thu, 17 Mar 2022 12:26:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Thu, 17 Mar 2022 12:26:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: writeback completion soft lockup BUG in folio_wake_bit() To: Matthew Wilcox Cc: Brian Foster , Linux-MM , linux-fsdevel , linux-xfs , Hugh Dickins Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 475C5A0035 Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=aKUrlosQ; spf=pass (imf25.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.52 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspam-User: X-Stat-Signature: 7eb7gxgd6zhy35thnexjg8cqwm6iks3s X-HE-Tag: 1647545214-931365 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: On Thu, Mar 17, 2022 at 8:04 AM Matthew Wilcox wrote: > > So how about we do something like this: > > - Make folio_start_writeback() and set_page_writeback() return void, > fixing up AFS and NFS. > - Add a folio_wait_start_writeback() to use in the VFS > - Remove the calls to set_page_writeback() in the filesystems That sounds lovely, but it does worry me a bit. Not just the odd 'keepwrite' thing, but also the whole ordering between the folio bit and the tagging bits. Does the ordering possibly matter? That whole "xyz_writeback_keepwrite()" thing seems odd. It's used in only one place (the folio version isn't used at all): ext4_writepage(): ext4_walk_page_buffers() fails: redirty_page_for_writepage(wbc, page); keep_towrite = true; ext4_bio_write_page(). which just looks odd. Why does it even try to continue to do the writepage when the page buffer thing has failed? In the regular write path (ie ext4_write_begin()), a ext4_walk_page_buffers() failure is fatal or causes a retry). Why is ext4_writepage() any different? Particularly since it wants to keep the page dirty, then trying to do the writeback just seems wrong. So this code is all a bit odd, I suspect there are decades of "people continued to do what they historically did" changes, and it is all worrisome. Your cleanup sounds like the right thing, but I also think that getting rid of that 'keepwrite' thing would also be the right thing. And it all worries me. Linus