lkml.org 
[lkml]   [2013]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/3] percpu: little optimization on calculating pcpu_unit_size
    Date
    pcpu_unit_size exactly equals to ai->unit_size.

    This patch assign this value instead of calculating from pcpu_unit_pages. Also
    it reorder them to make it looks more friendly to audience.

    Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
    ---
    mm/percpu.c | 4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/mm/percpu.c b/mm/percpu.c
    index 4f710a4f..74677e0 100644
    --- a/mm/percpu.c
    +++ b/mm/percpu.c
    @@ -1300,8 +1300,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
    pcpu_unit_offsets = unit_off;

    /* determine basic parameters */
    - pcpu_unit_pages = ai->unit_size >> PAGE_SHIFT;
    - pcpu_unit_size = pcpu_unit_pages << PAGE_SHIFT;
    + pcpu_unit_size = ai->unit_size;
    + pcpu_unit_pages = pcpu_unit_size >> PAGE_SHIFT;
    pcpu_atom_size = ai->atom_size;
    pcpu_chunk_struct_size = sizeof(struct pcpu_chunk) +
    BITS_TO_LONGS(pcpu_unit_pages) * sizeof(unsigned long);
    --
    1.7.5.4


    \
     
     \ /
      Last update: 2013-10-21 11:41    [W:3.491 / U:0.336 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site