diff options
author | Martijn Coenen <maco@android.com> | 2017-10-24 16:37:39 +0200 |
---|---|---|
committer | Martijn Coenen <maco@android.com> | 2017-10-26 15:16:08 +0200 |
commit | c8bc3e3a3ede641b48360ab0bd35eb316168008b (patch) | |
tree | f06634acfc889aac1a3189aa9b2ca42f7fda4f92 /drivers | |
parent | 95317055df213596ee7c25836a6ac64bb56c3cb5 (diff) |
ANDROID: binder: show high watermark of alloc->pages.
Show the high watermark of the index into the alloc->pages
array, to facilitate sizing the buffer on a per-process
basis.
Change-Id: I2b40cd16628e0ee45216c51dc9b3c5b0c862032e
Signed-off-by: Martijn Coenen <maco@android.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/android/binder_alloc.c | 4 | ||||
-rw-r--r-- | drivers/android/binder_alloc.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index e431cfcfb59b..3a4279d219f7 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -282,6 +282,9 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate, goto err_vm_insert_page_failed; } + if (index + 1 > alloc->pages_high) + alloc->pages_high = index + 1; + trace_binder_alloc_page_end(alloc, index); /* vm_insert_page does not seem to increment the refcount */ } @@ -855,6 +858,7 @@ void binder_alloc_print_pages(struct seq_file *m, } mutex_unlock(&alloc->mutex); seq_printf(m, " pages: %d:%d:%d\n", active, lru, free); + seq_printf(m, " pages high watermark: %zu\n", alloc->pages_high); } /** diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h index 2dd33b6df104..0b145307f1fd 100644 --- a/drivers/android/binder_alloc.h +++ b/drivers/android/binder_alloc.h @@ -92,6 +92,7 @@ struct binder_lru_page { * @pages: array of binder_lru_page * @buffer_size: size of address space specified via mmap * @pid: pid for associated binder_proc (invariant after init) + * @pages_high: high watermark of offset in @pages * * Bookkeeping structure for per-proc address space management for binder * buffers. It is normally initialized during binder_init() and binder_mmap() @@ -112,6 +113,7 @@ struct binder_alloc { size_t buffer_size; uint32_t buffer_free; int pid; + size_t pages_high; }; #ifdef CONFIG_ANDROID_BINDER_IPC_SELFTEST |