• T
    percpu: give more latitude to arch specific first chunk initialization · 8d408b4b
    Tejun Heo 提交于
    Impact: more latitude for first percpu chunk allocation
    
    The first percpu chunk serves the kernel static percpu area and may or
    may not contain extra room for further dynamic allocation.
    Initialization of the first chunk needs to be done before normal
    memory allocation service is up, so it has its own init path -
    pcpu_setup_static().
    
    It seems archs need more latitude while initializing the first chunk
    for example to take advantage of large page mapping.  This patch makes
    the following changes to allow this.
    
    * Define PERCPU_DYNAMIC_RESERVE to give arch hint about how much space
      to reserve in the first chunk for further dynamic allocation.
    
    * Rename pcpu_setup_static() to pcpu_setup_first_chunk().
    
    * Make pcpu_setup_first_chunk() much more flexible by fetching page
      pointer by callback and adding optional @unit_size, @free_size and
      @base_addr arguments which allow archs to selectively part of chunk
      initialization to their likings.
    Signed-off-by: NTejun Heo <tj@kernel.org>
    8d408b4b
percpu.h 4.8 KB