make check fails on rhel5/ppc

Jason Evans jasone at canonware.com
Wed Mar 28 15:59:36 PDT 2012


On Mar 27, 2012, at 4:08 AM, Ingvar Hagelund wrote:
> ti., 27.03.2012 kl. 11.10 +0200, skrev Ingvar Hagelund:
>> * Ingvar Hagelund wrote:
>>>> With the proposed atomic operations for ppc patch, I can finally build
>>>> jemalloc-2.2.5 on rhel5/ppc. make check fails like this for all but the
>>>> bitmap test.
>>>> 
>>>> Too many small size classes (269 > max 256)
>>>> 
>>>> More details below.
>>>> 
>>>> Is this just missing tuning? Where are the knobs to turn?
>> 
>> * Jason Evans wrote:
>>> Something terrible must be wrong with the configuration. Quantum and page size are the most likely culprits; what are they set at?
>> 
>> Page size on rhel5/ppc64 is 64k. This should really be picked up by
>> configure, for example via getconf, not hard coded.
>> 
>> rhel5_ppc64$ getconf PAGESIZE
>> 65536
> 
> Looking a bit on the code, it seems autodetection is actually done. And
> it does not work even when hardcoding the pagesize to 64k (same
> results).
> 
> Any other ideas?

I poked around for a bit and realized that the 64 KiB page size is just beyond the design limits for jemalloc 2.2.x; small size classes are spaced every 266 bytes for most of the size class range, so the total number of size classes does end up being 269 (which is bad for fragmentation, by the way).  This isn't a problem for the dev branch, because of this change:

	http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git;a=commitdiff;h=b172610317babc7f365584ddd7fdaf4eb8d9d04c

The size class table for rhel5/ppc64 is probably as follows:

#if (LG_TINY_MIN == 3 && LG_QUANTUM == 4 && PAGE_SHIFT == 16)
#define SIZE_CLASSES_DEFINED
/*  SIZE_CLASS(bin,     delta,  sz) */
#define SIZE_CLASSES                                                    \
    SIZE_CLASS(0,       8,      8)                                      \
    SIZE_CLASS(1,       8,      16)                                     \
    SIZE_CLASS(2,       16,     32)                                     \
    SIZE_CLASS(3,       16,     48)                                     \
    SIZE_CLASS(4,       16,     64)                                     \
    SIZE_CLASS(5,       16,     80)                                     \
    SIZE_CLASS(6,       16,     96)                                     \
    SIZE_CLASS(7,       16,     112)                                    \
    SIZE_CLASS(8,       16,     128)                                    \
    SIZE_CLASS(9,       32,     160)                                    \
    SIZE_CLASS(10,      32,     192)                                    \
    SIZE_CLASS(11,      32,     224)                                    \
    SIZE_CLASS(12,      32,     256)                                    \
    SIZE_CLASS(13,      64,     320)                                    \
    SIZE_CLASS(14,      64,     384)                                    \
    SIZE_CLASS(15,      64,     448)                                    \
    SIZE_CLASS(16,      64,     512)                                    \
    SIZE_CLASS(17,      128,    640)                                    \
    SIZE_CLASS(18,      128,    768)                                    \
    SIZE_CLASS(19,      128,    896)                                    \
    SIZE_CLASS(20,      128,    1024)                                   \
    SIZE_CLASS(21,      256,    1280)                                   \
    SIZE_CLASS(22,      256,    1536)                                   \
    SIZE_CLASS(23,      256,    1792)                                   \
    SIZE_CLASS(24,      256,    2048)                                   \
    SIZE_CLASS(25,      512,    2560)                                   \
    SIZE_CLASS(26,      512,    3072)                                   \
    SIZE_CLASS(27,      512,    3584)                                   \
    SIZE_CLASS(28,      512,    4096)                                   \
    SIZE_CLASS(29,      1024,   5120)                                   \
    SIZE_CLASS(30,      1024,   6144)                                   \
    SIZE_CLASS(31,      1024,   7168)                                   \
    SIZE_CLASS(32,      1024,   8192)                                   \
    SIZE_CLASS(33,      2048,   10240)                                  \
    SIZE_CLASS(34,      2048,   12288)                                  \
    SIZE_CLASS(35,      2048,   14336)                                  \
    SIZE_CLASS(36,      2048,   16384)                                  \
    SIZE_CLASS(37,      4096,   20480)                                  \
    SIZE_CLASS(38,      4096,   24576)                                  \
    SIZE_CLASS(39,      4096,   28672)                                  \
    SIZE_CLASS(40,      4096,   32768)                                  \
    SIZE_CLASS(41,      8192,   40960)                                  \
    SIZE_CLASS(42,      8192,   49152)                                  \
    SIZE_CLASS(43,      8192,   57344)                                  \

#define NBINS           44
#define SMALL_MAXCLASS  57344
#endif

The diff that fixes this issue is more than I feel comfortable back porting, so unless you want to patch the jemalloc code to change LG_SUBPAGE in your srpm, jemalloc isn't going to work on that platform until 3.0.0.

Thanks,
Jason


More information about the jemalloc-discuss mailing list