* [PATCH] binder: Remove incorrect comment about vm_insert_page() behavior
@ 2019-10-18 15:39 Jann Horn
2019-10-18 15:47 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Jann Horn @ 2019-10-18 15:39 UTC (permalink / raw)
To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, jannh
Cc: devel, linux-kernel
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.
Signed-off-by: Jann Horn <jannh@google.com>
---
drivers/android/binder_alloc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index d42a8b2f636a..2faada3e97fd 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -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);
--
2.23.0.866.gb869b98d4c-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] binder: Remove incorrect comment about vm_insert_page() behavior
2019-10-18 15:39 [PATCH] binder: Remove incorrect comment about vm_insert_page() behavior Jann Horn
@ 2019-10-18 15:47 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2019-10-18 15:47 UTC (permalink / raw)
To: Jann Horn
Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, devel,
linux-kernel
On Fri, Oct 18, 2019 at 05:39:46PM +0200, Jann Horn wrote:
> 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.
>
> Signed-off-by: Jann Horn <jannh@google.com>
Seems this has always been the case since its introduction:
a145dd411eb2 ("VM: add "vm_insert_page()" function")
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-18 15:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 15:39 [PATCH] binder: Remove incorrect comment about vm_insert_page() behavior Jann Horn
2019-10-18 15:47 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).