From patchwork Fri Jan 24 18:21:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Clapinski X-Patchwork-Id: 13949817 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 6971FC02181 for ; Fri, 24 Jan 2025 18:21:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D151C28008A; Fri, 24 Jan 2025 13:21:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CC50B280079; Fri, 24 Jan 2025 13:21:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B666E28008A; Fri, 24 Jan 2025 13:21:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 90859280079 for ; Fri, 24 Jan 2025 13:21:52 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 477D5B1C87 for ; Fri, 24 Jan 2025 18:21:52 +0000 (UTC) X-FDA: 83043164064.21.1E12F0A Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) by imf18.hostedemail.com (Postfix) with ESMTP id C75B91C0011 for ; Fri, 24 Jan 2025 18:21:49 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=m0n29oL4; spf=pass (imf18.hostedemail.com: domain of 3PNqTZwoKCIMtjshwpuzrpnvvnsl.jvtspu14-ttr2hjr.vyn@flex--mclapinski.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3PNqTZwoKCIMtjshwpuzrpnvvnsl.jvtspu14-ttr2hjr.vyn@flex--mclapinski.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737742909; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MTdaJMw+GE/ToWZXQwf98N8OcNSfcH4MlIjaDI1DCcU=; b=qwBQhZ4/y72OFN4VbuzJ/RFbiLnT+cTEYeCFTbMBKp+V+migczyCbnKfj0V8lq6VqgNRBZ A3YQql/5X8E86/quT1rfaS6SrNtcExS8VXEwS7m0ZRvJtb8taXBJj27sESIDwIFiqIzydw 5zbxQE29COHymtBpTSCoJOU7GDhiXCs= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=m0n29oL4; spf=pass (imf18.hostedemail.com: domain of 3PNqTZwoKCIMtjshwpuzrpnvvnsl.jvtspu14-ttr2hjr.vyn@flex--mclapinski.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3PNqTZwoKCIMtjshwpuzrpnvvnsl.jvtspu14-ttr2hjr.vyn@flex--mclapinski.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737742909; a=rsa-sha256; cv=none; b=11Wj0NdUL2E5wuo/t7wjnUvYO81uXTMlxFQrVUj2b2dExX5zw/U7CN1QLfxIU04ifHGnKs L0nTrz6xwDjyUOopxPIvW7+I22eUWieGIjqm2Aa24jFKVrGfwi0xkPozCRVzgzj36VG5Fd RIwrvwVWTZQs4uaITC4ZocYgyTIMywU= Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-5d3ff3c1b34so3280922a12.1 for ; Fri, 24 Jan 2025 10:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737742908; x=1738347708; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=MTdaJMw+GE/ToWZXQwf98N8OcNSfcH4MlIjaDI1DCcU=; b=m0n29oL4Oak99kz5Z07Nc4lmO7eun7R8LKZarOXDRezqUSN+bfFO2WfybvZ+u+YZgG yTK2fMR7ZYyLn6xF3hGlo1Qpm43MfzbuCVjNbgt+J20Ixql7ghlhtuSjFQzFBQLB4mV8 yEYpw5vAtG6Q2bKQuuCK670UQHZ97pL5MxNL3zXQ8/HJjM5X2NIk2svtddagR1PWIMk+ 5tgCPgfXERTQLxwGa5o4rCYme6bPxHEkjY+JR8qVA5xI4MCCB/vP46DOGz5r0xf1KqYp PLnjwF8raKgm/QcDXEs3QnVtoHBGizLOWYWtfJyscjTkZqKSMlPJpEyX5a2+rjgpwE6A cGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742908; x=1738347708; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MTdaJMw+GE/ToWZXQwf98N8OcNSfcH4MlIjaDI1DCcU=; b=JIbGoqibzgG/MN3+EHkC3i+JFWN6P/IrXNi82pRr8ny1ahJvkbN3twXksnZB7ibVMD e1tmw3KZ6IcuU4zxa6MYuFFufLSkQi9TLZShksypBeiKDAVxB7eagm62T29mHT9qX656 XP7nArOHQCdtZhulGrrueboB7q5Y5O1NIcL7fFse04tomgGKuXA3wtmKi2U23W3k+7aC ivaiT7XcZtp1pr2oh/cyUkZqgK8/UjEqIcSiz1QRJ2hOrDpnT/HZCPmWGm9NjsYlrEMF YI4p5qTezapmcrtTGSKHopgU9lIrWqMvJTX1deRqLYhdQOx6PSjrQdRs/ywfax5Nv82l sopw== X-Gm-Message-State: AOJu0YxWzzBdSawSpzopzZ79sCJYGug67zxnq7Hy2kDdP/1qJwPp7ldq yeqhSAGNkJh2kLQ+GnWz4cPnSsdlzNJ45GI+7kioqZVKTGgj/cZE/d5dgnQL6Sgg1/rkyTm1ovn VObhCkpEN7U9JIzHZOg== X-Google-Smtp-Source: AGHT+IGlll3ZJRgeYACjNMmQxU9JVECoCUtaZdkmY0U4Nk6wmeTTDMDT8oLJGMhd1iCVoe1QMCnpb3RypI8fcHaV X-Received: from edbds6.prod.google.com ([2002:a05:6402:1cc6:b0:5d9:12d3:9537]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:358b:b0:5dc:21a9:d0f1 with SMTP id 4fb4d7f45d1cf-5dc21a9d13bmr896896a12.14.1737742908471; Fri, 24 Jan 2025 10:21:48 -0800 (PST) Date: Fri, 24 Jan 2025 19:21:39 +0100 In-Reply-To: <20250124182140.2243862-1-mclapinski@google.com> Mime-Version: 1.0 References: <20250124182140.2243862-1-mclapinski@google.com> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250124182140.2243862-2-mclapinski@google.com> Subject: [PATCH 1/2] mm/compaction: remove low watermark cap for proactive compaction From: Michal Clapinski To: Andrew Morton , Nitin Gupta , Pasha Tatashin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Clapinski X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C75B91C0011 X-Stat-Signature: 1nocmpqmeio1rbig5zqyd57rzuotxpym X-Rspam-User: X-HE-Tag: 1737742909-191530 X-HE-Meta: U2FsdGVkX1+2R8CW/HH0pkX1RIU93fQ7jT2jd+2cTchtsTMVkCBClF9VoQyZt3fDYjNZdEEJjnd5eoXh/rSMz+9t0X9TmfIA8b+rVB6A2QMjtokM1Y0AsJaoHn/jrsfXpVqQNCVLl+0uakESlELxszBaEiTkLlnRZKXAwpkY3KuKQyfzjrkIC6KOkT70P4QmPAOMEfFH2EA7zAYFf531b8hTac6AsKxhQfvuKi2EAvcO6VBV75Jqly+v3+ewrId1/jsTQ3HttIwIvXL+RacsLwXv608zCL/kTRJHnuoapeYR2ywI10GXMwiYdR5qh6w6kG4PctytpGO+WDIHmsR+cBhdKYdFXR6RG/fs8tOTQbUBW8RIUNywjLpjfgQty3zSjG1qrFwaVIXCyyOunhJdDjUTeQy5aJ/qiClGTyz7kOL7kRMj8oUvrWh6NcI0tRixNPxgrU37AGymiveqaYXvjR1GJc3sx+J0QwDkBtv7eTBQshVw5akt7e5CZvRdSfKuxdnsQM9G12QcYh6Y50bLZrlp5dpUwVPKznRHWA5GX5SWBwgsE4ZuXV9TeNa/YpuW2ytsEI42+DPJfV1IO5NlR+OKrcNLLMt+MnGCjlfkAKXMN6ox5MtIVfcXLGLYIU3zumcnTE8YwmIDys5pqmNPxvmy/+cX/wx1xl8hjr79ogAzNi1Ke8QmpGESTxPnqSovn2TthKaByPfei/oBUcrJKtZmnxp4AXiDIvi8RJmSC8++XhRAkX4SLAvcD432RIjifM1TunmvqMJZ1ikY5L6uCZ3i07Brt/rrD1XbmKGqHRDyRIyUzNQjRWKAya8BYvFmicX7bh+2p9ImQCrzI5E+S+Eh5doCE/IMIt4xX0Ti47AlCvgxWUmUHi3Vppt/sqgrtKRgRKJ8wNKk0Bye/REkc6021DDxLnIkaSo8aeGagORcYS9CQvnwCmCc1qgNPJhHZgY2B81pqvFsLXLO5zo dTyvX4ZS lhrov0P23JmwXn6BCEUzxcaD5mXzioos2v01OB1wdXfJAEzWpcM/5h8boq5TH8rPQf2eKpTOlNtiWWDw4uuGf2ZEfj7qR2iQ+I/+i1cIk/nLReRoLn4uNzEW4NEXVl0S/LS3Y4vJli8E3vTLUx4pqv5M1xbtnCgIM/7GpuK8dhO7uU+ORehGBKeJlnhQibNcM0y/NnYPHJXEIGEqPl8mLMdrTVLqZsq49XAL+l013s9V0NPUnT/NxgDUzJarg3mCkBLPPwzGXXFNl3Z0ldwofBR4zRejFKF8/+FSgHG+1+IB06lfUA8QelizaNxKhI/CRLmvBAMEu/RNsOfpLzENQVpxigD0FCMf0nkXDyk7m2A5pQnLWUnOX59Pj+bYdlJb52YW5U5MZUmBAXR6tstKKtkNF58dW4BZuzr3xHHmUL1oK/QEfedWsN+2GK2GaueTHvLk3tQFOfHpABimG2sTEmxdVZqiyCThFPPBGUPRj2R/e0vJv8C/BXt1ufSIrKKePqTf/+JReU+XupWcA83kxWWs8hZmlyz2LgbB9WrriavVB9fE+q1lxV8Qh9gOS6zHIH6pD 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: Previously a min cap of 5 has been set in the commit introducing proactive compaction. This was to make sure users don't hurt themselves by setting the proactiveness to 100 and making their system unresponsive. But the compaction mechanism has a backoff mechanism that will sleep for 30s if no progress is made, so I don't see a significant risk here. My system (20GB of memory) has been perfectly fine with proactiveness set to 100 and leeway set to 0. Signed-off-by: Michal Clapinski Reviewed-by: Pasha Tatashin --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index a2b16b08cbbff..29524242a16ef 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2253,7 +2253,7 @@ static unsigned int fragmentation_score_wmark(bool low) * activity in case a user sets the proactiveness tunable * close to 100 (maximum). */ - wmark_low = max(100U - sysctl_compaction_proactiveness, 5U); + wmark_low = 100U - sysctl_compaction_proactiveness; return low ? wmark_low : min(wmark_low + 10, 100U); } From patchwork Fri Jan 24 18:21:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Clapinski X-Patchwork-Id: 13949818 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 BF5F3C0218B for ; Fri, 24 Jan 2025 18:21:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21A1628008C; Fri, 24 Jan 2025 13:21:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CB45280079; Fri, 24 Jan 2025 13:21:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06B7C28008C; Fri, 24 Jan 2025 13:21:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D8E5C280079 for ; Fri, 24 Jan 2025 13:21:56 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8DB77141342 for ; Fri, 24 Jan 2025 18:21:56 +0000 (UTC) X-FDA: 83043164232.18.1E55915 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) by imf08.hostedemail.com (Postfix) with ESMTP id C67D216001E for ; Fri, 24 Jan 2025 18:21:54 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=SmMNSBwt; spf=pass (imf08.hostedemail.com: domain of 3QdqTZwoKCIgyoxm1uz4wus00sxq.o0yxuz69-yyw7mow.03s@flex--mclapinski.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3QdqTZwoKCIgyoxm1uz4wus00sxq.o0yxuz69-yyw7mow.03s@flex--mclapinski.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737742914; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EmZHaJDsiucuS2I5hmcRew1BX+PLLWZVwz1UvaTDX14=; b=DhH0aTuHadx16+X2iaFjEILqVRggeaVWG4ZZF9dQK1LcOoUE2HE7+UlGV6bFjEo7jbjhZg rqClJkbkabA3+JrXGNNVY/zkqvxwJvVURqVqVk5mtQTWceGR4NpRc6jGUHsQipc+oWfi7j yzGaVORZidWOYx6YuXbxa9cQAkScfKM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737742914; a=rsa-sha256; cv=none; b=ieVNlpOeTiYqrc6XXK0h3FNCYnDx4qmGmF36may7qSZd5cTu4PTS+KtS7+T+mbKt9D32re e6im0gLGx5TJ/i+vnmToWOsFv6Mtn1afHPs4fQE1IJdqwCVmUEIz52qfVNGM8ptu4CP8sr 15Ob6DdqeWyWfOC7juTLPzUECL4EOak= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=SmMNSBwt; spf=pass (imf08.hostedemail.com: domain of 3QdqTZwoKCIgyoxm1uz4wus00sxq.o0yxuz69-yyw7mow.03s@flex--mclapinski.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3QdqTZwoKCIgyoxm1uz4wus00sxq.o0yxuz69-yyw7mow.03s@flex--mclapinski.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-ej1-f74.google.com with SMTP id a640c23a62f3a-aaf8396f65fso232619866b.0 for ; Fri, 24 Jan 2025 10:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737742913; x=1738347713; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=EmZHaJDsiucuS2I5hmcRew1BX+PLLWZVwz1UvaTDX14=; b=SmMNSBwtFgzTkVlKIlK7jzbnu/xElxrdK82BESTdJ2luHRF7hGca3W25kH2mw0Oze8 uG1yv2Is0OfXg2IkCRQi+bKM/BLNRl2Hx+fVnGdgKhq2BNAN65NgFjzwqppTuUvKgkA8 kG2cA3UlhFdRTEaBAUBAaVceqomNyNWG1WjdJRl2kOU7C+2Z3BHWbLAtl1v0jb5q0Dj3 wsyf1XXAd127Ln10S9hXca22eyzD1fcs93WMVPvCxfEh/dnsJwTIwFOTZoeRedGSd6AQ TMahmmuo0wu/t6JAQg8+Bey+ybx1b8cYjH0R/kJUXGG6OwW2PUoOhA4G66HcxJ+veYlw Bw0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742913; x=1738347713; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EmZHaJDsiucuS2I5hmcRew1BX+PLLWZVwz1UvaTDX14=; b=bF1Szx6hzzWthbiEEkTKGSdBHKCt7GvtUux2/Pf1AwzPC1HpU6Y+g/BVRX8pTFF4VP MIGeoio7IY9qay+/T0Pg9GeuKmfLKvTGHk+OauoP3OiXFqVaoWT+RZdk7bwh/onQtkgY msdaABKZUZPTsdPAH6CRUr6vIJjXOaZSkW4NEJcNhmxUQFjw/QFLiZhgQ4G87SfjfNml EbDm1eapf1B08Zzq76BrLaCIBatLvEt6WDHGddKEzmLgPF20CJ2VxBmqrmcrILg4BFFc 6+Tf/rAp4i8eJzmzuf3KrAGK2kdnChXEoeGgmyH/PGHfZ2rkho2sVX/SBQMODT7q7lAF vfAw== X-Gm-Message-State: AOJu0YxZ8SDSsB5ibJ9I1cy5K1d90slCD9ChJqU9pJTFK9wXgGbEubIQ h6TjaYORZiVvQvK9OZWLoTstFTnYws8JvSJvVkLTE0xYal7kFJhbhh43uqzo1RPOe4ZRImOo50E g8wrH0/dhYF2P328lNA== X-Google-Smtp-Source: AGHT+IFo+R1qJYiam+4Ip+3MGO+gEoGw7GKy/IdyI5u6KlHyx48ROGLESvd8X9UAOjzkINMvfA5EEUZ7Y5bodrXi X-Received: from ejux6.prod.google.com ([2002:a17:906:4a86:b0:aab:957f:1a30]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:2da3:b0:aa6:85d0:1492 with SMTP id a640c23a62f3a-ab38b378c99mr3048449866b.37.1737742913550; Fri, 24 Jan 2025 10:21:53 -0800 (PST) Date: Fri, 24 Jan 2025 19:21:40 +0100 In-Reply-To: <20250124182140.2243862-1-mclapinski@google.com> Mime-Version: 1.0 References: <20250124182140.2243862-1-mclapinski@google.com> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250124182140.2243862-3-mclapinski@google.com> Subject: [PATCH 2/2] mm/compaction: expose a new param for proactive compaction From: Michal Clapinski To: Andrew Morton , Nitin Gupta , Pasha Tatashin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Clapinski X-Stat-Signature: jrdsy9cesgdd9ou38bzw47uneco7c9id X-Rspam-User: X-Rspamd-Queue-Id: C67D216001E X-Rspamd-Server: rspam03 X-HE-Tag: 1737742914-295142 X-HE-Meta: U2FsdGVkX1/KrTql8ZgSIvn7ZBeAYobPzApqB7JhRFpdxsh9nv2ltVlQVBJEkNNMgyZhjklz1fgaXW/NP+cqYa/zS2PkZNBblK0TON9xmAUTQRtzeXG39CZGbc3VFHhm9dq4hnMgCK9YDG2I7DwVUQBtKC9xeM8ubkZHX5tEzJtrfDD+c6IHYeOTY9dpSoO+4FdscBBGWiVwj2Gjm/uQoRldCFPH4duRFdeSGjBvcq88nKKPHGx3iaXuhJwgh5vyQl0n0PLsTqSuTx04f2GRPx5JiTk96X4gll3atdXgiTFoQ7hGyBbOlnSxiAgHlMzBEBjPKW3jdFKpZOoow4JCUQ468zYzqKD7OmRNP5/x60PolXo7OfTjBuToHZuN6ClTwysukPBhZEwFE5vb5l9n9hnCkkUNyio7JU09XrF6+tXr1BpJwCEyLsh+9izQMlDs/3K2n5ikSjc/G0yPDAMq6oARBgY456igRqS+p/+JQ8WJmxiYyh93vtMybEj+ab+4BrycyuRjBH5/gQDcBfiVPUlNi/F3MTod/4YtGQKVjNmPRorMYDuXFLUmJvc4TFOjn+7w44C80bo+8LaM+1ljWc6Cn1G2jYO8BxHM3HpxInOQ3Y8uz4buf/ljDyNQ72Ao0H4QZZEdohNAixVs6/TnoaagLuYcpp+WPvULdWqjttat6r4jJ5DFSF5uBOzaapmkobcrhmUNahgZK5sR9wcmypOFDhahmGqVi2cNyw4OdrFovR4p7pfeWnxNaMvHY4n2xb8qgJS7kDNSOf7sVee1Z0Wd9NZ5LttmJZd6VRHVdb/k3mnh7mALxe5XcWWtA4PriWq9FfXxVsle/ziEyCZaNJuTFHijbn6mu75Vxtld35zkqXRywLRLOKT4Gcelx83A79aOEaGLD/Wq1Ov1Xv0VTblyAWM495PwgpwbWoS9iGAcZ9Vap00W6lGqS3tKSRUzTWDjYuLhyKOAYvFXrqz NNmc2IHb erlamRZ9tm3+YzK8pjSXa9FEVBbfa8zXtDvb42L9Sytig3LrE/Y/JVoroVq/H1Ail67x+GVRTj3WKsIe6nWww3PDI+p+stDhM/2w6Kx+QO3NYutdwdLyn6D48H9ZpCyUqfBa9S0QRU5/Ta0qJkhLKVuCTAEcA3HR4kY4YkimiGFs60U0PmM1mB+mw1PTF5AZe3fHWb02LhU6Ncse3u1XYErXZql7dMWkkUlDia/dR7edMU0B/l0IbqUKrezhFxkBPJyDdK5eC8Dfx9NJQAoahqEr/ICDLZAceELNbJYsqi8SnMkMf1/dAEVP0GuSMw4lD16TpGXa55qNJZXWr0fMCwpLECAUrlpF9b64JCiDUZCINu4RdQDE6hWpgJoppNU3PpwANHTvmmPE5QBMp1gw6SvJuybc9J3oXDDv2Ki8x9WgCdnfh4RQFo6WCprWvAVQOlRwD4QsJrsFiRRz5sGc8olD1SWjR6utKpScXNuoD5R2eBf7JFxqTc6n8F6IlDsJ/b/K/CUMlMglO9Fo/yZOEwsGyMZPcvKqZuYRsvS337YejVmOakqfegR2UDkCjqYhGvex+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Expose the diff between low and high watermark as a sysctl var. Signed-off-by: Michal Clapinski --- mm/compaction.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 29524242a16ef..fd546b797e544 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1921,6 +1921,7 @@ static int sysctl_compact_unevictable_allowed __read_mostly = CONFIG_COMPACT_UNE * background. It takes values in the range [0, 100]. */ static unsigned int __read_mostly sysctl_compaction_proactiveness = 20; +static unsigned int __read_mostly sysctl_compaction_proactiveness_leeway = 10; static int sysctl_extfrag_threshold = 500; static int __read_mostly sysctl_compact_memory; @@ -2254,7 +2255,7 @@ static unsigned int fragmentation_score_wmark(bool low) * close to 100 (maximum). */ wmark_low = 100U - sysctl_compaction_proactiveness; - return low ? wmark_low : min(wmark_low + 10, 100U); + return low ? wmark_low : min(wmark_low + sysctl_compaction_proactiveness_leeway, 100U); } static bool should_proactive_compact_node(pg_data_t *pgdat) @@ -3314,6 +3315,15 @@ static struct ctl_table vm_compaction[] = { .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE_HUNDRED, }, + { + .procname = "compaction_proactiveness_leeway", + .data = &sysctl_compaction_proactiveness_leeway, + .maxlen = sizeof(sysctl_compaction_proactiveness_leeway), + .mode = 0644, + .proc_handler = compaction_proactiveness_sysctl_handler, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE_HUNDRED, + }, { .procname = "extfrag_threshold", .data = &sysctl_extfrag_threshold,