summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/lockless_allocator.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/lockless_allocator.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
index dc72d8bf..d8043c0b 100644
--- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -106,6 +106,7 @@ static void nvgpu_lockless_alloc_destroy(struct nvgpu_allocator *a)
106 nvgpu_kfree(nvgpu_alloc_to_gpu(a), pa); 106 nvgpu_kfree(nvgpu_alloc_to_gpu(a), pa);
107} 107}
108 108
109#ifdef CONFIG_DEBUG_FS
109static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a, 110static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a,
110 struct seq_file *s, int lock) 111 struct seq_file *s, int lock)
111{ 112{
@@ -122,6 +123,7 @@ static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a,
122 __alloc_pstat(s, a, " Number free = %d\n", 123 __alloc_pstat(s, a, " Number free = %d\n",
123 pa->nr_nodes - atomic_read(&pa->nr_allocs)); 124 pa->nr_nodes - atomic_read(&pa->nr_allocs));
124} 125}
126#endif
125 127
126static const struct nvgpu_allocator_ops pool_ops = { 128static const struct nvgpu_allocator_ops pool_ops = {
127 .alloc = nvgpu_lockless_alloc, 129 .alloc = nvgpu_lockless_alloc,
@@ -134,7 +136,9 @@ static const struct nvgpu_allocator_ops pool_ops = {
134 136
135 .fini = nvgpu_lockless_alloc_destroy, 137 .fini = nvgpu_lockless_alloc_destroy,
136 138
139#ifdef CONFIG_DEBUG_FS
137 .print_stats = nvgpu_lockless_print_stats, 140 .print_stats = nvgpu_lockless_print_stats,
141#endif
138}; 142};
139 143
140int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a, 144int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a,