summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/page_allocator.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h
index 70ed81c3..9a5ef8d3 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h
@@ -17,8 +17,6 @@
17#ifndef PAGE_ALLOCATOR_PRIV_H 17#ifndef PAGE_ALLOCATOR_PRIV_H
18#define PAGE_ALLOCATOR_PRIV_H 18#define PAGE_ALLOCATOR_PRIV_H
19 19
20#include <linux/list.h>
21
22#include <nvgpu/allocator.h> 20#include <nvgpu/allocator.h>
23#include <nvgpu/kmem.h> 21#include <nvgpu/kmem.h>
24#include <nvgpu/list.h> 22#include <nvgpu/list.h>
@@ -46,9 +44,9 @@ struct nvgpu_allocator;
46 * assumed to be 64k) the allocation is satisfied by one of the buckets. 44 * assumed to be 64k) the allocation is satisfied by one of the buckets.
47 */ 45 */
48struct page_alloc_slab { 46struct page_alloc_slab {
49 struct list_head empty; 47 struct nvgpu_list_node empty;
50 struct list_head partial; 48 struct nvgpu_list_node partial;
51 struct list_head full; 49 struct nvgpu_list_node full;
52 50
53 int nr_empty; 51 int nr_empty;
54 int nr_partial; 52 int nr_partial;
@@ -75,7 +73,14 @@ struct page_alloc_slab_page {
75 enum slab_page_state state; 73 enum slab_page_state state;
76 74
77 struct page_alloc_slab *owner; 75 struct page_alloc_slab *owner;
78 struct list_head list_entry; 76 struct nvgpu_list_node list_entry;
77};
78
79static inline struct page_alloc_slab_page *
80page_alloc_slab_page_from_list_entry(struct nvgpu_list_node *node)
81{
82 return (struct page_alloc_slab_page *)
83 ((uintptr_t)node - offsetof(struct page_alloc_slab_page, list_entry));
79}; 84};
80 85
81struct page_alloc_chunk { 86struct page_alloc_chunk {