File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 11
11
#include <linux/mutex.h>
12
12
#include <linux/time64.h>
13
13
#include <linux/types.h>
14
+ #include <linux/random.h>
14
15
15
16
/* Minimal region size. Every damon_region is aligned by this. */
16
17
#define DAMON_MIN_REGION PAGE_SIZE
17
18
/* Max priority score for DAMON-based operation schemes */
18
19
#define DAMOS_MAX_SCORE (99)
19
20
21
+ /* Get a random number in [l, r) */
22
+ #define damon_rand (l , r ) (l + prandom_u32_max(r - l))
23
+
20
24
/**
21
25
* struct damon_addr_range - Represents an address region of [@start, @end).
22
26
* @start: Start address of the region (inclusive).
Original file line number Diff line number Diff line change 11
11
#include <linux/delay.h>
12
12
#include <linux/kthread.h>
13
13
#include <linux/mm.h>
14
- #include <linux/random.h>
15
14
#include <linux/slab.h>
16
15
#include <linux/string.h>
17
16
23
22
#define DAMON_MIN_REGION 1
24
23
#endif
25
24
26
- /* Get a random number in [l, r) */
27
- #define damon_rand (l , r ) (l + prandom_u32_max(r - l))
28
-
29
25
static DEFINE_MUTEX (damon_lock );
30
26
static int nr_running_ctxs ;
31
27
Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
#include <linux/damon.h>
9
- #include <linux/random.h>
10
-
11
- /* Get a random number in [l, r) */
12
- #define damon_rand (l , r ) (l + prandom_u32_max(r - l))
13
9
14
10
struct page * damon_get_page (unsigned long pfn );
15
11
You can’t perform that action at this time.
0 commit comments