All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Pavithra <pavrampu@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting
Date: Wed,  9 Sep 2026 10:30:28 +0000	[thread overview]
Message-ID: <20260909103028.9066-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260909085555.1601588-1-pavrampu@linux.ibm.com>

Hi Pavithra,

On Wed Sep 9 14:25:55 2026 +0530, Pavithra <pavrampu@linux.ibm.com> wrote:
> hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

> Test hugetlbfs quota accounting with filesystem size limits to check
> for regressions in quota handling for MAP_PRIVATE and MAP_SHARED pages.

The empty lines in the commit message body contain trailing whitespace,
which triggers checkpatch errors.

> +/*\
> + * Test hugetlbfs quota accounting with filesystem size limits.
> + *
> + * The number of global huge pages available to a mounted hugetlbfs filesystem
> + * can be limited using a quota mechanism by setting the size attribute at
> + * mount time. Older kernels did not properly handle quota accounting for
> + * MAP_PRIVATE pages and MAP_SHARED reservations.
> + *
> + * Commit a1e78772d72b introduced MAP_PRIVATE reservations at mmap() time,
> + * so quota is checked upfront and mmap() fails with ENOMEM when over quota.
> + * Before this, quota was only checked at fault time resulting in SIGBUS.
> + *
> + * Root is required to mount the quota-limited hugetlbfs instance.
> + */

Use :manpage:`mmap(2)` when referencing mmap() in the documentation block.

> +static void verify_quota_map_unmap(unsigned long size, int mmap_flags)
> +{
> +	int fd;
> +	char path[PATH_MAX];
> +
> +	snprintf(path, sizeof(path), "%s/test_file_%d", MNTPOINT, getpid());
> +	fd = SAFE_OPEN(path, O_CREAT | O_RDWR, 0600);
> +	SAFE_UNLINK(path);
> +
> +	TST_EXP_PASS_PTR_VOID(mmap(NULL, size, PROT_READ | PROT_WRITE, mmap_flags, fd, 0),
> +			       "mmap untouched mapping");
> +	SAFE_CLOSE(fd);
> +}

verify_quota_map_unmap() never unmaps the mapping. As a result, this
tests cleanup on process termination rather than unmapping an untouched
mapping. Call SAFE_MUNMAP(TST_RET_PTR, size) if TST_PASS before closing fd.

> +	snprintf(path, sizeof(path), "%s/test_file_%d", MNTPOINT, getpid());
> +	fd = SAFE_OPEN(path, O_CREAT | O_RDWR, 0600);
> +	SAFE_UNLINK(path);

Use tst_creat_unlinked(MNTPOINT, 0, 0600) instead of manually creating and
unlinking files across the test functions.

> +	if (mount("none", MNTPOINT, "hugetlbfs", 0, mount_opts) == -1) {
> +		if (errno == ENODEV)
> +			tst_brk(TCONF, "hugetlbfs not supported");
> +		tst_brk(TBROK | TERRNO, "mount() failed");
> +	}

Use SAFE_MOUNT("none", MNTPOINT, "hugetlbfs", 0, mount_opts). Hugepage
support is already checked by .hugepages before setup() runs.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-09-09 10:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  8:55 [LTP] [PATCH v9] hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting Pavithra
2026-09-09 10:30 ` linuxtestproject.agent [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-09-12  8:22 [LTP] [PATCH v10] " Pavithra
2026-09-12 11:43 ` [LTP] " linuxtestproject.agent
2026-09-06 15:06 [LTP] [PATCH v8] " Pavithra
2026-09-06 16:03 ` [LTP] " linuxtestproject.agent
2026-09-05 12:45 [LTP] [PATCH v7] " Pavithra
2026-09-05 15:58 ` [LTP] " linuxtestproject.agent
2026-09-02  7:51 [LTP] [PATCH v6] " Pavithra
2026-09-02  8:28 ` [LTP] " linuxtestproject.agent
2026-08-31  4:19 [LTP] [PATCH v5] " Pavithra
2026-08-31  9:12 ` [LTP] " linuxtestproject.agent
2026-08-09 17:49 [LTP] [PATCH v4] " Pavithra
2026-08-09 18:42 ` [LTP] " linuxtestproject.agent
2026-08-09 16:22 [LTP] [PATCH v3] " Pavithra
2026-08-09 16:38 ` [LTP] " linuxtestproject.agent
2026-08-09 15:15 [LTP] [PATCH v3] " Pavithra
2026-08-09 15:34 ` [LTP] " linuxtestproject.agent
2026-07-17 16:02 [LTP] [PATCH] " Pavithra
2026-07-17 17:15 ` [LTP] " linuxtestproject.agent

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=20260909103028.9066-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=pavrampu@linux.ibm.com \
    /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.