Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
treewide: Remove oneplus_ion framework
Browse files Browse the repository at this point in the history
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot committed Jan 19, 2020
1 parent 056bab2 commit 025d551
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 79 deletions.
22 changes: 0 additions & 22 deletions drivers/staging/android/ion/ion.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
#define CREATE_TRACE_POINTS
#include <trace/events/ion.h>
#include <soc/qcom/secure_buffer.h>
#ifdef CONFIG_ONEPLUS_HEALTHINFO
#include <linux/module.h>
#endif

#include "ion.h"
#include "ion_secure_util.h"
Expand Down Expand Up @@ -106,17 +103,6 @@ static void ion_buffer_add(struct ion_device *dev,
rb_insert_color(&buffer->node, &dev->buffers);
}

#ifdef CONFIG_ONEPLUS_HEALTHINFO
static atomic_long_t ion_total_size;
static bool ion_cnt_enable = true;
unsigned long ion_total(void)
{
if (!ion_cnt_enable)
return 0;
return (unsigned long)atomic_long_read(&ion_total_size);
}
#endif

/* this function should only be called while dev->lock is held */
static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
struct ion_device *dev,
Expand Down Expand Up @@ -186,10 +172,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
ion_buffer_add(dev, buffer);
mutex_unlock(&dev->buffer_lock);
atomic_long_add(len, &heap->total_allocated);
#ifdef CONFIG_ONEPLUS_HEALTHINFO
if (ion_cnt_enable)
atomic_long_add(buffer->size, &ion_total_size);
#endif
return buffer;

err1:
Expand All @@ -205,10 +187,6 @@ void ion_buffer_destroy(struct ion_buffer *buffer)
pr_warn_ratelimited("ION client likely missing a call to dma_buf_kunmap or dma_buf_vunmap\n");
buffer->heap->ops->unmap_kernel(buffer->heap, buffer);
}
#ifdef CONFIG_ONEPLUS_HEALTHINFO
if (ion_cnt_enable)
atomic_long_sub(buffer->size, &ion_total_size);
#endif
buffer->heap->ops->free(buffer);
kfree(buffer);
}
Expand Down
4 changes: 0 additions & 4 deletions drivers/staging/android/ion/ion.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,6 @@ struct ion_heap {
int (*debug_show)(struct ion_heap *heap, struct seq_file *, void *);
};

#ifdef CONFIG_ONEPLUS_HEALTHINFO
unsigned long ion_total(void);
#endif

/**
* ion_buffer_cached - this ion buffer is cached
* @buffer: buffer
Expand Down
9 changes: 0 additions & 9 deletions drivers/staging/android/ion/ion_page_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ static void ion_page_pool_free_pages(struct ion_page_pool *pool,
static int ion_page_pool_add(struct ion_page_pool *pool, struct page *page)
{
mutex_lock(&pool->mutex);
#ifdef CONFIG_ONEPLUS_HEALTHINFO
zone_page_state_add(1L << pool->order, page_zone(page),
NR_IONCACHE_PAGES);
#endif
if (PageHighMem(page)) {
list_add_tail(&page->lru, &pool->high_items);
pool->high_count++;
Expand Down Expand Up @@ -74,11 +70,6 @@ static struct page *ion_page_pool_remove(struct ion_page_pool *pool, bool high)
pool->low_count--;
}

#ifdef CONFIG_ONEPLUS_HEALTHINFO
zone_page_state_add(-(1L << pool->order), page_zone(page),
NR_IONCACHE_PAGES);
#endif

list_del(&page->lru);
mod_node_page_state(page_pgdat(page), NR_INDIRECTLY_RECLAIMABLE_BYTES,
-(1 << (PAGE_SHIFT + pool->order)));
Expand Down
10 changes: 1 addition & 9 deletions fs/proc/meminfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include "internal.h"
#ifdef CONFIG_ONEPLUS_HEALTHINFO
#include <linux/oem/oneplus_ion.h>
#endif

void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
{
Expand Down Expand Up @@ -144,12 +141,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
show_val_kb(m, "CmaFree: ",
global_zone_page_state(NR_FREE_CMA_PAGES));
#endif
#ifdef CONFIG_ONEPLUS_HEALTHINFO
#ifdef CONFIG_ION
show_val_kb(m, "IonTotalCache: ", global_zone_page_state(NR_IONCACHE_PAGES));
show_val_kb(m, "IonTotalUsed: ", ion_total() >> PAGE_SHIFT);
#endif
#endif

hugetlb_report_meminfo(m);

arch_report_meminfo(m);
Expand Down
3 changes: 0 additions & 3 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ enum zone_stat_item {
NR_BOUNCE,
#if IS_ENABLED(CONFIG_ZSMALLOC)
NR_ZSPAGES, /* allocated in zsmalloc */
#endif
#ifdef CONFIG_ONEPLUS_HEALTHINFO
NR_IONCACHE_PAGES,
#endif
NR_FREE_CMA_PAGES,
NR_VM_ZONE_STAT_ITEMS };
Expand Down
23 changes: 0 additions & 23 deletions include/linux/oem/oneplus_ion.h

This file was deleted.

6 changes: 0 additions & 6 deletions lib/show_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#include <linux/mm.h>
#include <linux/quicklist.h>
#include <linux/cma.h>
#ifdef CONFIG_ONEPLUS_HEALTHINFO
#include <linux/oem/oneplus_ion.h>
#endif

void show_mem(unsigned int filter, nodemask_t *nodemask)
{
Expand Down Expand Up @@ -52,7 +49,4 @@ void show_mem(unsigned int filter, nodemask_t *nodemask)
#ifdef CONFIG_MEMORY_FAILURE
printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages));
#endif
#ifdef CONFIG_ONEPLUS_HEALTHINFO
printk("%lu pages ion total used\n", ion_total() >> PAGE_SHIFT);
#endif
}
3 changes: 0 additions & 3 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,9 +1049,6 @@ const char * const vmstat_text[] = {
"nr_bounce",
#if IS_ENABLED(CONFIG_ZSMALLOC)
"nr_zspages",
#endif
#ifdef CONFIG_ONEPLUS_HEALTHINFO
"nr_ioncache_pages",
#endif
"nr_free_cma",

Expand Down

0 comments on commit 025d551

Please sign in to comment.