aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2017-06-05 14:28:28 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2017-06-05 14:28:28 -0400
commitc652e8d303af087269b93eac7c4bf52626818f7f (patch)
tree8ec5dff7035f205bcf8398630efe04fd488a5b0f
parent9b5f4aab419ba370062e28231f6910292813a9c9 (diff)
Added vmalloc_color()
-rw-r--r--include/linux/vmalloc.h1
-rw-r--r--mm/page_alloc.c3
-rw-r--r--mm/vmalloc.c16
3 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 0ec598381f97..c82054890d77 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -67,6 +67,7 @@ static inline void vmalloc_init(void)
67#endif 67#endif
68 68
69extern void *vmalloc(unsigned long size); 69extern void *vmalloc(unsigned long size);
70extern void *vmalloc_color(unsigned long size);
70extern void *vzalloc(unsigned long size); 71extern void *vzalloc(unsigned long size);
71extern void *vmalloc_user(unsigned long size); 72extern void *vmalloc_user(unsigned long size);
72extern void *vmalloc_node(unsigned long size, int node); 73extern void *vmalloc_node(unsigned long size, int node);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 45cce6a34295..4611656df49a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1183,9 +1183,6 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
1183 1183
1184 if (order == 0 && color_req == 1) { 1184 if (order == 0 && color_req == 1) {
1185 int found = 0; 1185 int found = 0;
1186 /* Colored page request with order = 0 */
1187 if (is_realtime(current))
1188 printk(KERN_INFO "COLORED PAGE IS REQUESTED on CPU%d\n", cpu);
1189 /* Find a page of the appropriate size in the preferred list */ 1186 /* Find a page of the appropriate size in the preferred list */
1190 for (current_order = order; current_order < MAX_PARTITIONED_ORDER; ++current_order) { 1187 for (current_order = order; current_order < MAX_PARTITIONED_ORDER; ++current_order) {
1191 area = &(zone->free_area_d[cpu][current_order]); 1188 area = &(zone->free_area_d[cpu][current_order]);
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 2faaa2976447..27600f419126 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1746,6 +1746,22 @@ void *vmalloc(unsigned long size)
1746EXPORT_SYMBOL(vmalloc); 1746EXPORT_SYMBOL(vmalloc);
1747 1747
1748/** 1748/**
1749 * vmalloc_color - allocate virtually contiguous memory from a dedicated free_area
1750 * @size: allocation size
1751 * Allocate enough pages to cover @size from the page level
1752 * allocator and map them into contiguous kernel virtual space.
1753 *
1754 * For tight control over page level allocator and protection flags
1755 * use __vmalloc() instead.
1756 */
1757void *vmalloc_color(unsigned long size)
1758{
1759 return __vmalloc_node_flags(size, NUMA_NO_NODE,
1760 GFP_KERNEL | __GFP_HIGHMEM | GFP_COLOR);
1761}
1762EXPORT_SYMBOL(vmalloc_color);
1763
1764/**
1749 * vzalloc - allocate virtually contiguous memory with zero fill 1765 * vzalloc - allocate virtually contiguous memory with zero fill
1750 * @size: allocation size 1766 * @size: allocation size
1751 * Allocate enough pages to cover @size from the page level 1767 * Allocate enough pages to cover @size from the page level