Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp649832lqp; Thu, 21 Mar 2024 11:13:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkBvDDFsFyir8M46PxKc2CXaqGafVU4PTyw1s7lEJPn5pHN4HXc+xWe9pysU3B34N7cYulbNVv7igsTjoPtExJS0I8JBN6S6yqHfDObg== X-Google-Smtp-Source: AGHT+IF03gzCRBCTS5GE1kKO0NxsKbcPzrmci50LhhZZR3ZZexUCR+Z7p/H4YvW251aTD5wpNiO/ X-Received: by 2002:a05:6a21:3392:b0:1a3:1246:c43e with SMTP id yy18-20020a056a21339200b001a31246c43emr363184pzb.28.1711044811892; Thu, 21 Mar 2024 11:13:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711044811; cv=pass; d=google.com; s=arc-20160816; b=qeM8zbGKJMPJ/m+IpZz9awBs5x8iAbIQGBjZ+Dp4eeekUGGZsrpRP6/lgPaRb22lOj m/3BWUQmJreAAv/PbRKJrPr1H+dijHzaDGEyTXLFhuAenWCs49hdk9jmQGkWElCxbKcy ek6iCmtBgoR++Lb7576VytH+Kjkb4EzV+MhKeZjlcg3HYxFv88JZv/Pj83IiWz3q3yqw 2LYhlL/ao8c/JpVwhHP+c78Tns6MIaAIyIOW9eRvruTK8ytgWAg8LOEkdd6rJ1we+pH+ Ou11gzOh2XhXH+Zobe/+RbAIJ0AB+I8EjbAE4C/LsqHe/gqjWGWWPYphTHkgMdYzLUYO Jd7A== ARC-Message-Signature: i=2; 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=Er0BQY9yyhShKISjQxXgJJ4fPACRuENnuK7t6pwKzT4=; fh=QZbuo9LbZfX7qKGQ9k7yzTx288isnuGa6Nf6oKQngvw=; b=tmpPY7qkdrsGLvdxsx3XdZAjkuuc4AZOi/PR5jdn9d0ngHDM7bLTGQe1Lv5dOsZhKy m2Xf/HlI6ICwDFrP7cvO9PHfn6naoExnVUUW71TQ+oMs4thusYYtvDrIZ1jU1HZEYQDc GtMvKTi1Xgpqx3lO2LEDh6L+Cpd5q1B0FgTOB4udgvJV37j9IBmdwo8MXQfmawRzLT/H o+TUjUlPfE9WhloUBQkCKDh1z+ZzY+Nr8MfyeR0MsVD77FsnYHpyOAK2bOHIPLXJcow4 jtLNKFTm2x+JcO6Z9K4Kvue9t/lNRcj6MrMhutZYm1wrwJ+1Iau+737AzIkUcchSxip1 lX8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=qSTXFzpH; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=jyrZiQTK; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=qSTXFzpH; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-110539-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110539-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y10-20020a63494a000000b005dcbda499c9si239747pgk.261.2024.03.21.11.13.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 11:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110539-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=qSTXFzpH; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=jyrZiQTK; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=qSTXFzpH; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-110539-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110539-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id ECA51286F08 for ; Thu, 21 Mar 2024 18:07:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69AD3133406; Thu, 21 Mar 2024 18:07:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="qSTXFzpH"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="jyrZiQTK"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="qSTXFzpH"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="jyrZiQTK" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 833311332AD; Thu, 21 Mar 2024 18:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711044428; cv=none; b=VXuR9U4HVodBJEenByiiYAmq6UT+vwYpkWm+Mc1oeFYJBYwZ70N8K9qAMKeFBw19akDpsOwEGAPUrfrTteV9l4odp4vK0fdIlmqeKjZOLnflpDHYyjM7KveM00/ICddpO1IYGGt7mjVXGZQDnIly6bu4B/a6nha9/Fp57LZEDfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711044428; c=relaxed/simple; bh=FwyV5G5T8xNWHin0iIxpU0FjYvWou7GfBsp3wgr/t4c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rmim6XYy+fyUDDINfrTCjq2yPLHWkJ7Gy+YEt83sjLBZvDn1OewMgCj51vOVXZmcBoTc+tL+etVHEuljBEypdsTAtKIlfEV0yWnZuS8luR+k98D7+A5jg+fyIcnLLtpouJsdC4QZeItq108LanRTGEKtoY6+y+Anxp84KtHS0Cw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=qSTXFzpH; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=jyrZiQTK; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=qSTXFzpH; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=jyrZiQTK; arc=none smtp.client-ip=195.135.223.131 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 imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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-out2.suse.de (Postfix) with ESMTPS id A5EA35D2A6; Thu, 21 Mar 2024 18:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1711044424; 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=Er0BQY9yyhShKISjQxXgJJ4fPACRuENnuK7t6pwKzT4=; b=qSTXFzpHwuoVCvOZ3GNS+UgUHoMukzlTJ1tfGZc9Jr7tJURCmH13hi3dn0E7x5zdcIphWo qE0h5rGLe4h4RhuHex8TtU2gAEUO3Wa444zNqNphBj4BbfFOpbQYGSna8jPdk4+pzaKzR7 O0Bny7FMVslcvK0cQBh18/xXp7z+ffU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1711044424; 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=Er0BQY9yyhShKISjQxXgJJ4fPACRuENnuK7t6pwKzT4=; b=jyrZiQTKOf1qUFHF6itTgEhgh9ek+6yvFInS0FE2apXbvmFgIRXstV9T5cToIhWeLvF5YV m7lzsrlNrV0o78AA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1711044424; 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=Er0BQY9yyhShKISjQxXgJJ4fPACRuENnuK7t6pwKzT4=; b=qSTXFzpHwuoVCvOZ3GNS+UgUHoMukzlTJ1tfGZc9Jr7tJURCmH13hi3dn0E7x5zdcIphWo qE0h5rGLe4h4RhuHex8TtU2gAEUO3Wa444zNqNphBj4BbfFOpbQYGSna8jPdk4+pzaKzR7 O0Bny7FMVslcvK0cQBh18/xXp7z+ffU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1711044424; 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=Er0BQY9yyhShKISjQxXgJJ4fPACRuENnuK7t6pwKzT4=; b=jyrZiQTKOf1qUFHF6itTgEhgh9ek+6yvFInS0FE2apXbvmFgIRXstV9T5cToIhWeLvF5YV m7lzsrlNrV0o78AA== 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 9B7D5138A1; Thu, 21 Mar 2024 18:07:04 +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 rgb8JUh3/GXaOQAAD6G6ig (envelope-from ); Thu, 21 Mar 2024 18:07:04 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 422C6A0806; Thu, 21 Mar 2024 19:07:04 +0100 (CET) Date: Thu, 21 Mar 2024 19:07:04 +0100 From: Jan Kara To: Kemeng Shi Cc: Jan Kara , akpm@linux-foundation.org, tj@kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org, bfoster@redhat.com, dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com, peterz@infradead.org Subject: Re: [PATCH 0/6] Improve visibility of writeback Message-ID: <20240321180704.lqmtdmd5tzsbuyyu@quack3> References: <20240320110222.6564-1-shikemeng@huaweicloud.com> <20240320172240.7buswiv7zj2m5odg@quack3> <44e3b910-8b52-5583-f8a9-37105bf5e5b6@huaweicloud.com> 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: <44e3b910-8b52-5583-f8a9-37105bf5e5b6@huaweicloud.com> X-Spam-Score: 4.30 X-Spamd-Result: default: False [4.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(5.10)[100.00%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[13]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[suse.cz,linux-foundation.org,kernel.org,kvack.org,vger.kernel.org,infradead.org,redhat.com,suse.com,gmail.com]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: **** Authentication-Results: smtp-out2.suse.de; none X-Spam-Flag: NO On Thu 21-03-24 16:12:52, Kemeng Shi wrote: > on 3/21/2024 1:22 AM, Jan Kara wrote: > > On Wed 20-03-24 19:02:16, Kemeng Shi wrote: > >> This series tries to improve visilibity of writeback. Patch 1 make > >> /sys/kernel/debug/bdi/xxx/stats show writeback info of whole bdi > >> instead of only writeback info in root cgroup. Patch 2 add a new > >> debug file /sys/kernel/debug/bdi/xxx/wb_stats to show per wb writeback > >> info. Patch 4 add wb_monitor.py to monitor basic writeback info > >> of running system, more info could be added on demand. Rest patches > >> are some random cleanups. More details can be found in respective > >> patches. Thanks! > >> > >> Following domain hierarchy is tested: > >> global domain (320G) > >> / \ > >> cgroup domain1(10G) cgroup domain2(10G) > >> | | > >> bdi wb1 wb2 > >> > >> /* all writeback info of bdi is successfully collected */ > >> # cat /sys/kernel/debug/bdi/252:16/stats: > >> BdiWriteback: 448 kB > >> BdiReclaimable: 1303904 kB > >> BdiDirtyThresh: 189914124 kB > >> DirtyThresh: 195337564 kB > >> BackgroundThresh: 32516508 kB > >> BdiDirtied: 3591392 kB > >> BdiWritten: 2287488 kB > >> BdiWriteBandwidth: 322248 kBps > >> b_dirty: 0 > >> b_io: 0 > >> b_more_io: 2 > >> b_dirty_time: 0 > >> bdi_list: 1 > >> state: 1 > >> > >> /* per wb writeback info is collected */ > >> # cat /sys/kernel/debug/bdi/252:16/wb_stats: > >> cat wb_stats > >> WbCgIno: 1 > >> WbWriteback: 0 kB > >> WbReclaimable: 0 kB > >> WbDirtyThresh: 0 kB > >> WbDirtied: 0 kB > >> WbWritten: 0 kB > >> WbWriteBandwidth: 102400 kBps > >> b_dirty: 0 > >> b_io: 0 > >> b_more_io: 0 > >> b_dirty_time: 0 > >> state: 1 > >> WbCgIno: 4284 > >> WbWriteback: 448 kB > >> WbReclaimable: 818944 kB > >> WbDirtyThresh: 3096524 kB > >> WbDirtied: 2266880 kB > >> WbWritten: 1447936 kB > >> WbWriteBandwidth: 214036 kBps > >> b_dirty: 0 > >> b_io: 0 > >> b_more_io: 1 > >> b_dirty_time: 0 > >> state: 5 > >> WbCgIno: 4325 > >> WbWriteback: 224 kB > >> WbReclaimable: 819392 kB > >> WbDirtyThresh: 2920088 kB > >> WbDirtied: 2551808 kB > >> WbWritten: 1732416 kB > >> WbWriteBandwidth: 201832 kBps > >> b_dirty: 0 > >> b_io: 0 > >> b_more_io: 1 > >> b_dirty_time: 0 > >> state: 5 > >> > >> /* monitor writeback info */ > >> # ./wb_monitor.py 252:16 -c > >> writeback reclaimable dirtied written avg_bw > >> 252:16_1 0 0 0 0 102400 > >> 252:16_4284 672 820064 9230368 8410304 685612 > >> 252:16_4325 896 819840 10491264 9671648 652348 > >> 252:16 1568 1639904 19721632 18081952 1440360 > >> > >> > >> writeback reclaimable dirtied written avg_bw > >> 252:16_1 0 0 0 0 102400 > >> 252:16_4284 672 820064 9230368 8410304 685612 > >> 252:16_4325 896 819840 10491264 9671648 652348 > >> 252:16 1568 1639904 19721632 18081952 1440360 > >> ... > > > > So I'm wondering: Are you implementing this just because this looks > > interesting or do you have a real need for the functionality? Why? > Hi Jan, I added debug files to test change in [1] which changes the way how > dirty background threshold of wb is calculated. Without debug files, we could > only monitor writeback to imply that threshold is corrected. > In current patchset, debug info has not included dirty background threshold yet, > I will add it when discution of calculation of dirty background threshold in [1] > is done. > The wb_monitor.py is suggested by Tejun in [2] to improve visibility of writeback. > The script is more convenient than trace to monitor writeback behavior of the running > system. Thanks for the pointer. OK, I agree this is useful so let's have a look into the code :) Honza -- Jan Kara SUSE Labs, CR