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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD912C433F5 for ; Wed, 24 Nov 2021 19:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351394AbhKXTjY (ORCPT ); Wed, 24 Nov 2021 14:39:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243525AbhKXTjR (ORCPT ); Wed, 24 Nov 2021 14:39:17 -0500 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A906C06173E for ; Wed, 24 Nov 2021 11:36:08 -0800 (PST) Received: by mail-pf1-x449.google.com with SMTP id l7-20020a622507000000b00494608c84a4so2069979pfl.6 for ; Wed, 24 Nov 2021 11:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=l9t6ClhMMo4edSjmJdir8QUj58OMyUYJRTb0MJXDOKU=; b=i0/Ngz3cNacHmR60ZQrdeEnU5wK465ot7VF/quxdpABPcQ5rReQE4P1dvpSxwpUQ3m WJ7qE/WsmjAnexVyI5rsHFc8xD8POs/0ISZbs4ZJkhR+CYum1Q3AFocYRIxWrBtGPYyd kpGigPgr0Gy6viXOgyakF3EJmTn3zFz9OVVwTg9lIs9gTEHhaESQjUH4FFP+hPxZ3q3D aPs6s2Nsd5VhVbRR2vRo55J4x+AdhEx7XRnb2UkZLKv2t2yG6O4cp3R60tecsUAshY60 boOQrsQpXPVxDlp5sBkCJxX+Cl7biSAKJg+KC20HTZUp3GnjLr+bKkhdo0e7k5hun9DX hd2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=l9t6ClhMMo4edSjmJdir8QUj58OMyUYJRTb0MJXDOKU=; b=S1kj/21xKJxSRkq9w2mekmEAG3y9M9o+McAY7fQnSzROzGnxvmLG7QavqWSekheO+f FAg9r2ScNelCT74asjZQLthyl4TOGYmwN7877+lW3e6z7D3tokcdrChm8amqLG90xceR UaiiCS/OfAXurELuPVMr/BnBlMVcSlpNhZhYUYeO4VvZ05fv9xlhU1NdltHQJUmju6dU A2cO8qwDM1LjjLQnBlqM39K3BLD2NKVLGKVSF233TZAA44ZJavEZFZeHPCL5GJkjwKUH iMKAMxS8O8lfgGXYCxI4PWHVEbRpj7X8m9JJXmyPjiZLbfFYRZoNmq43YUDzxXeodmUI 1ZeQ== X-Gm-Message-State: AOAM5330cvjXKHqGjnoVlbN5ZPYpcHQF+pf1ziVgCZO4UjngEAf1TO/o K2NYjMVNx7imvqs/84BbxqsOr+fUBM0= X-Google-Smtp-Source: ABdhPJzIBX9oxqVPB6dAYbBGP63Ursk9otTuOWoAVdTYt8LpHs+DLkFQWjiFWGnpyjXSRzphENtqYSJ9moM= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:ecf7:86c0:3b4d:493]) (user=surenb job=sendgmr) by 2002:a63:914c:: with SMTP id l73mr12197689pge.184.1637782567590; Wed, 24 Nov 2021 11:36:07 -0800 (PST) Date: Wed, 24 Nov 2021 11:36:04 -0800 Message-Id: <20211124193604.2758863-1-surenb@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog Subject: [PATCH 1/1] sysctl: change watermark_scale_factor max limit to 30% From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: mhocko@suse.com, hannes@cmpxchg.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, dave.hansen@linux.intel.com, vbabka@suse.cz, mgorman@techsingularity.net, corbet@lwn.net, yi.zhang@huawei.com, xi.fengfei@h3c.com, rppt@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@android.com, surenb@google.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For embedded systems with low total memory, having to run applications with relatively large memory requirements, 10% max limitation for watermark_scale_factor poses an issue of triggering direct reclaim every time such application is started. This results in slow application startup times and bad end-user experience. By increasing watermark_scale_factor max limit we allow vendors more flexibility to choose the right level of kswapd aggressiveness for their device and workload requirements. Signed-off-by: Suren Baghdasaryan --- Documentation/admin-guide/sysctl/vm.rst | 2 +- kernel/sysctl.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst index 5e795202111f..f4804ce37c58 100644 --- a/Documentation/admin-guide/sysctl/vm.rst +++ b/Documentation/admin-guide/sysctl/vm.rst @@ -948,7 +948,7 @@ how much memory needs to be free before kswapd goes back to sleep. The unit is in fractions of 10,000. The default value of 10 means the distances between watermarks are 0.1% of the available memory in the -node/system. The maximum value is 1000, or 10% of memory. +node/system. The maximum value is 3000, or 30% of memory. A high rate of threads entering direct reclaim (allocstall) or kswapd going to sleep prematurely (kswapd_low_wmark_hit_quickly) can indicate diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 083be6af29d7..2ab4edb6e450 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -122,6 +122,7 @@ static unsigned long long_max = LONG_MAX; static int one_hundred = 100; static int two_hundred = 200; static int one_thousand = 1000; +static int three_thousand = 3000; #ifdef CONFIG_PRINTK static int ten_thousand = 10000; #endif @@ -2959,7 +2960,7 @@ static struct ctl_table vm_table[] = { .mode = 0644, .proc_handler = watermark_scale_factor_sysctl_handler, .extra1 = SYSCTL_ONE, - .extra2 = &one_thousand, + .extra2 = &three_thousand, }, { .procname = "percpu_pagelist_high_fraction", -- 2.34.0.rc2.393.gf8c9666880-goog