All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tarun Sahu <tsahu@linux.ibm.com>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: sbhat@linux.ibm.com, aneesh.kumar@linux.ibm.com,
	geetika@linux.ibm.com, vaibhav@linux.ibm.com,
	Richard Palethorpe <rpalethorpe@suse.com>,
	ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 1/4] Hugetlb: Add new tst_test options for hugeltb test support
Date: Mon, 31 Oct 2022 23:32:31 +0530	[thread overview]
Message-ID: <20221031180231.hgxcngfrwkkajii5@tarunpc> (raw)
In-Reply-To: <Y1/iBcq+iYFsxDJ+@yuki>

Hi Cyril,
Please find my comments inline.

On Oct 31 2022, Cyril Hrubis wrote:
> Hi!
> > Why not consider encapsulating these two new fields in 'struct
> > tst_hugepage' ?
> > 
> > Then the tst_test in the case can simply initialize to:
> > 
> > ....
> > static struct tst_test test = {
> >     .needs_root = 1,
> >     .taint_check = TST_TAINT_D | TST_TAINT_W,
> >     .setup = setup,
> >     .test_all = run_test,
> >     .hugepages = {1, TST_NEEDS, 1, 1},
> > };
> 
> I do not like that we have magic constants in the .hugepages that are
> not self describing. I would treat the hugetltbfs just as we treat
> devfs, that would be:
> 
> #define MNTPOINT "hugetlbfs/"
> #define HUGEFILE MNTPOINT "hugefile"
> 
> static int huge_fd;
> 
> static void setup(void)
> {
> 	huge_fd = tst_creat_unlinked(HUGEFILE);
> 	...
> }
> 
> static void cleanup(void)
> {
> 	if (huge_fd > 0)
> 		SAFE_CLOSE(huge_fd);
> }
> 
> static struct tst_test test = {
> 	...
> 	.mntpoint = MNTPOINT,
> 	.needs_hugetlbfs = 1,
> 	.setup = setup,
> 	.cleanup = cleanup,
> 	...
> }
> 
> 
> What do you think?
> 
My original idea behind putting it in tst_test struct instead of
tst_hugepages was based on below two reasoning-

1. tst_hugepages seems to have only hugepages related info. It would be
better to rename it to tst_hugetlb and rename <hugepages> field in tst_test
struct to <hugetlb>. If we rename it which will require changes in already
existing tests. and Moreover, there were similar field like needs_tmpdir
in tst_test so I put it(needs_unlinked_hugetlb_file) in tst_test.
2. There was already related fields in tst_test for mounting fs, like
needs_devfs, needs_rofs, So keeping all the needs_ABCfs at same structure.

> -- 
> Cyril Hrubis
> chrubis@suse.cz
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

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

  reply	other threads:[~2022-10-31 18:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29  7:13 [LTP] [PATCH v3 0/4] Hugetlb:Migrating the libhugetlbfs tests Tarun Sahu
2022-10-29  7:13 ` [LTP] [PATCH v3 1/4] Hugetlb: Add new tst_test options for hugeltb test support Tarun Sahu
2022-10-31  3:39   ` Li Wang
2022-10-31 11:08     ` Tarun Sahu
2022-10-31 14:49     ` Cyril Hrubis
2022-10-31 14:56     ` Cyril Hrubis
2022-10-31 18:02       ` Tarun Sahu [this message]
2022-11-01  2:05       ` Li Wang
2022-10-31 14:47   ` Cyril Hrubis
2022-10-31 19:25     ` Tarun Sahu
2022-11-02 13:38       ` Cyril Hrubis
2022-10-29  7:13 ` [LTP] [PATCH v3 2/4] Hugetlb: Migrating libhugetlbfs brk_near_huge Tarun Sahu
2022-10-29  7:13 ` [LTP] [PATCH v3 3/4] Hugetlb: Migrating libhugetlbfs chunk-overcommit Tarun Sahu
2022-10-31  7:34   ` Li Wang
2022-10-31 11:19     ` Tarun Sahu
2022-10-29  7:13 ` [LTP] [PATCH v3 4/4] Hugetlb: Migrating libhugetlbfs corrupt-by-cow-opt Tarun Sahu

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=20221031180231.hgxcngfrwkkajii5@tarunpc \
    --to=tsahu@linux.ibm.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=chrubis@suse.cz \
    --cc=geetika@linux.ibm.com \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.com \
    --cc=sbhat@linux.ibm.com \
    --cc=vaibhav@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.