summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2021-05-04 18:37:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-05-05 11:27:24 -0700
commit78fa51503fdbe463c96eef4c3cf69ca54032647a (patch)
treed5159574ddf321d8d86d47b01d41c6f6fe93e68b /include
parent3aab8ae7aace3388da319a233edf48f0f5d26a44 (diff)
mm: use proper type for cma_[alloc|release]
size_t in cma_alloc is confusing since it makes people think it's byte count, not pages. Change it to unsigned long[1]. The unsigned int in cma_release is also not right so change it. Since we have unsigned long in cma_release, free_contig_range should also respect it. [1] 67a2e213e7e9, mm: cma: fix incorrect type conversion for size during dma allocation Link: https://lore.kernel.org/linux-mm/20210324043434.GP1719932@casper.infradead.org/ Link: https://lkml.kernel.org/r/20210331164018.710560-1-minchan@kernel.org Signed-off-by: Minchan Kim <minchan@kernel.org> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cma.h4
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/trace/events/cma.h22
3 files changed, 14 insertions, 14 deletions
diff --git a/include/linux/cma.h b/include/linux/cma.h
index 217999c8a762..53fd8c3cdbd0 100644
--- a/include/linux/cma.h
+++ b/include/linux/cma.h
@@ -44,9 +44,9 @@ extern int cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,
unsigned int order_per_bit,
const char *name,
struct cma **res_cma);
-extern struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
+extern struct page *cma_alloc(struct cma *cma, unsigned long count, unsigned int align,
bool no_warn);
-extern bool cma_release(struct cma *cma, const struct page *pages, unsigned int count);
+extern bool cma_release(struct cma *cma, const struct page *pages, unsigned long count);
extern int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data);
#endif
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 26f4d907254a..8a5f6c3d7dba 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -657,7 +657,7 @@ extern int alloc_contig_range(unsigned long start, unsigned long end,
extern struct page *alloc_contig_pages(unsigned long nr_pages, gfp_t gfp_mask,
int nid, nodemask_t *nodemask);
#endif
-void free_contig_range(unsigned long pfn, unsigned int nr_pages);
+void free_contig_range(unsigned long pfn, unsigned long nr_pages);
#ifdef CONFIG_CMA
/* CMA stuff */
diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h
index 5cf385ae7c08..c3d354702cb0 100644
--- a/include/trace/events/cma.h
+++ b/include/trace/events/cma.h
@@ -11,7 +11,7 @@
DECLARE_EVENT_CLASS(cma_alloc_class,
TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
- unsigned int count, unsigned int align),
+ unsigned long count, unsigned int align),
TP_ARGS(name, pfn, page, count, align),
@@ -19,7 +19,7 @@ DECLARE_EVENT_CLASS(cma_alloc_class,
__string(name, name)
__field(unsigned long, pfn)
__field(const struct page *, page)
- __field(unsigned int, count)
+ __field(unsigned long, count)
__field(unsigned int, align)
),
@@ -31,7 +31,7 @@ DECLARE_EVENT_CLASS(cma_alloc_class,
__entry->align = align;
),
- TP_printk("name=%s pfn=%lx page=%p count=%u align=%u",
+ TP_printk("name=%s pfn=%lx page=%p count=%lu align=%u",
__get_str(name),
__entry->pfn,
__entry->page,
@@ -42,7 +42,7 @@ DECLARE_EVENT_CLASS(cma_alloc_class,
TRACE_EVENT(cma_release,
TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
- unsigned int count),
+ unsigned long count),
TP_ARGS(name, pfn, page, count),
@@ -50,7 +50,7 @@ TRACE_EVENT(cma_release,
__string(name, name)
__field(unsigned long, pfn)
__field(const struct page *, page)
- __field(unsigned int, count)
+ __field(unsigned long, count)
),
TP_fast_assign(
@@ -60,7 +60,7 @@ TRACE_EVENT(cma_release,
__entry->count = count;
),
- TP_printk("name=%s pfn=%lx page=%p count=%u",
+ TP_printk("name=%s pfn=%lx page=%p count=%lu",
__get_str(name),
__entry->pfn,
__entry->page,
@@ -69,13 +69,13 @@ TRACE_EVENT(cma_release,
TRACE_EVENT(cma_alloc_start,
- TP_PROTO(const char *name, unsigned int count, unsigned int align),
+ TP_PROTO(const char *name, unsigned long count, unsigned int align),
TP_ARGS(name, count, align),
TP_STRUCT__entry(
__string(name, name)
- __field(unsigned int, count)
+ __field(unsigned long, count)
__field(unsigned int, align)
),
@@ -85,7 +85,7 @@ TRACE_EVENT(cma_alloc_start,
__entry->align = align;
),
- TP_printk("name=%s count=%u align=%u",
+ TP_printk("name=%s count=%lu align=%u",
__get_str(name),
__entry->count,
__entry->align)
@@ -94,7 +94,7 @@ TRACE_EVENT(cma_alloc_start,
DEFINE_EVENT(cma_alloc_class, cma_alloc_finish,
TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
- unsigned int count, unsigned int align),
+ unsigned long count, unsigned int align),
TP_ARGS(name, pfn, page, count, align)
);
@@ -102,7 +102,7 @@ DEFINE_EVENT(cma_alloc_class, cma_alloc_finish,
DEFINE_EVENT(cma_alloc_class, cma_alloc_busy_retry,
TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
- unsigned int count, unsigned int align),
+ unsigned long count, unsigned int align),
TP_ARGS(name, pfn, page, count, align)
);