diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-04-19 02:59:53 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-19 15:15:56 -0400 |
commit | 78fe154ff761bd1dff6db96e90cd4e23185574e2 (patch) | |
tree | b91ea9600dd52f56322900161c7d2cb9f27314e5 /drivers/gpu/nvgpu/include | |
parent | afe12a49f7c61b5725113e2b9d2a5121d7913383 (diff) |
gpu: nvgpu: use nvgpu list for page allocator
Use nvgpu list APIs instead of linux list APIs
for page allocator lists
Jira NVGPU-13
Change-Id: I3ee64a5cdc2ced4ca9c4ba7ad6271915a66d90f5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1462076
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/page_allocator.h | 17 |
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 | */ |
48 | struct page_alloc_slab { | 46 | struct 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 | |||
79 | static inline struct page_alloc_slab_page * | ||
80 | page_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 | ||
81 | struct page_alloc_chunk { | 86 | struct page_alloc_chunk { |