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 293A9D0BB63 for ; Thu, 24 Oct 2024 06:20:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2A6F6B0082; Thu, 24 Oct 2024 02:20:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD9E06B0083; Thu, 24 Oct 2024 02:20:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC8176B0085; Thu, 24 Oct 2024 02:20:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9F3EB6B0082 for ; Thu, 24 Oct 2024 02:20:46 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C70971A112D for ; Thu, 24 Oct 2024 06:20:13 +0000 (UTC) X-FDA: 82707496746.10.0C050C5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf10.hostedemail.com (Postfix) with ESMTP id 8A9D3C0019 for ; Thu, 24 Oct 2024 06:20:36 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=0MOEJToA; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729750720; a=rsa-sha256; cv=none; b=SWH2sTgunLbAPDO9nE4jdVTMcaE06YEWdNLBC8MU28o9gYNrNBkzy1KOV5hcDYnnRGjxN2 OG0xpWX+Lv6ldWT1l1G/YoT2bs1aqnyFdZohG8fLEAqPmsnUEQ7x/3miHUHJz+KDFjvDUT jDRJWoNRWSBs8PRj8FXkSgiKoMwRI84= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=0MOEJToA; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729750720; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J2AD7oBh2SUtTd8OjrVVe6s+ItUgWJ21fsEXwvPVDLs=; b=1xmhPy8bmTB8bUlFyJsyPKrSksbv8kpWalMzJBDECxWqTBnmN0dHvppgYo1q8rX/u/OA5J pF+GuIGV6uUpuEj03FoRZkg0o4r5Q3uAmVqYjk6nbUiy09muFxWa0akprZkxpDctr3u+XQ l1UrM7s3w2s/tFtM1qY+hkFvWh6Pp/k= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D250C5C5C06; Thu, 24 Oct 2024 06:20:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A8C4C4CEC7; Thu, 24 Oct 2024 06:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1729750843; bh=WW9PgPsnqcDzIffnfJD1Py5dy0Ccv98TUzLrTwmO1qA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0MOEJToANGliD0YolmgJcJXC9yn+OX9C/FndXOYO7mTiIoQTB8k6jiGeOhn5CIGHM FFarEC4V3U7At5iYGLHNvtodV0GLNTCmn+AFJ6Hpc4P+u3wOU5m7Za7w32ZhVVoQVW iCIDrMl1/z7WPHj3Fl6l1Eqta58dDmxqPpH2DxRk= Date: Wed, 23 Oct 2024 23:20:42 -0700 From: Andrew Morton To: Jim Zhao Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org Subject: Re: [PATCH] mm/page-writeback: Raise wb_thresh to prevent write blocking with strictlimit Message-Id: <20241023232042.f9373f9f826ceae2a4f4da35@linux-foundation.org> In-Reply-To: <20241024060954.443574-1-jimzhao.ai@gmail.com> References: <20241023162447.2bf480b4ce590fdeb8b6c52d@linux-foundation.org> <20241024060954.443574-1-jimzhao.ai@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8A9D3C0019 X-Stat-Signature: a9x3cnrynq5njpjc7qodfckptbswsgta X-Rspam-User: X-HE-Tag: 1729750836-724790 X-HE-Meta: U2FsdGVkX18gXv+M+Wl6eqwgdN6wfw3EwwL12mpDyxvZ61VYu9L5lnxRn2e8I/NywqgLjRny753/tEEb/UXE+9NsM/1wGd8QrP2eAY+++PS3haZuzN+qEvA1/oWIHN4tWaMmsQ5JfPCCstolB8E3Mzy4UDh3RiAG0FSyE3E4Wz8ldzkDS6MrvDiEZABrinFATeVBkruLPx3Ed0Xcq02aLraB1EEl00MNlrMEynj9ixIsmImhUfjrrUEqLrP7/5EO3o6AxI+N3WrugGJXdaKkh0zgNtmAnrVk2IxIBmTZWfZOuyyV8m+Tv73kF7EddzHFAIkdg9E90vsw8KaD6DVpRHYyY4IP3wj7Aam/oosIHD6uOfy/ZTOeGP8otsZbEinNG0DOAhYUFI+vvDjM3QPA9xhd9tF5yQVc0f3S5s5S5ukY56muLvP/FeMpSBVLm4srgLtwTIlaTNwZoNkac7RQiUHSdg+NNKOUXhAsTaqAxMYFvfo4ePjtk0BnAgo6boG6dZ0VzVg+/WLOwddEwSinw9R4Dw3UYvTy9gbTkx/X8FvocdsEvW/7gkcBgqM8O3EoF0IokabbEkjpWcOGWQJma6ONkRqk2xdObbDaupbaYSu7T2/EeS9XCssgyXpCyi83Qx2x0kVhJ4CpTHdUhU92FOUmrQ+yVc4fVeef7rNHy7zxx/Nc7cTkl/MUP2A87eKuh0siqCCGUyCM9ux8aD2g0cIfcQ/4+eksstM1e7wItosgXBfNg4oPTBh7gV2lbADGS2rbqQXZ1YsCz5OGtuJtvgTJg32QYVtsVICJuaJ1qIbGhxuuDMSVOfkG6tud+pe2SrEl+EnW4s8zYxgtPZGheJigRXhi/i8inUiMEmo8d+17w1/CLc5Da8F4ikoLfG/BcP/+q72Rn/YU23w1f3w5N18foINfhDG06cxcXo0Q9cK8wa2m8OreM9oLb0g+MOXOQurSbd6vAgGOl9gIjsX z8cXpHOL EQchrSkt/Ov9wp2vYGuldOxWDnhidXSnrncifUm+GercyY3QVwqN4YbBCbZ4RM3U9FTGNVUwbY+4x4XQ6rbEoxfRPUvQZ+dI/5dWZrgyniuslBy1m6l5jfE2CshThKTbLFqn1F/XBUT5p1gniIK5SEoHNCRqTsCPTTRMj5ra6colSs4WQ2+CtG1ZX4cnwdh9hsXuT+iZb4DVrT7dYE8s3S6NlF50IkdDPbowJho4c7ICUxK7n0AbEabY5hq6P5gpHeNiVDSiLyAXgXByhhWxI+xizdonX+01Skom2zHFuQkcF+FCVEakVAQtfLINyDOWb7u4UoJPuH2qU7e1Mshv8373u8YmRVFq4ptsUxIdhDGuMD8JNMs04xkbuDFSE702n680cnlXKFJ3u71k= 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, 24 Oct 2024 14:09:54 +0800 Jim Zhao wrote: > > On Wed, 23 Oct 2024 18:00:32 +0800 Jim Zhao wrote: > > > > With the strictlimit flag, wb_thresh acts as a hard limit in > > > balance_dirty_pages() and wb_position_ratio(). When device write > > > operations are inactive, wb_thresh can drop to 0, causing writes to > > > be blocked. The issue occasionally occurs in fuse fs, particularly > > > with network backends, the write thread is blocked frequently during > > > a period. To address it, this patch raises the minimum wb_thresh to a > > > controllable level, similar to the non-strictlimit case. > > > Please tell us more about the userspace-visible effects of this. It > > *sounds* like a serious (but occasional) problem, but that is unclear. > > > And, very much relatedly, do you feel this fix is needed in earlier > > (-stable) kernels? > > The problem exists in two scenarios: > 1. FUSE Write Transition from Inactive to Active > > sometimes, active writes require several pauses to ramp up to the appropriate wb_thresh. > As shown in the trace below, both bdi_setpoint and task_ratelimit are 0, means wb_thresh is 0. > The dd process pauses multiple times before reaching a normal state. > > dd-1206590 [003] .... 62988.324049: balance_dirty_pages: bdi 0:51: limit=295073 setpoint=259360 dirty=454 bdi_setpoint=0 bdi_dirty=32 dirty_ratelimit=18716 task_ratelimit=0 dirtied=32 dirtied_pause=32 paused=0 pause=4 period=4 think=0 cgroup_ino=1 > dd-1206590 [003] .... 62988.332063: balance_dirty_pages: bdi 0:51: limit=295073 setpoint=259453 dirty=454 bdi_setpoint=0 bdi_dirty=33 dirty_ratelimit=18716 task_ratelimit=0 dirtied=1 dirtied_pause=0 paused=0 pause=4 period=4 think=4 cgroup_ino=1 > dd-1206590 [003] .... 62988.340064: balance_dirty_pages: bdi 0:51: limit=295073 setpoint=259526 dirty=454 bdi_setpoint=0 bdi_dirty=34 dirty_ratelimit=18716 task_ratelimit=0 dirtied=1 dirtied_pause=0 paused=0 pause=4 period=4 think=4 cgroup_ino=1 > dd-1206590 [003] .... 62988.348061: balance_dirty_pages: bdi 0:51: limit=295073 setpoint=259531 dirty=489 bdi_setpoint=0 bdi_dirty=35 dirty_ratelimit=18716 task_ratelimit=0 dirtied=1 dirtied_pause=0 paused=0 pause=4 period=4 think=4 cgroup_ino=1 > dd-1206590 [003] .... 62988.356063: balance_dirty_pages: bdi 0:51: limit=295073 setpoint=259531 dirty=490 bdi_setpoint=0 bdi_dirty=36 dirty_ratelimit=18716 task_ratelimit=0 dirtied=1 dirtied_pause=0 paused=0 pause=4 period=4 think=4 cgroup_ino=1 > ... > > 2. FUSE with Unstable Network Backends and Occasional Writes > Not easy to reproduce, but when it occurs in this scenario, > it causes the write thread to experience more pauses and longer durations. Thanks, but it's still unclear how this impacts our users. How lenghty are these pauses?