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 E48B0C433EF for ; Fri, 10 Dec 2021 21:36:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62D356B0073; Fri, 10 Dec 2021 16:36:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B4A96B0074; Fri, 10 Dec 2021 16:36:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42E7B6B0075; Fri, 10 Dec 2021 16:36:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 3029D6B0073 for ; Fri, 10 Dec 2021 16:36:47 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E5EE78249980 for ; Fri, 10 Dec 2021 21:36:36 +0000 (UTC) X-FDA: 78903193992.27.252D503 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf31.hostedemail.com (Postfix) with ESMTP id 9EFA520005 for ; Fri, 10 Dec 2021 21:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=r1GOSqF9LX3YAa7tf5XoV1Dfily/re1QRyoWvPyqJ4s=; b=EWi/cCEc8iqOeu3vDyYPmNnOiW U5OPCyLe4kqUZfNOKxGP33iIzq+B+64pFZxJ8EovPawYqDFqgMVJ/KPgQnS1ykluiqHVUWvFXFrzd opabBqWqYfHw/KAc5LGWLycgw4NjkYzWU7xZB9JEtrGhPNkPNC1LPkgtR+0WbzezNU00j6doHOteH TJBNnDBYa35Sqerr8LMlKBYknUrq8eny4/e30nHDYbCh1LSnFIihEen6rLwUa0TOrncDn5WdNTrKv 65RUsHh3AJSUrL9d5LLrqZQR3wMa5pjn3+Y/uG3KtpOPYWF7lQ9KRHbBqH3bzQ5SVZp3UdG2ueAsH t0uhjq4w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvnZB-000cwL-Az; Fri, 10 Dec 2021 21:36:34 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DCFF73002C5; Fri, 10 Dec 2021 22:36:32 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CD2592C555170; Fri, 10 Dec 2021 22:36:32 +0100 (CET) Date: Fri, 10 Dec 2021 22:36:32 +0100 From: Peter Zijlstra To: Andrew Morton Cc: Matthew Wilcox , Christoph Hellwig , Manjong Lee , linux-mm@kvack.org, linux-kernel@vger.kernel.org, seunghwan.hyun@samsung.com, sookwan7.kim@samsung.com, nanich.lee@samsung.com, yt0928.kim@samsung.com, junho89.kim@samsung.com, jisoo2146.oh@samsung.com Subject: Re: [PATCH 1/1] mm: bdi: Initialize bdi_min_ratio when bdi unregister Message-ID: References: <20211021161942.5983-1-mj0123.lee@samsung.com> <20211021194530.1fabf4fa45cfe3bee6598484@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021194530.1fabf4fa45cfe3bee6598484@linux-foundation.org> Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b="EWi/cCEc"; dmarc=none; spf=none (imf31.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 9EFA520005 X-Stat-Signature: m1rufzurg3apqnhwumzg6t7ddde4ner7 X-HE-Tag: 1639172194-79224 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: On Thu, Oct 21, 2021 at 07:45:30PM -0700, Andrew Morton wrote: > On Thu, 21 Oct 2021 13:01:30 +0100 Matthew Wilcox wrote: > > > On Thu, Oct 21, 2021 at 04:16:52AM -0700, Christoph Hellwig wrote: > > > On Fri, Oct 22, 2021 at 01:19:43AM +0900, Manjong Lee wrote: > > > > Because when sdcard is removed, bdi_min_ratio value will remain. > > > > Currently, the only way to reset bdi_ min_ratio is to reboot. > > > > > > But bdis that are unregistered are never re-registered. What is > > > the problem you're trying to solve? > > > > The global bdi_min_ratio needs to be adjusted. See > > bdi_set_min_ratio() in mm/page-writeback.c. > > I added cc:stable to this and tweaked the comment & coding style a bit: Acked-by: Peter Zijlstra (Intel) > --- a/mm/backing-dev.c~mm-bdi-initialize-bdi_min_ratio-when-bdi-unregister-fix > +++ a/mm/backing-dev.c > @@ -947,10 +947,12 @@ void bdi_unregister(struct backing_dev_i > wb_shutdown(&bdi->wb); > cgwb_bdi_unregister(bdi); > > - /* if min ratio doesn't 0, it has to set 0 before unregister */ > - if (bdi->min_ratio) { > + /* > + * If this BDI's min ratio has been set, use bdi_set_min_ratio() to > + * update the global bdi_min_ratio. > + */ > + if (bdi->min_ratio) > bdi_set_min_ratio(bdi, 0); > - } > > if (bdi->dev) { > bdi_debug_unregister(bdi); > _ >