mem.c: check whether MADV_MERGEABLE is available
PATCH 1/1 mem.c: check whether MADV_MERGEABLE is available
Before using MADV_MERGEABLE, check whether it's available by macro HAVE_MADV_MERGEABLE.
--- testcases/kernel/mem/lib/mem.c | 2 ++ 1 file changed, 2 insertions(+)
testcases/kernel/mem/lib/mem.c +2 -0
@@ -494,8 +494,10 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages) MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);if (memory[i] ==MAP_FAILED )tst_brkm (TBROK |TERRNO , tst_exit,"mmap" ); +#ifdef HAVE_MADV_MERGEABLE if (madvise (memory[i], length,MADV_MERGEABLE ) ==-1 )tst_brkm (TBROK |TERRNO , tst_exit,"madvise" ); +#endif #if HAVE_NUMA_H &&HAVE_LINUX_MEMPOLICY_H &&HAVE_NUMAIF_H \ &&HAVE_MPOL_CONSTANTS
Signature · 12 lines
1.7.11.rc0 ------------------------------------------------------------------------------ AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 9 lines
From: "DAN LI" <[email protected]>
To: "LTP list" <[email protected]>
Sent: Friday, 17 May, 2013 4:32:16 AM
Subject: [LTP] [PATCH]mem.c: check whetherMADV_MERGEABLEis availableBefore using
MADV_MERGEABLE, check whether it's available by macroHAVE_MADV_MERGEABLE.Signed-off-by DAN LI <[email protected]>
Small and straightforward change.
Quoted 22 lines
--- testcases/kernel/mem/lib/mem.c | 2 ++ 1 file changed, 2 insertions(+)testcases/kernel/mem/lib/mem.c +2
-1@@ -494,8 +494,10 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages) MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);if (memory[i] ==MAP_FAILED )tst_brkm (TBROK |TERRNO , tst_exit,"mmap" ); +#ifdef HAVE_MADV_MERGEABLE if (madvise (memory[i], length,MADV_MERGEABLE ) ==-1 )tst_brkm (TBROK |TERRNO , tst_exit,"madvise" ); +#endif #if HAVE_NUMA_H &&HAVE_LINUX_MEMPOLICY_H &&HAVE_NUMAIF_H \ &&HAVE_MPOL_CONSTANTS --1.7.11.rc0
Quoted 11 lines
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Wanlong Gao
AppliedQuoted 4 lines · DAN LI
Before using
MADV_MERGEABLE, check whether it's available by macroHAVE_MADV_MERGEABLE.Signed-off-by DAN LI <[email protected]>
Applied, thank you.
Wanlong Gao
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list