----- Original Message -----
> From: "Nishanth Aravamudan" <n...@linux.vnet.ibm.com>
> To: "Eric Munson" <emun...@mgebm.net>
> Cc: libhugetlbfs-devel@lists.sourceforge.net, "Chunrong Guo" 
> <b40...@freescale.com>, "Becky Bruce"
> <bec...@kernel.crashing.org>, jstan...@redhat.com
> Sent: Thursday, 27 February, 2014 9:48:41 PM
> Subject: [PATCH] libhugetlbfs: segment-based alignment restrictions exist on 
> pseries
> 
> Commit 8d5390c4 ("libhugetlbfs: Remove segment-based alignment
> restrictions") defined the CPPFLAG PPC_NO_SEGMENTS, because BookE
> Freescale processors don't have this restriction. However it is defined
> globally and thus is also applied to 32-bit builds on pseries hardware.
> This is simply incorrect and breaks the 32-bit malloc testcases (which
> fail to align the heap address correctly) on ppc64, because there is no
> situation where PPC_NO_SEGMENTS is not defined.
> 
> I believe the right fix is to only define this flag when we are on a
> natively 32-bit platform. With this change, the malloc testcase pass
> again.
> 
> Signed-off-by: Nishanth Aravamudan <n...@linux.vnet.ibm.com>

Tested-by: Jan Stancek <jstan...@redhat.com>

I can confirm, that this patch fixes the failures in 32bit malloc/malloc_many
testcases on ppc64 for me (libhugetlbfs-2.17).

Without patch:
LD_PRELOAD=libhugetlbfs.so HUGETLB_MORECORE=yes malloc (16M: 32):       FAIL    
Address is not hugepage
LD_PRELOAD=libhugetlbfs.so HUGETLB_RESTRICT_EXE=unknown:none 
HUGETLB_MORECORE=yes malloc (16M: 32):     PASS
LD_PRELOAD=libhugetlbfs.so HUGETLB_RESTRICT_EXE=unknown:malloc 
HUGETLB_MORECORE=yes malloc (16M: 32):   FAIL    Address is not hugepage
LD_PRELOAD=libhugetlbfs.so HUGETLB_MORECORE=yes malloc_manysmall (16M: 32):     
FAIL    Address is not hugepage

With patch:
LD_PRELOAD=libhugetlbfs.so HUGETLB_MORECORE=yes malloc (16M: 32):       PASS
LD_PRELOAD=libhugetlbfs.so HUGETLB_RESTRICT_EXE=unknown:none 
HUGETLB_MORECORE=yes malloc (16M: 32):     PASS
LD_PRELOAD=libhugetlbfs.so HUGETLB_RESTRICT_EXE=unknown:malloc 
HUGETLB_MORECORE=yes malloc (16M: 32):   PASS
LD_PRELOAD=libhugetlbfs.so HUGETLB_MORECORE=yes malloc_manysmall (16M: 32):     
PASS

> 
> diff --git a/Makefile b/Makefile
> index ccd9a3f..145b53d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -30,7 +30,7 @@ INSTALL = install
>  LDFLAGS += -Wl,-z,noexecstack -ldl
>  CFLAGS ?= -O2 -g
>  CFLAGS += -Wall -fPIC
> -CPPFLAGS += -D__LIBHUGETLBFS__ -DPPC_NO_SEGMENTS
> +CPPFLAGS += -D__LIBHUGETLBFS__
>  
>  ARCH = $(shell uname -m | sed -e s/i.86/i386/)
>  CC = gcc
> @@ -57,6 +57,7 @@ ifeq ($(ARCH),ppc)
>  CC32 = $(CC) -m32
>  ELF32 = elf32ppclinux
>  TMPLIB32 = lib
> +CPPFLAGS += -DPPC_NO_SEGMENTS
>  else
>  ifeq ($(ARCH),armv7l)
>  CC32 = $(CC)
> 
> 

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to