diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-01 13:31:17 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-01 13:31:17 -0500 |
| commit | f6cff79f1d122f78a4b35bf4b2f0112afcd89ea4 (patch) | |
| tree | cf3a38576f9adbb3860982c25f72aebed2bb541a /drivers/android/binder_alloc.c | |
| parent | 47fcc0360cfb3fe82e4daddacad3c1cd80b0b75d (diff) | |
| parent | 9ff6576e124b1227c27c1da43fe5f8ee908263e0 (diff) | |
Merge tag 'char-misc-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here is the big pull request for char/misc drivers for 4.16-rc1.
There's a lot of stuff in here. Three new driver subsystems were added
for various types of hardware busses:
- siox
- slimbus
- soundwire
as well as a new vboxguest subsystem for the VirtualBox hypervisor
drivers.
There's also big updates from the FPGA subsystem, lots of Android
binder fixes, the usual handful of hyper-v updates, and lots of other
smaller driver updates.
All of these have been in linux-next for a long time, with no reported
issues"
* tag 'char-misc-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (155 commits)
char: lp: use true or false for boolean values
android: binder: use VM_ALLOC to get vm area
android: binder: Use true and false for boolean values
lkdtm: fix handle_irq_event symbol for INT_HW_IRQ_EN
EISA: Delete error message for a failed memory allocation in eisa_probe()
EISA: Whitespace cleanup
misc: remove AVR32 dependencies
virt: vbox: Add error mapping for VERR_INVALID_NAME and VERR_NO_MORE_FILES
soundwire: Fix a signedness bug
uio_hv_generic: fix new type mismatch warnings
uio_hv_generic: fix type mismatch warnings
auxdisplay: img-ascii-lcd: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
uio_hv_generic: add rescind support
uio_hv_generic: check that host supports monitor page
uio_hv_generic: create send and receive buffers
uio: document uio_hv_generic regions
doc: fix documentation about uio_hv_generic
vmbus: add monitor_id and subchannel_id to sysfs per channel
vmbus: fix ABI documentation
uio_hv_generic: use ISR callback method
...
Diffstat (limited to 'drivers/android/binder_alloc.c')
| -rw-r--r-- | drivers/android/binder_alloc.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 6f6f745605af..5a426c877dfb 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c | |||
| @@ -281,6 +281,9 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate, | |||
| 281 | goto err_vm_insert_page_failed; | 281 | goto err_vm_insert_page_failed; |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | if (index + 1 > alloc->pages_high) | ||
| 285 | alloc->pages_high = index + 1; | ||
| 286 | |||
| 284 | trace_binder_alloc_page_end(alloc, index); | 287 | trace_binder_alloc_page_end(alloc, index); |
| 285 | /* vm_insert_page does not seem to increment the refcount */ | 288 | /* vm_insert_page does not seem to increment the refcount */ |
| 286 | } | 289 | } |
| @@ -324,11 +327,12 @@ err_no_vma: | |||
| 324 | return vma ? -ENOMEM : -ESRCH; | 327 | return vma ? -ENOMEM : -ESRCH; |
| 325 | } | 328 | } |
| 326 | 329 | ||
| 327 | struct binder_buffer *binder_alloc_new_buf_locked(struct binder_alloc *alloc, | 330 | static struct binder_buffer *binder_alloc_new_buf_locked( |
| 328 | size_t data_size, | 331 | struct binder_alloc *alloc, |
| 329 | size_t offsets_size, | 332 | size_t data_size, |
| 330 | size_t extra_buffers_size, | 333 | size_t offsets_size, |
| 331 | int is_async) | 334 | size_t extra_buffers_size, |
| 335 | int is_async) | ||
| 332 | { | 336 | { |
| 333 | struct rb_node *n = alloc->free_buffers.rb_node; | 337 | struct rb_node *n = alloc->free_buffers.rb_node; |
| 334 | struct binder_buffer *buffer; | 338 | struct binder_buffer *buffer; |
| @@ -666,7 +670,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, | |||
| 666 | goto err_already_mapped; | 670 | goto err_already_mapped; |
| 667 | } | 671 | } |
| 668 | 672 | ||
| 669 | area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP); | 673 | area = get_vm_area(vma->vm_end - vma->vm_start, VM_ALLOC); |
| 670 | if (area == NULL) { | 674 | if (area == NULL) { |
| 671 | ret = -ENOMEM; | 675 | ret = -ENOMEM; |
| 672 | failure_string = "get_vm_area"; | 676 | failure_string = "get_vm_area"; |
| @@ -853,6 +857,7 @@ void binder_alloc_print_pages(struct seq_file *m, | |||
| 853 | } | 857 | } |
| 854 | mutex_unlock(&alloc->mutex); | 858 | mutex_unlock(&alloc->mutex); |
| 855 | seq_printf(m, " pages: %d:%d:%d\n", active, lru, free); | 859 | seq_printf(m, " pages: %d:%d:%d\n", active, lru, free); |
| 860 | seq_printf(m, " pages high watermark: %zu\n", alloc->pages_high); | ||
| 856 | } | 861 | } |
| 857 | 862 | ||
| 858 | /** | 863 | /** |
| @@ -1002,8 +1007,14 @@ void binder_alloc_init(struct binder_alloc *alloc) | |||
| 1002 | INIT_LIST_HEAD(&alloc->buffers); | 1007 | INIT_LIST_HEAD(&alloc->buffers); |
| 1003 | } | 1008 | } |
| 1004 | 1009 | ||
| 1005 | void binder_alloc_shrinker_init(void) | 1010 | int binder_alloc_shrinker_init(void) |
| 1006 | { | 1011 | { |
| 1007 | list_lru_init(&binder_alloc_lru); | 1012 | int ret = list_lru_init(&binder_alloc_lru); |
| 1008 | register_shrinker(&binder_shrinker); | 1013 | |
| 1014 | if (ret == 0) { | ||
| 1015 | ret = register_shrinker(&binder_shrinker); | ||
| 1016 | if (ret) | ||
| 1017 | list_lru_destroy(&binder_alloc_lru); | ||
| 1018 | } | ||
| 1019 | return ret; | ||
| 1009 | } | 1020 | } |
