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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93972C4332F for ; Fri, 18 Mar 2022 13:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236597AbiCRNR2 (ORCPT ); Fri, 18 Mar 2022 09:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiCRNR1 (ORCPT ); Fri, 18 Mar 2022 09:17:27 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89ECF2DD988; Fri, 18 Mar 2022 06:16:08 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 4754F21101; Fri, 18 Mar 2022 13:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1647609367; h=from:from:reply-to: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=f3kv0AiWNbv68LeKn1hsglF0Wmdg9GUXlOxnUzosnJE=; b=RK4Lrt9+CnrVCuQbkXrZvk5QH0vUSOjRUd7C+Ln3z0RmN1oYZuIH4Bu4rjLqpRetncL8OD KG64pV77vbFy92MPEtx4ZyQaB54ufzgzMG7rYRZrCUXkkrVsheQFzZs4zNAHAYRgabSebV /K6+C8WFYtSwLA6AxvWlF7lvcry/RK0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1647609367; h=from:from:reply-to: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=f3kv0AiWNbv68LeKn1hsglF0Wmdg9GUXlOxnUzosnJE=; b=1Y3jQ8OtUy1BzZ6aMZOd8GtTDjO5qg9IFlggqVA4rKJsXb0vV9+Bbv5EoIr+0SUymPvHwF 7X/IPap+IsNs/uCw== Received: from quack3.suse.cz (unknown [10.163.28.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D008EA3B9E; Fri, 18 Mar 2022 13:16:06 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id E0483A0615; Fri, 18 Mar 2022 14:16:00 +0100 (CET) Date: Fri, 18 Mar 2022 14:16:00 +0100 From: Jan Kara To: Matthew Wilcox Cc: Linus Torvalds , Brian Foster , Linux-MM , linux-fsdevel , linux-xfs , Hugh Dickins , Namjae Jeon , Ashish Sangwan , Theodore Ts'o , Jan Kara , linux-ext4@vger.kernel.org Subject: Re: writeback completion soft lockup BUG in folio_wake_bit() Message-ID: <20220318131600.iv7ct2m4o52plkhl@quack3.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 17-03-22 21:16:20, Matthew Wilcox wrote: > On Thu, Mar 17, 2022 at 12:26:35PM -0700, Linus Torvalds wrote: > > 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. > > I found the commit: 1c8349a17137 ("ext4: fix data integrity sync in > ordered mode"). Fortunately, we have a documented test for this, > generic/127, so we'll know if we've broken it. I agree with Dave that 'keep_towrite' thing is kind of self-inflicted damage on the ext4 side (we need to write out some blocks underlying the page but cannot write all from the transaction commit code, so we need to keep xarray tags intact so that data integrity sync cannot miss the page). Also it is no longer needed in the current default ext4 setup. But if you have blocksize < pagesize and mount the fs with 'dioreadlock,data=ordered' mount options, the hack is still needed AFAIK and we don't have a reasonable way around it. Honza -- Jan Kara SUSE Labs, CR