From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Caspar Zhang <caspar@casparzhang.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v3 1/4] hugemmap01: auto mount the temporary dir for testing
Date: Wed, 08 Feb 2012 16:37:51 +0800 [thread overview]
Message-ID: <4F32345F.5030909@cn.fujitsu.com> (raw)
In-Reply-To: <4F3232EC.4030007@casparzhang.com>
On 02/08/2012 04:31 PM, Caspar Zhang wrote:
> On 02/08/2012 04:21 PM, Wanlong Gao wrote:
>> -static void setup(void)
>> +void setup(void)
>> {
>> - char mypid[40];
>> -
>> - sprintf(mypid, "/%d", getpid());
>> - TEMPFILE = strcat(mypid, TEMPFILE);
>> - TEMPFILE = strcat(Hopt, TEMPFILE);
>> -
>> - tst_sig(FORK, DEF_HANDLER, cleanup);
>> -
>> TEST_PAUSE;
>> -
>> + tst_require_root(NULL);
>> + if (mount("none", Hopt, "hugetlbfs", 0, NULL) < 0)
>> + tst_brkm(TBROK|TERRNO, NULL,
>> + "mount failed on %s", Hopt);
>> +
>> + set_sys_tune("nr_hugepages", hugepages, 1);
>> + snprintf(TEMPFILE, sizeof(TEMPFILE), "%s/mmapfile%d",
>> + Hopt, getpid());
>> }
>>
>> -static void cleanup(void)
>> +void cleanup(void)
>> {
>> TEST_CLEANUP;
>>
>> unlink(TEMPFILE);
>>
>> + umount(Hopt);
>> + tst_rmdir();
>> }
>
> Hi, I just have another concern, that you might want to keep the initial
> value of nr_hugepages and restore it once the test is done.
as set_sys_tune defined in mem lib, this restore work should be done there,
too.
right?
Thanks
-Wanlong Gao
>
> Thanks,
> Caspar
>
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2012-02-08 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1328689302-5506-1-git-send-email-gaowanlong@cn.fujitsu.com>
[not found] ` <1328689302-5506-2-git-send-email-gaowanlong@cn.fujitsu.com>
2012-02-08 8:31 ` [LTP] [PATCH v3 1/4] hugemmap01: auto mount the temporary dir for testing Caspar Zhang
2012-02-08 8:37 ` Wanlong Gao [this message]
2012-02-08 8:41 ` Caspar Zhang
2012-02-08 8:48 ` Wanlong Gao
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=4F32345F.5030909@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=caspar@casparzhang.com \
--cc=ltp-list@lists.sourceforge.net \
/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