• Nick Piggin's avatar
    [PATCH] fix PID hash sizing · 2c05d9eb
    Nick Piggin authored
    A 4GB, 4-way Opteron would create the smallest size table (16 entries) because
    pidhash_init is called before mem_init which is where x86-64 sets up max_pfn.
    
    nr_kernel_pages is setup by paging_init, called from setup_arch, which is also
    where i386 sets up max_pfn.
    
    So export nr_kernel_pages, nr_all_pages.  Use nr_kernel_pages when sizing the
    PID hash.  This fixes the problem.
    
    This also makes the pid hash dependant on the size of ZONE_NORMAL instead of
    total size of memory.
    Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    2c05d9eb
pid.c 7.57 KB