lkml.org 
[lkml]   [2008]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes
    Peter Zijlstra a écrit :
    > On Thu, 2008-11-27 at 00:32 +0100, Eric Dumazet wrote:
    >> Avoids cache line ping pongs between cpus and prepare next patch,
    >> because updates of nr_inodes metric dont need inode_lock anymore.
    >>
    >> (socket8 bench result : 25s to 20.5s)
    >>
    >> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
    >> ---
    >
    >> @@ -96,9 +96,40 @@ static DEFINE_MUTEX(iprune_mutex);
    >> * Statistics gathering..
    >> */
    >> struct inodes_stat_t inodes_stat;
    >> +static DEFINE_PER_CPU(int, nr_inodes);
    >>
    >> static struct kmem_cache * inode_cachep __read_mostly;
    >>
    >> +int get_nr_inodes(void)
    >> +{
    >> + int cpu;
    >> + int counter = 0;
    >> +
    >> + for_each_possible_cpu(cpu)
    >> + counter += per_cpu(nr_inodes, cpu);
    >> + if (counter < 0)
    >> + counter = 0;
    >> + return counter;
    >> +}
    >
    > It would be good to get a cpu hotplug handler here and move to
    > for_each_online_cpu(). People are wanting distro's to be build with
    > NR_CPUS=4096.

    Hum, I guess we can use regular percpu_counter for this...


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2008-11-27 11:05    [W:4.484 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site