Skip to contentSkip to conversation

binder: Remove incorrect comment about vm_insert_page() behavior

PATCH In review Jann Horn 2 participants 2 messages Oct 18, 2019 Android drivers

lore
Share & tools
lore

Jann Horn

author
#0 lore raw

PATCH 1/1 binder: Remove incorrect comment about vm_insert_page() behavior

vm_insert_page() does increment the page refcount, and just to be sure, I've confirmed it by printing page_count(page[0].page_ptr) before and after vm_insert_page(). It's 1 before, 2 afterwards, as expected.

---
 drivers/android/binder_alloc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/android/binder_alloc.c +0 -1
index d42a8b2f636a..2faada3e97fd 100644
@@ -267,7 +267,6 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
 			alloc->pages_high = index + 1;
 
 		trace_binder_alloc_page_end(alloc, index);
-		/* vm_insert_page does not seem to increment the refcount */
 	}
 	if (mm) {
 		up_read(&mm->mmap_sem);
Signature · 1 line
2.23.0.866.gb869b98d4c-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jann Horn

vm_insert_page() does increment the page refcount, and just to be sure, I've confirmed it by printing page_count(page[0].page_ptr) before and after vm_insert_page(). It's 1 before, 2 afterwards, as expected.

Seems this has always been the case since its introduction:
a145dd411eb2 ("VM: add "vm_insert_page()" function")