From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CACB13D289 for ; Tue, 25 Jun 2024 04:59:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719291542; cv=none; b=osD7gRObWIQsp8TgjUoC076AZeWuZRCHwlfrW6qkV3ZOdE4EZfiJlomvfqjcEP4KrC3Tzjmry5lJeGaDglqQA6JYwvRQnFEQUC+9voAaPXEjbVDT3BvVXreqxdfi7/OoxUoXJ4XSr5HwRORYJb0t+JN0/TmwTKCAXEdwPxNZQgk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719291542; c=relaxed/simple; bh=1Pnx+hP0NkZPbhq0IPQ3NJbjt5U3VcqdQKgUwRsnmzc=; h=Date:To:From:Subject:Message-Id; b=tAOJfYA5csTMXrPWpcH/GJShZJhFUdS9pTbLRVwadrUcoSB7kXzxADf0NEChKF4hBqJAh4+PK7E6cMYXpiyrwhH3EwiGldNYWAEyo6HhQWHqLo+Htf1JdJuDehes7lRgFVfX58pFyQrXBEIMGAq0PNXvGXzzP4fth2kQ65BxP6c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=ubmMcNFw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ubmMcNFw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50914C32782; Tue, 25 Jun 2024 04:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1719291542; bh=1Pnx+hP0NkZPbhq0IPQ3NJbjt5U3VcqdQKgUwRsnmzc=; h=Date:To:From:Subject:From; b=ubmMcNFw/NoykwLjnVFbG1D8KsyH3XHUCaG/wpFf2a5WP/ziN1Ka87uq3HmbNR8ry HfaG20e3KYTdnvpepCwIBEGIVcDAAF0rtuOPjzo54y0ULXjEHkZ213v6rME3SRaxcr ftStJJOWkdpmIk+cUMCQzV69oEo5kVMTjs8HWKPs= Date: Mon, 24 Jun 2024 21:59:01 -0700 To: mm-commits@vger.kernel.org,willy@infradead.org,tj@kernel.org,shikemeng@huaweicloud.com,akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] writeback-factor-out-wb_dirty_freerun-to-remove-more-repeated-freerun-code.patch removed from -mm tree Message-Id: <20240625045902.50914C32782@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: writeback: factor out wb_dirty_freerun to remove more repeated freerun code has been removed from the -mm tree. Its filename was writeback-factor-out-wb_dirty_freerun-to-remove-more-repeated-freerun-code.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Kemeng Shi Subject: writeback: factor out wb_dirty_freerun to remove more repeated freerun code Date: Tue, 14 May 2024 20:52:51 +0800 Factor out wb_dirty_freerun to remove more repeated freerun code. Link: https://lkml.kernel.org/r/20240514125254.142203-6-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Acked-by: Tejun Heo Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton --- mm/page-writeback.c | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) --- a/mm/page-writeback.c~writeback-factor-out-wb_dirty_freerun-to-remove-more-repeated-freerun-code +++ a/mm/page-writeback.c @@ -1746,6 +1746,27 @@ static void domain_dirty_freerun(struct dtc->freerun = dirty <= dirty_freerun_ceiling(thresh, bg_thresh); } +static void wb_dirty_freerun(struct dirty_throttle_control *dtc, + bool strictlimit) +{ + dtc->freerun = false; + + /* was already handled in domain_dirty_freerun */ + if (strictlimit) + return; + + wb_dirty_limits(dtc); + /* + * LOCAL_THROTTLE tasks must not be throttled when below the per-wb + * freerun ceiling. + */ + if (!(current->flags & PF_LOCAL_THROTTLE)) + return; + + dtc->freerun = dtc->wb_dirty < + dirty_freerun_ceiling(dtc->wb_thresh, dtc->wb_bg_thresh); +} + /* * balance_dirty_pages() must be called by processes which are generating dirty * data. It looks at the number of dirty pages in the machine and will force @@ -1838,19 +1859,9 @@ free_running: * Calculate global domain's pos_ratio and select the * global dtc by default. */ - if (!strictlimit) { - wb_dirty_limits(gdtc); - - if ((current->flags & PF_LOCAL_THROTTLE) && - gdtc->wb_dirty < - dirty_freerun_ceiling(gdtc->wb_thresh, - gdtc->wb_bg_thresh)) - /* - * LOCAL_THROTTLE tasks must not be throttled - * when below the per-wb freerun ceiling. - */ - goto free_running; - } + wb_dirty_freerun(gdtc, strictlimit); + if (gdtc->freerun) + goto free_running; dirty_exceeded = (gdtc->wb_dirty > gdtc->wb_thresh) && ((gdtc->dirty > gdtc->thresh) || strictlimit); @@ -1865,20 +1876,10 @@ free_running: * both global and memcg domains. Choose the one * w/ lower pos_ratio. */ - if (!strictlimit) { - wb_dirty_limits(mdtc); + wb_dirty_freerun(mdtc, strictlimit); + if (mdtc->freerun) + goto free_running; - if ((current->flags & PF_LOCAL_THROTTLE) && - mdtc->wb_dirty < - dirty_freerun_ceiling(mdtc->wb_thresh, - mdtc->wb_bg_thresh)) - /* - * LOCAL_THROTTLE tasks must not be - * throttled when below the per-wb - * freerun ceiling. - */ - goto free_running; - } dirty_exceeded |= (mdtc->wb_dirty > mdtc->wb_thresh) && ((mdtc->dirty > mdtc->thresh) || strictlimit); _ Patches currently in -mm which might be from shikemeng@huaweicloud.com are