* [PATCH] selftests/vm: fix link error for transhuge-stress test
@ 2015-01-07 18:35 Andrey Skvortsov
[not found] ` <1420655754-10076-1-git-send-email-Andrej.Skvortzov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Andrey Skvortsov @ 2015-01-07 18:35 UTC (permalink / raw)
To: Shuah Khan, Andrew Morton, Konstantin Khlebnikov, linux-api,
linux-kernel
Cc: Andrey Skvortsov
add -lrt to fix undefined reference to `clock_gettime'
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
---
tools/testing/selftests/vm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 4c4b1f6..077828c 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -7,7 +7,7 @@ BINARIES += transhuge-stress
all: $(BINARIES)
%: %.c
- $(CC) $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -o $@ $^ -lrt
run_tests: all
@/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/vm: fix link error for transhuge-stress test
[not found] ` <1420655754-10076-1-git-send-email-Andrej.Skvortzov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-07 19:21 ` Shuah Khan
2015-01-07 20:10 ` Andrey Skvortsov
0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2015-01-07 19:21 UTC (permalink / raw)
To: Andrey Skvortsov, Andrew Morton, Konstantin Khlebnikov,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On 01/07/2015 11:35 AM, Andrey Skvortsov wrote:
> add -lrt to fix undefined reference to `clock_gettime'
>
> Signed-off-by: Andrey Skvortsov <andrej.skvortzov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> tools/testing/selftests/vm/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> index 4c4b1f6..077828c 100644
> --- a/tools/testing/selftests/vm/Makefile
> +++ b/tools/testing/selftests/vm/Makefile
> @@ -7,7 +7,7 @@ BINARIES += transhuge-stress
>
> all: $(BINARIES)
> %: %.c
> - $(CC) $(CFLAGS) -o $@ $^
> + $(CC) $(CFLAGS) -o $@ $^ -lrt
>
> run_tests: all
> @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1)
>
Andrey,
I don't see any undefined references when I build. Curious if it is
specific to your env??
Please include the warning in the change log
when you fix warnings in the future.
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/vm: fix link error for transhuge-stress test
2015-01-07 19:21 ` Shuah Khan
@ 2015-01-07 20:10 ` Andrey Skvortsov
2015-01-08 15:55 ` Shuah Khan
0 siblings, 1 reply; 5+ messages in thread
From: Andrey Skvortsov @ 2015-01-07 20:10 UTC (permalink / raw)
To: Shuah Khan; +Cc: Andrew Morton, Konstantin Khlebnikov, linux-api, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2029 bytes --]
On Wed, Jan 07, 2015 at 12:21:18PM -0700, Shuah Khan wrote:
> On 01/07/2015 11:35 AM, Andrey Skvortsov wrote:
> > add -lrt to fix undefined reference to `clock_gettime'
> >
> > Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
> > ---
> > tools/testing/selftests/vm/Makefile | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
> > index 4c4b1f6..077828c 100644
> > --- a/tools/testing/selftests/vm/Makefile
> > +++ b/tools/testing/selftests/vm/Makefile
> > @@ -7,7 +7,7 @@ BINARIES += transhuge-stress
> >
> > all: $(BINARIES)
> > %: %.c
> > - $(CC) $(CFLAGS) -o $@ $^
> > + $(CC) $(CFLAGS) -o $@ $^ -lrt
> >
> > run_tests: all
> > @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1)
> >
>
> Andrey,
>
> I don't see any undefined references when I build. Curious if it is
> specific to your env??
>
> Please include the warning in the change log
> when you fix warnings in the future.
>
thanks for the comment.
Here is what I get without a patch:
linux-next/tools/testing/selftests/vm $ make
gcc -Wall -o hugepage-mmap hugepage-mmap.c
gcc -Wall -o hugepage-shm hugepage-shm.c
gcc -Wall -o map_hugetlb map_hugetlb.c
gcc -Wall -o thuge-gen thuge-gen.c
gcc -Wall -o hugetlbfstest hugetlbfstest.c
gcc -Wall -o transhuge-stress transhuge-stress.c
/tmp/ccpWoqkG.o: In function `main':
transhuge-stress.c:(.text+0x3a3): undefined reference to
`clock_gettime'
transhuge-stress.c:(.text+0x4dc): undefined reference to
`clock_gettime'
collect2: ld returned 1 exit status
make: *** [transhuge-stress] Error 1
$ gcc --version
gcc (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4.
The same error I get on my other Debian system.
man page for clock_gettime says 'Link with -lrt'. So I think the error
message is correct.
--
Best regards,
Andrey Skvortsov
Secure e-mail with gnupg: See http://www.gnupg.org/
PGP Key ID: 0x57A3AEAD
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/vm: fix link error for transhuge-stress test
2015-01-07 20:10 ` Andrey Skvortsov
@ 2015-01-08 15:55 ` Shuah Khan
2015-01-08 21:30 ` Andrey Skvortsov
0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2015-01-08 15:55 UTC (permalink / raw)
To: Andrey Skvortsov, Andrew Morton, Konstantin Khlebnikov, linux-api,
linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/07/2015 01:10 PM, Andrey Skvortsov wrote:
> On Wed, Jan 07, 2015 at 12:21:18PM -0700, Shuah Khan wrote:
>> On 01/07/2015 11:35 AM, Andrey Skvortsov wrote:
>>> add -lrt to fix undefined reference to `clock_gettime'
>>>
>>> Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
>>> --- tools/testing/selftests/vm/Makefile | 2 +- 1 file
>>> changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/testing/selftests/vm/Makefile
>>> b/tools/testing/selftests/vm/Makefile index 4c4b1f6..077828c
>>> 100644 --- a/tools/testing/selftests/vm/Makefile +++
>>> b/tools/testing/selftests/vm/Makefile @@ -7,7 +7,7 @@ BINARIES
>>> += transhuge-stress
>>>
>>> all: $(BINARIES) %: %.c - $(CC) $(CFLAGS) -o $@ $^ + $(CC)
>>> $(CFLAGS) -o $@ $^ -lrt
>>>
>>> run_tests: all @/bin/sh ./run_vmtests || (echo "vmtests:
>>> [FAIL]"; exit 1)
>>>
>>
>> Andrey,
>>
>> I don't see any undefined references when I build. Curious if it
>> is specific to your env??
>>
>> Please include the warning in the change log when you fix
>> warnings in the future.
>>
>
> thanks for the comment.
>
> Here is what I get without a patch:
>
> linux-next/tools/testing/selftests/vm $ make gcc -Wall -o
> hugepage-mmap hugepage-mmap.c gcc -Wall -o hugepage-shm
> hugepage-shm.c gcc -Wall -o map_hugetlb map_hugetlb.c gcc -Wall -o
> thuge-gen thuge-gen.c gcc -Wall -o hugetlbfstest hugetlbfstest.c
> gcc -Wall -o transhuge-stress transhuge-stress.c /tmp/ccpWoqkG.o:
> In function `main': transhuge-stress.c:(.text+0x3a3): undefined
> reference to `clock_gettime' transhuge-stress.c:(.text+0x4dc):
> undefined reference to `clock_gettime' collect2: ld returned 1 exit
> status make: *** [transhuge-stress] Error 1
>
>
> $ gcc --version gcc (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4. The
> same error I get on my other Debian system.
>
> man page for clock_gettime says 'Link with -lrt'. So I think the
> error message is correct.
>
Thanks for fixing it. Applied to linux-kselftest fixes branch
- -- Shuah
- --
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBAgAGBQJUrqhtAAoJEAsCRMQNDUMcVkgP/if69SGYILLnnj+7oBIuXJGl
8QZVJRHKdN/8Tny7PVBDmerv8kTxbDfaJpJyHg8nSSFRyTmOKChNkO9mcR7TIXcP
KxQn5BjYYUvcPM9jZESTAOIdEcaKbsMjj2Yknf49o7ij9YgCBPvFbDOZtfk/oMtF
no3wGSuZPF4cRBvhfHJQdLMc87VeLSdz4eDBWZ7LX6EXlfWc8QH8iJhbLzmPp3pJ
ofFKKeoaOrlcb/tQPdfSbWvVXZmWpJa8YdDGc2V+w6gahjPeWffe3ZTSyS4dwKZ+
Ayt4F2ptxu+/1fbOb9ZSFCrST2q+yavvXR5D/guK1EqIi1iRHJzq9QSNO8VJksG1
g+aCCTxI5qxHmmq2NandZ/UTttdxsUhPVO32IAFZcrq49gdPQqa/QuB0iI3fDevp
kqueiQj96wHr6zBFMgO6O+Vw/bmOjNdFOQUIv6iEJt1SbRtouBa4VVSRsbJijwGU
3jDZBmBhV/ntGuydqsPE1IAjQPO9nKk2rF7RZkx2OGx6Lc6kOk6BQ0eHnA/FgmcG
vZiHAIK99K9dEd926C+nV6pYK9UfPU/UKtmxIa/Z5At4oxN3SUKeZokmCFC7f2Ff
ueM0hLvEmfNTjSzGkx72RsdxE/6nU2kgYfNOGsJh4QuePrph9+orgHtb5qzZXmiA
Mf3pjHSWH0sqAXKfZZmF
=zsvn
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/vm: fix link error for transhuge-stress test
2015-01-08 15:55 ` Shuah Khan
@ 2015-01-08 21:30 ` Andrey Skvortsov
0 siblings, 0 replies; 5+ messages in thread
From: Andrey Skvortsov @ 2015-01-08 21:30 UTC (permalink / raw)
To: Shuah Khan; +Cc: Konstantin Khlebnikov, linux-api, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]
On Thu, Jan 08, 2015 at 08:55:25AM -0700, Shuah Khan wrote:
> On 01/07/2015 01:10 PM, Andrey Skvortsov wrote:
> > man page for clock_gettime says 'Link with -lrt'. So I think the
> > error message is correct.
> >
>
> Thanks for fixing it. Applied to linux-kselftest fixes branch
>
Hi Shuah,
thanks for taking the patch.
sorry for the late reply. I've just checked e-mail. Different
timezone. =)
I have couple questions about selftests/vm/hugetlbfstest. It is called by
make run_tests, but fails always on my machine.
What does it actually test? if I understand the code right,
it tests whether RSS (read from /proc/self/statm) grows/shrinks not much during
allocation/deallocation of 16Mb.
Here are couple of questions about some tests in the code.
1)
hugetlbfstest.c:75
do_mmap(-1, MAP_ANONYMOUS, 1);
it does not use hugetlbfs. So it does not correspond to the
actual test name. That confused me a little. Does it test usage of
transparent huge pages?
2)
hugetlbfstest.c:78
do_mmap(hugefd, 0, 1);
Despite the fact, that hugefd is open at wrong location
(run_tests script mounts hugetlbfs at ./huge) the test actually does
use hugetlbfs. Unfortunately on my machine it fails always too.
RSS does not grow after allocation, but is the same as before.
So assertion 'llabs(after - before - length) < 0x40000' fails.
But hugepages are definitely allocated, I can see that HugePages_Free decreases in
/proc/meminfo. To find this out I placed delays in the test code.
Does rss field in /proc/statm counts only normal non-huge pages?
--
Best regards,
Andrey Skvortsov
Secure e-mail with gnupg: See http://www.gnupg.org/
PGP Key ID: 0x57A3AEAD
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-01-08 21:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07 18:35 [PATCH] selftests/vm: fix link error for transhuge-stress test Andrey Skvortsov
[not found] ` <1420655754-10076-1-git-send-email-Andrej.Skvortzov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-07 19:21 ` Shuah Khan
2015-01-07 20:10 ` Andrey Skvortsov
2015-01-08 15:55 ` Shuah Khan
2015-01-08 21:30 ` Andrey Skvortsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).