lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150623072811.GB20073@opentech.at>
Date:	Tue, 23 Jun 2015 09:28:11 +0200
From:	Nicholas Mc Guire <der.herr@...r.at>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	oleg@...hat.com, paulmck@...ux.vnet.ibm.com, tj@...nel.org,
	mingo@...hat.com, linux-kernel@...r.kernel.org, dave@...olabs.net,
	riel@...hat.com, viro@...IV.linux.org.uk,
	torvalds@...ux-foundation.org
Subject: Re: [RFC][PATCH 05/13] percpu-rwsem: Optimize readers and reduce
	global impact


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
 mm/memcontrol.c:mem_cgroup_read_events
 mm/memcontrol.c:mem_cgroup_read_stat

> +
> +#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 ?

thx!
hofrat
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ