Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp69872rdb; Tue, 19 Dec 2023 09:33:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIXe6Tgg6mNitdDfISlHIsHcC50JcPRrlSOGis4qNs1fZl0QTuw+Eoi+Q40OZeIshCTjTQ X-Received: by 2002:a05:6102:5716:b0:466:b142:7992 with SMTP id dg22-20020a056102571600b00466b1427992mr1002784vsb.11.1703007219968; Tue, 19 Dec 2023 09:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703007219; cv=none; d=google.com; s=arc-20160816; b=GPO1A5O3I3BBl0VxsJ5fzhwIHs5PXl3+G3Uq7Kmwd+SFV3on8iKEfWDYZ3EtT6fii9 2NO3/DDgerUWzNjZGLQORZyUXOAl13gt7JStUK0BoctIzgjgEea6hp6LALkLznySguyF Fz5EcEqaioG7pJcFXfbm9SMiANQouEIV0Z1NehsepN98OtJSctLNty8XzvRZcIuXgApu es2BazJxZ5D4UDdp5xRlr0O1JmL1Fce4KCYzD2d/goWjw62hm8hHHD+OLk7yVw8e1z9W wpu9Cj2TVoUTCcEH9N5tfvid9vml1m0Ey3WNgtwjy57pGd76cLtqK9x4PvDIKwrxAUS4 2hjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=3dL7h8ceV7aXiO27Scimg+YoS9afC6qEOpXAa9fm794=; fh=i6rGHk/clC1f9Y4mpJyYVOWW6p98QflrI/jjeassMJc=; b=e7Q9Bdkh7TsV0Mha/yc/VvdBg1X7fYi8XLV7QVElRxRIdNmgQbSnNlmkHQKmD58hb8 5r+2rpXGOeXAC3PNwY5VeoQc/p1XLynkfJTc4WjbmrJpOOD9wxT7HQdYNxP9IsQNEKJh 6wG9R3MhPw2zL9lZi3UA9wWs5pV41M1PgZ9Z8y1bBp+3J5dAQPsB7e4TsqMndk71b6If x/fEayR+NMHd5XtVO/7gtn1XaxBnSg01XGDB3ARYG0/JXzTMdPeLjw8utSiV2TAHiJSp ysg5RW3s5ffkJHe7mhx2YDqqLT9G4IdF7iSqNWXfSKvo6MWQiv9rLJLkech9y3sW6AFH UIWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=JJtCW6a8; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=JJtCW6a8; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-5695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5695-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t25-20020a67ad19000000b004669a609159si886650vsl.397.2023.12.19.09.33.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:33:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=JJtCW6a8; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=JJtCW6a8; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-5695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5695-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A22E41C2167E for ; Tue, 19 Dec 2023 17:33:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60C1B37876; Tue, 19 Dec 2023 17:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="JJtCW6a8"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="5IB12f7P"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="JJtCW6a8"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="5IB12f7P" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB1BF374CF; Tue, 19 Dec 2023 17:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C509921E99; Tue, 19 Dec 2023 17:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1703007209; 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=3dL7h8ceV7aXiO27Scimg+YoS9afC6qEOpXAa9fm794=; b=JJtCW6a8tG0oX5QaOWF3s38dZD9xtqLQjTHPXsicLVMtYhK9LFoSINWPxWdM7Ri4OCgTtL kdomvY9IuAnrDmOOzP5tj+Eio/HKEwnHF2LAFVdpFVxj2U2mlkmFaN/4W/pPMz1+pq/q+K h7ZFM/eLFSz9pMglmpOVBTvkqRdelvk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1703007209; 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=3dL7h8ceV7aXiO27Scimg+YoS9afC6qEOpXAa9fm794=; b=5IB12f7Pqb/iD32Pjj++IGNtIH3KhdJ/RDFA8nNOnZpPJmZtJck+fn+fIAl5xsvxE67JcC VRxiEfIISuBoajBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1703007209; 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=3dL7h8ceV7aXiO27Scimg+YoS9afC6qEOpXAa9fm794=; b=JJtCW6a8tG0oX5QaOWF3s38dZD9xtqLQjTHPXsicLVMtYhK9LFoSINWPxWdM7Ri4OCgTtL kdomvY9IuAnrDmOOzP5tj+Eio/HKEwnHF2LAFVdpFVxj2U2mlkmFaN/4W/pPMz1+pq/q+K h7ZFM/eLFSz9pMglmpOVBTvkqRdelvk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1703007209; 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=3dL7h8ceV7aXiO27Scimg+YoS9afC6qEOpXAa9fm794=; b=5IB12f7Pqb/iD32Pjj++IGNtIH3KhdJ/RDFA8nNOnZpPJmZtJck+fn+fIAl5xsvxE67JcC VRxiEfIISuBoajBw== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id B46CC13B9B; Tue, 19 Dec 2023 17:33:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id L9pfK+nTgWXpIAAAn2gu4w (envelope-from ); Tue, 19 Dec 2023 17:33:29 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 64E84A07E0; Tue, 19 Dec 2023 18:33:29 +0100 (CET) Date: Tue, 19 Dec 2023 18:33:29 +0100 From: Jan Kara To: Christoph Hellwig Cc: linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Jan Kara , David Howells , Brian Foster , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/17] writeback: fix done_index when hitting the wbc->nr_to_write Message-ID: <20231219173329.wp6v4y5637wavnba@quack3> References: <20231218153553.807799-1-hch@lst.de> <20231218153553.807799-2-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218153553.807799-2-hch@lst.de> X-Spam-Level: X-Spam-Level: X-Spamd-Result: default: False [-2.17 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[8]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.cz:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.57)[98.10%] Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: -2.17 X-Spam-Flag: NO On Mon 18-12-23 16:35:37, Christoph Hellwig wrote: > When write_cache_pages finishes writing out a folio, it fails to update > done_inde to account for the number of pages in the folio just written. ^^^ done_index > That means when range_cyclic writeback is restarted, it will be > restarted at this folio instead of after it as it should. Fix that > by updating done_index before breaking out of the loop. > > Signed-off-by: Christoph Hellwig Otherwise looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > mm/page-writeback.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index ee2fd6a6af4072..b13ea243edb6b2 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -2505,6 +2505,7 @@ int write_cache_pages(struct address_space *mapping, > * keep going until we have written all the pages > * we tagged for writeback prior to entering this loop. > */ > + done_index = folio->index + nr; > wbc->nr_to_write -= nr; > if (wbc->nr_to_write <= 0 && > wbc->sync_mode == WB_SYNC_NONE) { > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR