Skip to contentSkip to conversation

android: binder: use VM_ALLOC to get vm area

PATCH In review Ganesh Mahendran 2 participants 7 messages Nov 15, 2016 – Feb 9, 2017 Android drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 android: binder: use VM_ALLOC to get vm area

VM_IOREMAP is used to access hardware through a mechanism called I/O mapped memory. Android binder is a IPC machanism which will not access I/O memory.

Also VM_IOREMAP has alignment requiement which may not needed in binder.

    __get_vm_area_node()
    {
    ...
        if (flags & VM_IOREMAP)
            align = 1ul << clamp_t(int, fls_long(size),
               PAGE_SHIFT, IOREMAP_MAX_ORDER);
    ...
    }

This patch use VM_ALLOC to get vm area.

Below is the throughput test result:

# ./binderThroughputTest -w 100
I run this command 10 times:
before after
average iterations per sec: 11199.9 11886.9

No performance regression found throgh binder test.

---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/android/binder.c +1 -1
index 3c71b98..b5908ec 100644
@@ -2901,7 +2901,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
 		goto err_already_mapped;
 	}
 
-	area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP);
+	area = get_vm_area(vma->vm_end - vma->vm_start, VM_ALLOC);
 	if (area == NULL) {
 		ret = -ENOMEM;
 		failure_string = "get_vm_area";
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 24 lines · Ganesh Mahendran

VM_IOREMAP is used to access hardware through a mechanism called I/O mapped memory. Android binder is a IPC machanism which will not access I/O memory.

Also VM_IOREMAP has alignment requiement which may not needed in binder.

    __get_vm_area_node()
    {
    ...
        if (flags & VM_IOREMAP)
            align = 1ul << clamp_t(int, fls_long(size),
               PAGE_SHIFT, IOREMAP_MAX_ORDER);
    ...
    }

This patch use VM_ALLOC to get vm area.

Below is the throughput test result:

# ./binderThroughputTest -w 100
I run this command 10 times:
before after
average iterations per sec: 11199.9 11886.9

Quoted 6 lines

No performance regression found throgh binder test.

---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What changed from v1?

Always list that below the --- line.

thanks,

greg k-h

#2 lore raw

Hi, Greg

2016-11-15 18:18 GMT+08:00 Greg KH <[email protected]>:

Quoted 25 lines · Ganesh Mahendran
Quoted 24 lines

VM_IOREMAP is used to access hardware through a mechanism called I/O mapped memory. Android binder is a IPC machanism which will not access I/O memory.

Also VM_IOREMAP has alignment requiement which may not needed in binder.

    __get_vm_area_node()
    {
    ...
        if (flags & VM_IOREMAP)
            align = 1ul << clamp_t(int, fls_long(size),
               PAGE_SHIFT, IOREMAP_MAX_ORDER);
    ...
    }

This patch use VM_ALLOC to get vm area.

Below is the throughput test result:

# ./binderThroughputTest -w 100
I run this command 10 times:
before after
average iterations per sec: 11199.9 11886.9

Quoted 8 lines
Quoted 6 lines

No performance regression found throgh binder test.

---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What changed from v1?

Sorry for missing the change information.

In V2, I run the binder test. And there is no side effect with this patch.

Quoted 2 lines

Always list that below the --- line.

Thanks for reminder.

Quoted 4 lines

thanks,

greg k-h

#3 lore raw

A gentle ping.

Thanks.

2016-11-15 21:18 GMT+08:00 Ganesh Mahendran <[email protected]>:

Quoted 51 lines

Hi, Greg

2016-11-15 18:18 GMT+08:00 Greg KH <[email protected]>:

Quoted 25 lines · Ganesh Mahendran
Quoted 24 lines

VM_IOREMAP is used to access hardware through a mechanism called I/O mapped memory. Android binder is a IPC machanism which will not access I/O memory.

Also VM_IOREMAP has alignment requiement which may not needed in binder.

    __get_vm_area_node()
    {
    ...
        if (flags & VM_IOREMAP)
            align = 1ul << clamp_t(int, fls_long(size),
               PAGE_SHIFT, IOREMAP_MAX_ORDER);
    ...
    }

This patch use VM_ALLOC to get vm area.

Below is the throughput test result:

# ./binderThroughputTest -w 100
I run this command 10 times:
before after
average iterations per sec: 11199.9 11886.9

Quoted 8 lines
Quoted 6 lines

No performance regression found throgh binder test.

---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What changed from v1?

Sorry for missing the change information.

In V2, I run the binder test. And there is no side effect with this patch.

Quoted 2 lines

Always list that below the --- line.

Thanks for reminder.

Quoted 4 lines

thanks,

greg k-h

maintainer
#4 lore raw
Quoted 1 line · Ganesh Mahendran

A gentle ping.

I don't see a patch here that can be accepted, what are you asking for a response from?

confused,

greg k-h

maintainer
#6 lore raw
Quoted 11 lines · Ganesh Mahendran

Hi, Greg:

2017-02-09 18:17 GMT+08:00 Greg KH <[email protected]>:

Quoted 5 lines · Ganesh Mahendran
Quoted 1 line

A gentle ping.

I don't see a patch here that can be accepted, what are you asking for a response from?

I sent a patch before:
https://patchwork.kernel.org/patch/9429257/

I don't use patchwork, please respond to the patch you are referring to, or resend it.

thanks,

greg k-h