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 60BC5C8303C for ; Mon, 7 Jul 2025 15:47:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC9888D000C; Mon, 7 Jul 2025 11:47:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA1588D0002; Mon, 7 Jul 2025 11:47:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB7728D000C; Mon, 7 Jul 2025 11:47:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B849A8D0002 for ; Mon, 7 Jul 2025 11:47:16 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8BF7010A0B7 for ; Mon, 7 Jul 2025 15:47:16 +0000 (UTC) X-FDA: 83637897672.03.6911F9D Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf26.hostedemail.com (Postfix) with ESMTP id 62B2C140005 for ; Mon, 7 Jul 2025 15:47:14 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=AuKRCJ50; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=bl9Jb3rM; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=AuKRCJ50; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=bl9Jb3rM; spf=pass (imf26.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751903234; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gX29DBgo8xdocmIqtM7JRV4LqGxqs58F+qWxznSEpTI=; b=N+sEy8ITf24AiaiWssPsLemDTzlzNen46S+0JtbgJwhEyqwcg5vh95aKhPQ2v1uTXsEK/t ShTrNtX4cJas7f91JQnPqdNf0rTvBRawyypiibdG+PFps903QDjiYrK1db51tpczhB92CS 9XtzafNs14hnqfMU2rZXLwQtBXQW/JM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=AuKRCJ50; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=bl9Jb3rM; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=AuKRCJ50; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=bl9Jb3rM; spf=pass (imf26.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751903234; a=rsa-sha256; cv=none; b=LCo2eekU+5HIeQpZtgXj0Y7gW9+IgcbvmvaJlQK7m1F5VWCCd7Tgdbrf+OUaKEmHQT6xOg p6rn/pcdBhLZtRlirc4ZFBG9GqHamoRtYeQhLFTgdey9lFWjOMTNwfg7nRzN6VGAFv+qK5 q6G1Wbtkbg6Dm30XWrACEwqO/5prCtw= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 B320C210ED; Mon, 7 Jul 2025 15:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1751903232; 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=gX29DBgo8xdocmIqtM7JRV4LqGxqs58F+qWxznSEpTI=; b=AuKRCJ50I5YGo3CF6bKoWnI8xfVLLSEFDTOa2wcmGEz3gGkUAYCA6QKmVnMQJPMkmuqMYA GkvbxkNeN3rTX5LKtZ3lOYE7qeCtb9GhoIlxqPReTJPZJNMDtvWeQhpD0QiTn10iQqBtXS ZL/sRomz/ur+E7611UUOibV4KWMKdTw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1751903232; 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=gX29DBgo8xdocmIqtM7JRV4LqGxqs58F+qWxznSEpTI=; b=bl9Jb3rMuMHLDaHY4T56CexJ/SfS04eXPV7nQwoip8NbuRgVfOSomJ32DHtrI6VYOc+uyc sRzwdXzdoOWT3yDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1751903232; 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=gX29DBgo8xdocmIqtM7JRV4LqGxqs58F+qWxznSEpTI=; b=AuKRCJ50I5YGo3CF6bKoWnI8xfVLLSEFDTOa2wcmGEz3gGkUAYCA6QKmVnMQJPMkmuqMYA GkvbxkNeN3rTX5LKtZ3lOYE7qeCtb9GhoIlxqPReTJPZJNMDtvWeQhpD0QiTn10iQqBtXS ZL/sRomz/ur+E7611UUOibV4KWMKdTw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1751903232; 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=gX29DBgo8xdocmIqtM7JRV4LqGxqs58F+qWxznSEpTI=; b=bl9Jb3rMuMHLDaHY4T56CexJ/SfS04eXPV7nQwoip8NbuRgVfOSomJ32DHtrI6VYOc+uyc sRzwdXzdoOWT3yDg== Received: from imap1.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 637A013A5E; Mon, 7 Jul 2025 15:47:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qxg/GADsa2hzSQAAD6G6ig (envelope-from ); Mon, 07 Jul 2025 15:47:12 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 91FEEA098E; Mon, 7 Jul 2025 17:47:11 +0200 (CEST) Date: Mon, 7 Jul 2025 17:47:11 +0200 From: Jan Kara To: Christoph Hellwig Cc: "Darrick J. Wong" , Kundan Kumar , Andrew Morton , Kundan Kumar , jaegeuk@kernel.org, chao@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, miklos@szeredi.hu, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, willy@infradead.org, mcgrof@kernel.org, clm@meta.com, david@fromorbit.com, amir73il@gmail.com, axboe@kernel.dk, ritesh.list@gmail.com, dave@stgolabs.net, p.raghav@samsung.com, da.gomez@samsung.com, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, linux-mm@kvack.org, gost.dev@samsung.com Subject: Re: [PATCH 00/13] Parallelizing filesystem writeback Message-ID: References: <20250529111504.89912-1-kundan.kumar@samsung.com> <20250529203708.9afe27783b218ad2d2babb0c@linux-foundation.org> <20250702184312.GC9991@frogsfrogsfrogs> <20250703130500.GA23864@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250703130500.GA23864@lst.de> X-Rspamd-Action: no action X-Rspamd-Queue-Id: 62B2C140005 X-Stat-Signature: 3u6r4dfwk8aftc3mwjaes1ma7mgo7r61 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1751903234-473506 X-HE-Meta: U2FsdGVkX18TVqtCn4W8LRpLpjgjJKXRkFJCXJObwoBwcfKolr5wOhjXxYc2IxuGlKXqCfFsBTL5imNH2JnvQgEzpaAELuPXAL406ux/wuuIWBsecc4xs0PBmdrWu136LIvAhPvilAc/FW9dRIq0edshNfokXQ4liCA5FHv8fvVMU3xg4i6SushoJoVxI+FwvdarZElSL8/sriDT92sfrUg1FofM69guhnWyO1l8vLR0aocY6lOLkz0RE2vR3r3VT/bC/ADNCTQhqODqtEuEQZhOzCjAAsfXV6QRB7q3PlLBt6nVuqaWuvPuCt9pl0dcIo8g6gsGF0/V/lQLMbn0Sw4gYyjRsQ8HszAL9V86w11Cb4jt/7UwqktozfoPwbpz2DY9O4yLVLRl/GOPm0Dw0N8xdq4KBF1WPKE//mJxMdVYhZvzFmyhjdaKQBrM+m21DOwdNi476nLcHwHh1KWyeqAFZHTFygjt2tLJtTbuMZjkMiDYykR6Dmbpo5+GxV6MdLTH0q9PPmx8rLQGug7VFV4A0ff1D835vxZzqLpuoVLQboHgE7fS4w4XcTn7C5EIxDsOvg7LPXaoI0eEocC1ohZvNYMBX4Bf09ueDILQdAAg2x1FmVtMX9Tbc1SmpjHNWR6ITprVusmrIGuk7gzBjIfNN8qaxN6Rb4Um1V1Nj5Z+tRpl+fsb1o3biy8fC1F2ycsa7afovW1XPmJzeg1mSagQCKKhAVHZpyyXoy5uQQD1OsBDCsKP/woYzXI00rgtpasS52MGL1c8rcxtQ7hmMIBz9CUcPmkHtM8u5dGoZsirIANP7XVh6jLch6t8T0StUF+F8i3XcLnUD+CmbQtydaRL91kpHdKEZtCSBlzNC4TAAXq6pY4Sb+wOgOUpOUp294ORb0yDUjQthwv7L2QeBjMgZES4kd1X1P9s04bVeB7WqL/rZUw9kwdkA7qVHPBd2MzP/gzmFwRirCHA0zO 3P9mgkpy pPOivnEo+qMvrhMEQL/2P6ThjPTsSYSY5RxAE 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: List-Subscribe: List-Unsubscribe: On Thu 03-07-25 15:05:00, Christoph Hellwig wrote: > On Wed, Jul 02, 2025 at 11:43:12AM -0700, Darrick J. Wong wrote: > > > On a spinning disk, random IO bandwidth remains unchanged, while sequential > > > IO performance declines. However, setting nr_wb_ctx = 1 via configurable > > > writeback(planned in next version) eliminates the decline. > > > > > > echo 1 > /sys/class/bdi/8:16/nwritebacks > > > > > > We can fetch the device queue's rotational property and allocate BDI with > > > nr_wb_ctx = 1 for rotational disks. Hope this is a viable solution for > > > spinning disks? > > > > Sounds good to me, spinning rust isn't known for iops. > > > > Though: What about a raid0 of spinning rust? Do you see the same > > declines for sequential IO? > > Well, even for a raid0 multiple I/O streams will degrade performance > on a disk. Of course many real life workloads will have multiple > I/O streams anyway. > > I think the important part is to have: > > a) sane defaults > b) an easy way for the file system and/or user to override the default > > For a) a single thread for rotational is a good default. For file system > that driver multiple spindles independently or do compression multiple > threads might still make sense. > > For b) one big issue is that right now the whole writeback handling is > per-bdi and not per superblock. So maybe the first step needs to be > to move the writeback to the superblock instead of bdi? If someone > uses partitions and multiple file systems on spinning rusts these > days reducing the number of writeback threads isn't really going to > save their day either. We have had requests to move writeback infrastructure to be per sb in the past, mostly so that the filesystem has a better control of the writeback process (e.g. selection of inodes etc.). After some thought I tend to agree that today setups where we have multiple filesystems over the same bdi and end up doing writeback from several of them in parallel should be mostly limited to desktops / laptops / small servers. And there you usually have only one main data filesystem - e.g. /home/ - and you don't tend to write that much to your / filesystem. Although there could be exceptions like large occasional writes to /tmp, news server updates or similar. Anyway in these cases I'd expect IO scheduler (BFQ for rotational disks where this really matters) to still achieve a decent IO locality but it would be good to verify what the impact is. Honza -- Jan Kara SUSE Labs, CR