public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: Pavithra <pavrampu@linux.ibm.com>
Cc: pavrampu@linux.ibm.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] [PATCH v5] Migrating the libhugetlbfs/testcases/truncate_above_4GB.c test
Date: Mon, 23 Mar 2026 07:47:49 +0000	[thread overview]
Message-ID: <69c0f029.050a0220.a284a.7ad8@mx.google.com> (raw)
In-Reply-To: <20260312055531.359885-1-pavrampu@linux.ibm.com>

Hi Pavithra,

The following is just a coding style/conventions review, not a logic
review. I will leave that for people who worked on huge files.

---------

The subject line should follow LTP conventions:

  hugemmap: Add test for hugepage truncation above 4GB

> Changes in v5:
> - Modified code to use FOURGIG instead of truncate_point.

Same issue as noted on your previous patch: the commit body should
explain *why* the test is being added — what kernel bug it guards
against, what it verifies. Changelog entries belong below the ---
separator in the patch email, not in the commit body.

> + *[Descripiton]

Missing space after *, "Descripiton" is misspelled, and [Description]
is a deprecated label in LTP doc comments. Drop the label entirely —
the existing description text below it is fine on its own:

  /*\
   * At one stage, a misconversion of hugetlb_vmtruncate_list to a
   * ...

> +static void sigbus_handler_fail(int signum, siginfo_t *si, void *uc)
> +{
> +	siglongjmp(sig_escape, 17);
> +}
> +
> +static void sigbus_handler_pass(int signum, siginfo_t *si, void *uc)

All three parameters are unused in both handlers, producing a compiler
warning for 'uc'. Mark them with LTP_ATTRIBUTE_UNUSED:

  static void sigbus_handler_fail(int signum LTP_ATTRIBUTE_UNUSED,
                                  siginfo_t *si LTP_ATTRIBUTE_UNUSED,
                                  void *uc LTP_ATTRIBUTE_UNUSED)

Apply the same to sigbus_handler_pass.

> +	static long long buggy_offset;
> +	...
> +	buggy_offset = FOURGIG / (hpage_size / page_size);
> +	buggy_offset = (long long)PALIGN(buggy_offset, hpage_size);

buggy_offset is recomputed from global statics, make it public instead.

> +cleanup:
> +	SAFE_MUNMAP(q, 3*hpage_size);
> +	SAFE_MUNMAP(p, hpage_size);

p == q + 2*hpage_size, which falls within [q, q + 3*hpage_size). The
first SAFE_MUNMAP already covers p's region, so the second call is a
redundant double-unmap.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

      reply	other threads:[~2026-03-23  7:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12  5:55 [LTP] [PATCH] [PATCH v5] Migrating the libhugetlbfs/testcases/truncate_above_4GB.c test Pavithra
2026-03-23  7:47 ` Andrea Cervesato via ltp [this message]

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=69c0f029.050a0220.a284a.7ad8@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox