diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2023-02-11 05:11:01 +0300 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2023-02-11 05:11:01 +0300 |
| commit | b8b9ffced017528bcdd262730ab10bc5084c3bb4 (patch) | |
| tree | 1edb4782acb2d6704f3847181a480f375214a40f /include | |
| parent | dfd423e0a3256f88b8ea622fbbe04f91594195b6 (diff) | |
| parent | 09d09e04d2fcf88c4620dd28097e0e2a8f720eac (diff) | |
| download | linux-b8b9ffced017528bcdd262730ab10bc5084c3bb4.tar.xz | |
Merge branch 'for-6.3/cxl-ram-region' into cxl/next
Include the support for enumerating and provisioning ram regions for
v6.3. This also include a default policy change for ram / volatile
device-dax instances to assign them to the dax_kmem driver by default.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/dax.h | 7 | ||||
| -rw-r--r-- | include/linux/memregion.h | 2 | ||||
| -rw-r--r-- | include/linux/range.h | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 2b5ecb591059..bf6258472e49 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -262,11 +262,14 @@ static inline bool dax_mapping(struct address_space *mapping) } #ifdef CONFIG_DEV_DAX_HMEM_DEVICES -void hmem_register_device(int target_nid, struct resource *r); +void hmem_register_resource(int target_nid, struct resource *r); #else -static inline void hmem_register_device(int target_nid, struct resource *r) +static inline void hmem_register_resource(int target_nid, struct resource *r) { } #endif +typedef int (*walk_hmem_fn)(struct device *dev, int target_nid, + const struct resource *res); +int walk_hmem_resources(struct device *dev, walk_hmem_fn fn); #endif diff --git a/include/linux/memregion.h b/include/linux/memregion.h index bf83363807ac..c01321467789 100644 --- a/include/linux/memregion.h +++ b/include/linux/memregion.h @@ -3,10 +3,12 @@ #define _MEMREGION_H_ #include <linux/types.h> #include <linux/errno.h> +#include <linux/range.h> #include <linux/bug.h> struct memregion_info { int target_node; + struct range range; }; #ifdef CONFIG_MEMREGION diff --git a/include/linux/range.h b/include/linux/range.h index 274681cc3154..7efb6a9b069b 100644 --- a/include/linux/range.h +++ b/include/linux/range.h @@ -13,6 +13,11 @@ static inline u64 range_len(const struct range *range) return range->end - range->start + 1; } +static inline bool range_contains(struct range *r1, struct range *r2) +{ + return r1->start <= r2->start && r1->end >= r2->end; +} + int add_range(struct range *range, int az, int nr_range, u64 start, u64 end); |
