From: Cristian Greco <cristian@regolo.cc>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] Trivial fix for defines in mtest01.c.
Date: Fri, 21 Jan 2011 21:32:50 +0100 [thread overview]
Message-ID: <20110121213250.54f2e4f2@regolo> (raw)
Hi,
this is a trivial fix.
Signed-off-by: Cristian Greco <cristian@regolo.cc>
---
testcases/kernel/mem/mtest01/mtest01.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/testcases/kernel/mem/mtest01/mtest01.c b/testcases/kernel/mem/mtest01/mtest01.c
index 4c9390c..1afd78d 100644
--- a/testcases/kernel/mem/mtest01/mtest01.c
+++ b/testcases/kernel/mem/mtest01/mtest01.c
@@ -44,9 +44,9 @@
#include "test.h"
-#define FIVE_HUNDRED_KB (unsigned long long)(500*1024*1024)
-#define ONE_MEGABYTE (unsigned long long)(1024*1024*1024)
-#define THREE_MEGABYTES (unsigned long long)(3*ONE_MEGABYTE)
+#define FIVE_HUNDRED_MB (unsigned long long)(500*1024*1024)
+#define ONE_GIGABYTE (unsigned long long)(1024*1024*1024)
+#define THREE_GIGABYTES (unsigned long long)(3*ONE_GIGABYTE)
char *TCID = "mtest01";
int TST_TOTAL = 1;
@@ -128,7 +128,7 @@ int main(int argc, char* argv[])
total_free = sstats.freeram + sstats.freeswap;
/* Total Free Pre-Test RAM */
pre_mem = sstats.mem_unit * total_free;
- max_pids = total_ram / (unsigned long)FIVE_HUNDRED_KB + 1;
+ max_pids = total_ram / (unsigned long)FIVE_HUNDRED_MB + 1;
if ((pid_list = malloc(max_pids * sizeof(pid_t))) == NULL)
tst_brkm(TBROK|TERRNO, NULL, "malloc failed.");
@@ -171,47 +171,47 @@ int main(int argc, char* argv[])
pid_list[i] = pid;
#if defined (_s390_) /* s390's 31bit addressing requires smaller chunks */
- while (pid != 0 && maxbytes > FIVE_HUNDRED_KB) {
+ while (pid != 0 && maxbytes > FIVE_HUNDRED_MB) {
i++;
- maxbytes -= FIVE_HUNDRED_KB;
+ maxbytes -= FIVE_HUNDRED_MB;
pid = fork();
if (pid != 0) {
pid_cntr++;
pid_list[i] = pid;
}
}
- if (maxbytes > FIVE_HUNDRED_KB)
- alloc_bytes = FIVE_HUNDRED_KB;
+ if (maxbytes > FIVE_HUNDRED_MB)
+ alloc_bytes = FIVE_HUNDRED_MB;
else
alloc_bytes = (unsigned long) maxbytes;
#elif __WORDSIZE == 32
- while (pid != 0 && maxbytes > ONE_MEGABYTE) {
+ while (pid != 0 && maxbytes > ONE_GIGABYTE) {
i++;
- maxbytes -= ONE_MEGABYTE;
+ maxbytes -= ONE_GIGABYTE;
pid = fork();
if (pid != 0) {
pid_cntr++;
pid_list[i]=pid;
}
}
- if (maxbytes > ONE_MEGABYTE)
- alloc_bytes = ONE_MEGABYTE;
+ if (maxbytes > ONE_GIGABYTE)
+ alloc_bytes = ONE_GIGABYTE;
else
alloc_bytes = (unsigned long)maxbytes;
#elif __WORDSIZE == 64
- while (pid != 0 && maxbytes > THREE_MEGABYTES) {
+ while (pid != 0 && maxbytes > THREE_GIGABYTES) {
i++;
- maxbytes -= THREE_MEGABYTES;
+ maxbytes -= THREE_GIGABYTES;
pid = fork();
if (pid != 0) {
pid_cntr++;
pid_list[i] = pid;
}
}
- if (maxbytes > THREE_MEGABYTES)
- alloc_bytes = THREE_MEGABYTES;
+ if (maxbytes > THREE_GIGABYTES)
+ alloc_bytes = THREE_GIGABYTES;
else
alloc_bytes = maxbytes;
#endif
--
1.7.2.3
Thanks,
--
Cristian Greco
GPG key ID: 0xCF4D32E4
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2011-01-21 20:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-21 20:32 Cristian Greco [this message]
2011-01-23 7:01 ` [LTP] [PATCH] Trivial fix for defines in mtest01.c Garrett Cooper
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=20110121213250.54f2e4f2@regolo \
--to=cristian@regolo.cc \
--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 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.