From: Disha Goel <disgoel@linux.ibm.com>
To: ltp@lists.linux.it
Cc: Disha Goel <disgoel@linux.ibm.com>
Subject: [LTP] [PATCH 2/2] memcg/memcontrol03-04: fix typos, redundant define and format specifiers
Date: Fri, 7 Aug 2026 18:35:22 +0530 [thread overview]
Message-ID: <20260807130523.49068-2-disgoel@linux.ibm.com> (raw)
In-Reply-To: <20260807130523.49068-1-disgoel@linux.ibm.com>
Fix typos in doc comments ('tempfs' -> 'tmpfs', 'becaue' -> 'because',
'dont not' -> 'do not'), remove '#define TMPDIR "mntdir"' which
duplicates the definition already in memcontrol_common.h, replace
PRIdPTR with %zu for size_t arguments (PRIdPTR is for signed intptr_t),
and fix continuation line indentation in tst_res() calls.
Signed-off-by: Disha Goel <disgoel@linux.ibm.com>
---
testcases/kernel/controllers/memcg/memcontrol03.c | 12 +++++-------
testcases/kernel/controllers/memcg/memcontrol04.c | 10 ++++------
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/testcases/kernel/controllers/memcg/memcontrol03.c b/testcases/kernel/controllers/memcg/memcontrol03.c
index 493e970ab..42298e5f0 100644
--- a/testcases/kernel/controllers/memcg/memcontrol03.c
+++ b/testcases/kernel/controllers/memcg/memcontrol03.c
@@ -27,8 +27,8 @@
* pagecache even in this case."
*
* memory.min doesn't appear to exist on V1 so we only test on V2 like
- * the selftest. We do test on more file systems, but not tempfs
- * becaue it can't evict the page cache without swap. Also we avoid
+ * the selftest. We do test on more file systems, but not tmpfs
+ * because it can't evict the page cache without swap. Also we avoid
* filesystems which allocate extra memory for buffer heads.
*
* The tolerances have been increased from the self tests.
@@ -40,8 +40,6 @@
#include "memcontrol_common.h"
-#define TMPDIR "mntdir"
-
static struct tst_cg_group *trunk_cg[3];
static struct tst_cg_group *leaf_cg[4];
static int fd = -1;
@@ -105,8 +103,8 @@ static void alloc_anon_in_child(const struct tst_cg_group *const cg,
SAFE_CG_SCANF(cg, "memory.current", "%zu", &cgmem);
size = size > cgmem ? size - cgmem : 0;
- tst_res(TINFO, "Child %d in %s: Allocating anon: %"PRIdPTR,
- getpid(), tst_cg_group_name(cg), size);
+ tst_res(TINFO, "Child %d in %s: Allocating anon: %zu",
+ getpid(), tst_cg_group_name(cg), size);
if (size)
alloc_anon(size);
@@ -148,7 +146,7 @@ static void alloc_pagecache_in_child(const struct tst_cg_group *const cg,
SAFE_CG_SCANF(cg, "memory.current", "%zu", &cgmem);
size = size > cgmem ? size - cgmem : 0;
- tst_res(TINFO, "Child %d in %s: Allocating pagecache: %"PRIdPTR,
+ tst_res(TINFO, "Child %d in %s: Allocating pagecache: %zu",
getpid(), tst_cg_group_name(cg), size);
if (size)
diff --git a/testcases/kernel/controllers/memcg/memcontrol04.c b/testcases/kernel/controllers/memcg/memcontrol04.c
index 15d8f891c..d448478d6 100644
--- a/testcases/kernel/controllers/memcg/memcontrol04.c
+++ b/testcases/kernel/controllers/memcg/memcontrol04.c
@@ -28,7 +28,7 @@
* The closest thing to memory.low on V1 is soft_limit_in_bytes which
* uses a different mechanism and has different semantics. So we only
* test on V2 like the selftest. We do test on more file systems, but
- * not tempfs becaue it can't evict the page cache without swap. Also
+ * not tmpfs because it can't evict the page cache without swap. Also
* we avoid filesystems which allocate extra memory for buffer heads.
*
* The tolerances have been increased from the self tests.
@@ -40,8 +40,6 @@
#include "memcontrol_common.h"
-#define TMPDIR "mntdir"
-
static struct tst_cg_group *trunk_cg[3];
static struct tst_cg_group *leaf_cg[4];
static int fd = -1;
@@ -102,7 +100,7 @@ static void alloc_anon_in_child(const struct tst_cg_group *const cg,
SAFE_CG_PRINTF(cg, "cgroup.procs", "%d", getpid());
- tst_res(TINFO, "Child %d in %s: Allocating anon: %"PRIdPTR,
+ tst_res(TINFO, "Child %d in %s: Allocating anon: %zu",
getpid(), tst_cg_group_name(cg), size);
alloc_anon(size);
@@ -122,7 +120,7 @@ static void alloc_pagecache_in_child(const struct tst_cg_group *const cg,
SAFE_CG_PRINTF(cg, "cgroup.procs", "%d", getpid());
- tst_res(TINFO, "Child %d in %s: Allocating pagecache: %"PRIdPTR,
+ tst_res(TINFO, "Child %d in %s: Allocating pagecache: %zu",
getpid(), tst_cg_group_name(cg), size);
alloc_pagecache(fd, size);
@@ -227,7 +225,7 @@ static void test_memcg_low(void)
TST_EXP_EXPR(low == 0,
"(%c low events=%ld) == 0", id, low);
} else if (!tst_cg_memory_recursiveprot(leaf_cg[F])) {
- /* dont not check F when recursive_protection enabled */
+ /* do not check F when recursive_protection enabled */
TST_EXP_EXPR(low == 0,
"(%c low events=%ld) == 0", id, low);
}
--
2.45.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-08-07 13:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 13:05 [LTP] [PATCH 1/2] memcg/memcontrol02: fix fd leak in cleanup path Disha Goel
2026-08-07 13:05 ` Disha Goel [this message]
2026-08-07 14:18 ` [LTP] " linuxtestproject.agent
2026-08-10 9:41 ` Andrea Cervesato via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260807130523.49068-2-disgoel@linux.ibm.com \
--to=disgoel@linux.ibm.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.