lkml.org 
[lkml]   [2015]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 05/13] percpu-rwsem: Optimize readers and reduce global impact
On Tue, Jun 23, 2015 at 09:28:11AM +0200, Nicholas Mc Guire wrote:
>
> A bit off-topic probably
> but maybe this should not be in kernel/locking/percpu-rwsem.c but in a
> generic percpu location as this construct is present in the core a few times
> atleast in:
> kernel/irq/irqdesc.c:kstat_irqs

> kernel/fork.c:nr_processes

That has an odd unsigned long vs int fail, but yes.

> mm/memcontrol.c:mem_cgroup_read_events
> mm/memcontrol.c:mem_cgroup_read_stat

Those seem to be hotplug challenged. I'm thinking dropping that
nocpu_base.count[] crap and just iterating all possible CPUs would've
been much easier.

> > +#define per_cpu_sum(var) \
> > +({ \
> > + typeof(var) __sum = 0; \
> > + int cpu; \
> > + for_each_possible_cpu(cpu) \
> > + __sum += per_cpu(var, cpu); \
> > + __sum; \
> > +})
> > +
>
> so maybe put it into include/linux/percpu.h ?

Yes I can do that.

We can try and use it more after that, there seems to be loads of places
that could use this fs/namespace.c fs/inode.c etc..


\
 
 \ /
  Last update: 2015-06-25 21:21    [W:0.201 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site