1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright(c) 2018 Intel Corporation. All rights reserved.
5 #include <linux/jump_label.h>
8 * SHUFFLE_ENABLE is called from the command line enabling path, or by
9 * platform-firmware enabling that indicates the presence of a
10 * direct-mapped memory-side-cache. SHUFFLE_FORCE_DISABLE is called from
11 * the command line path and overrides any previous or future
16 SHUFFLE_FORCE_DISABLE
,
19 #define SHUFFLE_ORDER (MAX_ORDER-1)
21 #ifdef CONFIG_SHUFFLE_PAGE_ALLOCATOR
22 DECLARE_STATIC_KEY_FALSE(page_alloc_shuffle_key
);
23 extern void page_alloc_shuffle(enum mm_shuffle_ctl ctl
);
24 extern void __shuffle_free_memory(pg_data_t
*pgdat
);
25 extern bool shuffle_pick_tail(void);
26 static inline void shuffle_free_memory(pg_data_t
*pgdat
)
28 if (!static_branch_unlikely(&page_alloc_shuffle_key
))
30 __shuffle_free_memory(pgdat
);
33 extern void __shuffle_zone(struct zone
*z
);
34 static inline void shuffle_zone(struct zone
*z
)
36 if (!static_branch_unlikely(&page_alloc_shuffle_key
))
41 static inline bool is_shuffle_order(int order
)
43 if (!static_branch_unlikely(&page_alloc_shuffle_key
))
45 return order
>= SHUFFLE_ORDER
;
48 static inline bool shuffle_pick_tail(void)
53 static inline void shuffle_free_memory(pg_data_t
*pgdat
)
57 static inline void shuffle_zone(struct zone
*z
)
61 static inline void page_alloc_shuffle(enum mm_shuffle_ctl ctl
)
65 static inline bool is_shuffle_order(int order
)
70 #endif /* _MM_SHUFFLE_H */