mirror of
https://github.com/torvalds/linux.git
synced 2024-09-21 15:33:19 +00:00
bcachefs: Don't disable preemption unnecessarily
Small improvements to some percpu utility code. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
297d89343d
commit
109a427712
|
@ -893,13 +893,9 @@ void eytzinger0_find_test(void)
|
||||||
*/
|
*/
|
||||||
u64 *bch2_acc_percpu_u64s(u64 __percpu *p, unsigned nr)
|
u64 *bch2_acc_percpu_u64s(u64 __percpu *p, unsigned nr)
|
||||||
{
|
{
|
||||||
u64 *ret;
|
u64 *ret = this_cpu_ptr(p);
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
preempt_disable();
|
|
||||||
ret = this_cpu_ptr(p);
|
|
||||||
preempt_enable();
|
|
||||||
|
|
||||||
for_each_possible_cpu(cpu) {
|
for_each_possible_cpu(cpu) {
|
||||||
u64 *i = per_cpu_ptr(p, cpu);
|
u64 *i = per_cpu_ptr(p, cpu);
|
||||||
|
|
||||||
|
|
|
@ -715,10 +715,7 @@ static inline void percpu_u64_set(u64 __percpu *dst, u64 src)
|
||||||
|
|
||||||
for_each_possible_cpu(cpu)
|
for_each_possible_cpu(cpu)
|
||||||
*per_cpu_ptr(dst, cpu) = 0;
|
*per_cpu_ptr(dst, cpu) = 0;
|
||||||
|
this_cpu_write(*dst, src);
|
||||||
preempt_disable();
|
|
||||||
*this_cpu_ptr(dst) = src;
|
|
||||||
preempt_enable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void acc_u64s(u64 *acc, const u64 *src, unsigned nr)
|
static inline void acc_u64s(u64 *acc, const u64 *src, unsigned nr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user