Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3996211rdb; Thu, 14 Sep 2023 08:46:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFXxYrXi2ZEExns/hTFSXvWRXZoTjo5HBG+2SFi0A5laeCNj885LnIxyWYVy3cvnFXH1fT X-Received: by 2002:a17:902:988f:b0:1c3:c687:478c with SMTP id s15-20020a170902988f00b001c3c687478cmr6463007plp.8.1694706414178; Thu, 14 Sep 2023 08:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694706414; cv=none; d=google.com; s=arc-20160816; b=YrtxUDKj98igRCBoZUOd+kFXZkcJPPwaxw+frT7fwr/kegFqiYxZOkG6Rq/FSsiS11 504qPW+I1/D8YwUpbQRMGilCcaVIyMSxpmxHtifEqge+qURnMYOhUvEEijpIO14JVzBO 8C0wY03wx2r5UFUk/aWfdKegwnFhghJug/04WdXGGqN2cnKXzRVuFQgdgm+oPoL4DqV/ sUGOxHwLajy8Vb2yVl5m5DvxoJKGZOOKWWygLvq7UuHCn04JdQufw7DKYF/93EGv1Rc4 pqLB8sje+JzWJS9kfd3pzW3Tts5USbHsGGQ+e3y6zs6IN8IPK5LY2Y2opT3IsajjTMxP Y3XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=A7q48jtCBMGEZ5OKO+Z/fS2sy4IWYeVg+HSunn4WKPQ=; fh=ZHaU99AobqAkGSqaZAPXCL811IZTQ1dKfSH6gTR/fQ0=; b=zqyofsg7U/iII2rTiez8XJwCiYEaa/Ix8IqCyOMhfjBeqw9KWs+V7RjCszHoxf+DCt CVh8WTP9uoonkwWFK2YK7D8SrI0ljUK/ujfgLFkpuJcBEaY5rVOLLT1TqHPuYLOoi4yL D7TdW+Yo/uTATJv7hlgd/9pl63MNInpFrR9pOXC9dCp0WZtaH0hvC89DNTdM2379g6iE qLhOgh9Sn6oTyZ8VmEhj3rmi2qqO0rUFxRgNufD3G2Zx0RiEooNOuhQ/zvaSE/h7faYG wKcvuv5e8bVH2NGgghHqzG+MufpKIkJaB/j6g5WbM/2fb8Cc7+t2JW0UsrNM/CMu59dS gdXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=sGXajjx8; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id lh16-20020a170903291000b001bdf6eb05f2si1754753plb.227.2023.09.14.08.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 08:46:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=sGXajjx8; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D854F81BDA62; Wed, 13 Sep 2023 23:59:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbjING7A (ORCPT + 99 others); Thu, 14 Sep 2023 02:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjING67 (ORCPT ); Thu, 14 Sep 2023 02:58:59 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A3CFCD8; Wed, 13 Sep 2023 23:58:55 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2DF4F1F74A; Thu, 14 Sep 2023 06:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1694674734; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A7q48jtCBMGEZ5OKO+Z/fS2sy4IWYeVg+HSunn4WKPQ=; b=sGXajjx8Ei20o1HBZchoVJsXyBKgREy5z1/sPz6FnkqZp3HtFm0XJXC+adjreHN4i/Aaty cX7yp0J0ltH7OkVnkwqaI4jLwm2hr4YVoUOkAfMaRuYL2wzhxxSAVAOiiXDAAneWtVSbAB CQzX7ksz+6UX32bTGIsCDmg0Y7CwauQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1694674734; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A7q48jtCBMGEZ5OKO+Z/fS2sy4IWYeVg+HSunn4WKPQ=; b=W/z5EcJSOhmW6iwyyWIGwsd4x6jOgHTYp7vQhPBs9PktK4ckHALyl1/sxYNZPzA08gxekA Ot36dJsEX8reXFCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1F8A7139DB; Thu, 14 Sep 2023 06:58:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4f+kBy6vAmVLegAAMHmgww (envelope-from ); Thu, 14 Sep 2023 06:58:54 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id A6B70A07C2; Thu, 14 Sep 2023 08:58:53 +0200 (CEST) Date: Thu, 14 Sep 2023 08:58:53 +0200 From: Jan Kara To: =?utf-8?B?6YOt57qv5rW3?= Cc: Jan Kara , "chao@kernel.org" , "jaegeuk@kernel.org" , "brauner@kernel.org" , "viro@zeniv.linux.org.uk" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0hdIGZzLXdyaXRlYmFjazogd3JpdGVi?= =?utf-8?Q?ack=5Fsb=5Finodes?= =?utf-8?Q?=3A?= Do not increase 'total_wrote' when nothing is written Message-ID: <20230914065853.qmvkymchyamx43k5@quack3> References: <20230913131501.478516-1-guochunhai@vivo.com> <20230913151651.gzmyjvqwan3euhwi@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Sep 2023 23:59:02 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email On Thu 14-09-23 04:12:31, 郭纯海 wrote: > > On Wed 13-09-23 07:15:01, Chunhai Guo wrote: > > > From the dump info, there are only two pages as shown below. One is > > > updated and another is under writeback. Maybe f2fs counts the > > > writeback page as a dirty one, so get_dirty_pages() got one. As you > > > said, maybe this is unreasonable. > > > > > > Jaegeuk & Chao, what do you think of this? > > > > > > > > > crash_32> files -p 0xE5A44678 > > > INODE NRPAGES > > > e5a44678 2 > > > > > > PAGE PHYSICAL MAPPING INDEX CNT FLAGS > > > e8d0e338 641de000 e5a44810 0 5 a095 > > locked,waiters,uptodate,lru,private,writeback > > > e8ad59a0 54528000 e5a44810 1 2 2036 > > referenced,uptodate,lru,active,private > > > > Indeed, incrementing pages_skipped when there's no dirty page is a bit odd. > > That being said we could also harden requeue_inode() - in particular we could do > > there: > > > > if (wbc->pages_skipped) { > > /* > > * Writeback is not making progress due to locked buffers. > > * Skip this inode for now. Although having skipped pages > > * is odd for clean inodes, it can happen for some > > * filesystems so handle that gracefully. > > */ > > if (inode->i_state & I_DIRTY_ALL) > > redirty_tail_locked(inode, wb); > > else > > inode_cgwb_move_to_attached(inode, wb); > > } > > > > Does this fix your problem as well? > > > > Honza > > Thank you for your reply. Did you forget the 'return' statement? Since I encountered this issue on the 4.19 kernel and there is not inode_cgwb_move_to_attached() yet, I replaced it with inode_io_list_del_locked(). So, below is the test patch I am applying. Please have a check. By the way, the test will take some time. I will provide feedback when it is finished. Thanks. Yeah, I forgot about the return. > if (wbc->pages_skipped) { > /* > * writeback is not making progress due to locked > * buffers. Skip this inode for now. > */ > - redirty_tail_locked(inode, wb); > + if (inode->i_state & I_DIRTY_ALL) > + redirty_tail_locked(inode, wb); > + else > + inode_io_list_del_locked(inode, wb); > return; > } Looks good. Thanks for testing! Honza -- Jan Kara SUSE Labs, CR