From patchwork Fri Nov 5 20:40:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605591 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5171EC433F5 for ; Fri, 5 Nov 2021 20:40:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05862611C0 for ; Fri, 5 Nov 2021 20:40:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 05862611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9637D94006E; Fri, 5 Nov 2021 16:40:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9194394006F; Fri, 5 Nov 2021 16:40:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F26E94006E; Fri, 5 Nov 2021 16:40:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 60A0E940049 for ; Fri, 5 Nov 2021 16:40:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2884455D92 for ; Fri, 5 Nov 2021 20:40:39 +0000 (UTC) X-FDA: 78776044998.12.3D992FC Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id E4AFED0000A8 for ; Fri, 5 Nov 2021 20:40:27 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id ED23D6126A; Fri, 5 Nov 2021 20:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636144838; bh=3FgqD949W3pnE6WwT33oOxGUVWU25dyD4e9aK8K98rk=; h=Date:From:To:Subject:In-Reply-To:From; b=sRL8ipK2akfBj2RPlmrdLBIsrAumU6LpgzzM/R6OgsaJLwlI9jSdtvg5Sw2UeMkns bp/PFltqb3jky0exsp0GecHKAnBNCCECEt/oiWdZ01qDTwkqdyBaU4KfnMsT7DzeOj BjqX/ruMZLGqZfuf3q/zpnw8UbpF2c3GJcmcH9fU= Date: Fri, 05 Nov 2021 13:40:37 -0700 From: Andrew Morton To: akpm@linux-foundation.org, liangcaifan19@gmail.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, zhang.lyra@gmail.com Subject: [patch 114/262] mm/page_alloc.c: show watermark_boost of zone in zoneinfo Message-ID: <20211105204037.aNvfZGhYc%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=sRL8ipK2; dmarc=none; spf=pass (imf15.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E4AFED0000A8 X-Stat-Signature: u1wzmr1yuabfi67m97yaoanuzo51huo6 X-HE-Tag: 1636144827-278843 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: From: Liangcai Fan Subject: mm/page_alloc.c: show watermark_boost of zone in zoneinfo min/low/high_wmark_pages(z) is defined as (z->_watermark[WMARK_MIN/LOW/HIGH] + z->watermark_boost). If kswapd is frequently waked up due to the increase of min/low/high_wmark_pages, printing watermark_boost can quickly locate whether watermark_boost or _watermark[WMARK_MIN/LOW/HIGH] caused min/low/high_wmark_pages to increase. Link: https://lkml.kernel.org/r/1632472566-12246-1-git-send-email-liangcaifan19@gmail.com Signed-off-by: Liangcai Fan Cc: Chunyan Zhang Signed-off-by: Andrew Morton --- mm/page_alloc.c | 2 ++ mm/vmstat.c | 2 ++ 2 files changed, 4 insertions(+) --- a/mm/page_alloc.c~mm-show-watermark_boost-of-zone-in-zoneinfo +++ a/mm/page_alloc.c @@ -5993,6 +5993,7 @@ void show_free_areas(unsigned int filter printk(KERN_CONT "%s" " free:%lukB" + " boost:%lukB" " min:%lukB" " low:%lukB" " high:%lukB" @@ -6013,6 +6014,7 @@ void show_free_areas(unsigned int filter "\n", zone->name, K(zone_page_state(zone, NR_FREE_PAGES)), + K(zone->watermark_boost), K(min_wmark_pages(zone)), K(low_wmark_pages(zone)), K(high_wmark_pages(zone)), --- a/mm/vmstat.c~mm-show-watermark_boost-of-zone-in-zoneinfo +++ a/mm/vmstat.c @@ -1656,6 +1656,7 @@ static void zoneinfo_show_print(struct s } seq_printf(m, "\n pages free %lu" + "\n boost %lu" "\n min %lu" "\n low %lu" "\n high %lu" @@ -1664,6 +1665,7 @@ static void zoneinfo_show_print(struct s "\n managed %lu" "\n cma %lu", zone_page_state(zone, NR_FREE_PAGES), + zone->watermark_boost, min_wmark_pages(zone), low_wmark_pages(zone), high_wmark_pages(zone),