lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200507215946.22589-1-gpiccoli@canonical.com>
Date:   Thu,  7 May 2020 18:59:46 -0300
From:   "Guilherme G. Piccoli" <gpiccoli@...onical.com>
To:     linux-mm@...ck.org
Cc:     linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
        gavin.guo@...onical.com, gpiccoli@...onical.com,
        kernel@...ccoli.net
Subject: [PATCH] mm, compaction: Indicate when compaction is manually triggered by sysctl

Currently we have no way to determine if compaction was triggered
by sysctl write, but this is an interesting information to have,
specially in systems with high uptime that presents lots of
fragmented memory. There's no statistic indicating if compaction
was triggered manually or ran by Linux itself, the vmstat numbers
cannot tell the user this information.

This patch adds a very simple message to kernel log when compaction
is requested through a write to sysctl file, and also it accumulates
the number of previously manual compaction executions. It follows
the approach used by drop_caches.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@...onical.com>
---


This patch was based on linux-next/akpm branch, at d0f3f6070c3a.
Thanks in advance for reviews!
Cheers,

Guilherme


 mm/compaction.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index fb43e731ac31..80e748b0bbb6 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2465,9 +2465,13 @@ int sysctl_compact_memory;
 int sysctl_compaction_handler(struct ctl_table *table, int write,
 			void *buffer, size_t *length, loff_t *ppos)
 {
-	if (write)
+	static unsigned compaction_acct;
+
+	if (write) {
+		pr_info("compact_memory triggered - it already previously ran %u times\n",
+			compaction_acct++);
 		compact_nodes();
-
+	}
 	return 0;
 }
 
-- 
2.25.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ