Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
132e1a23
Commit
132e1a23
authored
Jun 13, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: per_cpu_sum()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
63567f64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
fs/bcachefs/util.h
fs/bcachefs/util.h
+11
-6
No files found.
fs/bcachefs/util.h
View file @
132e1a23
...
@@ -698,14 +698,19 @@ do { \
...
@@ -698,14 +698,19 @@ do { \
} \
} \
} while (0)
} while (0)
#define per_cpu_sum(_p) \
({ \
typeof(*_p) _ret = 0; \
\
int cpu; \
for_each_possible_cpu(cpu) \
_ret += *per_cpu_ptr(_p, cpu); \
_ret; \
})
static
inline
u64
percpu_u64_get
(
u64
__percpu
*
src
)
static
inline
u64
percpu_u64_get
(
u64
__percpu
*
src
)
{
{
u64
ret
=
0
;
return
per_cpu_sum
(
src
);
int
cpu
;
for_each_possible_cpu
(
cpu
)
ret
+=
*
per_cpu_ptr
(
src
,
cpu
);
return
ret
;
}
}
static
inline
void
percpu_u64_set
(
u64
__percpu
*
dst
,
u64
src
)
static
inline
void
percpu_u64_set
(
u64
__percpu
*
dst
,
u64
src
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment