-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ida: Move ida_bitmap to a percpu variable
When we preload the IDA, we allocate an IDA bitmap. Instead of storing that preallocated bitmap in the IDA, we store it in a percpu variable. Generally there are more IDAs in the system than CPUs, so this cuts down on the number of preallocated bitmaps that are unused, and about half of the IDA users did not call ida_destroy() so they were leaking IDA bitmaps. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
- Loading branch information
Matthew Wilcox
committed
Feb 14, 2017
1 parent
0a835c4
commit 7ad3d4d
Showing
5 changed files
with
51 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
|
||
#define DECLARE_PER_CPU(type, val) extern type val | ||
#define DEFINE_PER_CPU(type, val) type val | ||
|
||
#define __get_cpu_var(var) var | ||
#define this_cpu_ptr(var) var | ||
#define this_cpu_read(var) var | ||
#define this_cpu_xchg(var, val) uatomic_xchg(&var, val) | ||
#define this_cpu_cmpxchg(var, old, new) uatomic_cmpxchg(&var, old, new) | ||
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | ||
#define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu)) |