Commit 27f28b97 authored by Chen Gang's avatar Chen Gang Committed by Linus Torvalds

mm/mmap.c: change __install_special_mapping() args order

Make __install_special_mapping() args order match the caller, so the
caller can pass their register args directly to callee with no touch.

For most of architectures, args (at least the first 5th args) are in
registers, so this change will have effect on most of architectures.

For -O2, __install_special_mapping() may be inlined under most of
architectures, but for -Os, it should not. So this change can get a
little better performance for -Os, at least.
Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c9427bc0
...@@ -3052,8 +3052,8 @@ static int special_mapping_fault(struct vm_area_struct *vma, ...@@ -3052,8 +3052,8 @@ static int special_mapping_fault(struct vm_area_struct *vma,
static struct vm_area_struct *__install_special_mapping( static struct vm_area_struct *__install_special_mapping(
struct mm_struct *mm, struct mm_struct *mm,
unsigned long addr, unsigned long len, unsigned long addr, unsigned long len,
unsigned long vm_flags, const struct vm_operations_struct *ops, unsigned long vm_flags, void *priv,
void *priv) const struct vm_operations_struct *ops)
{ {
int ret; int ret;
struct vm_area_struct *vma; struct vm_area_struct *vma;
...@@ -3102,8 +3102,8 @@ struct vm_area_struct *_install_special_mapping( ...@@ -3102,8 +3102,8 @@ struct vm_area_struct *_install_special_mapping(
unsigned long addr, unsigned long len, unsigned long addr, unsigned long len,
unsigned long vm_flags, const struct vm_special_mapping *spec) unsigned long vm_flags, const struct vm_special_mapping *spec)
{ {
return __install_special_mapping(mm, addr, len, vm_flags, return __install_special_mapping(mm, addr, len, vm_flags, (void *)spec,
&special_mapping_vmops, (void *)spec); &special_mapping_vmops);
} }
int install_special_mapping(struct mm_struct *mm, int install_special_mapping(struct mm_struct *mm,
...@@ -3111,8 +3111,8 @@ int install_special_mapping(struct mm_struct *mm, ...@@ -3111,8 +3111,8 @@ int install_special_mapping(struct mm_struct *mm,
unsigned long vm_flags, struct page **pages) unsigned long vm_flags, struct page **pages)
{ {
struct vm_area_struct *vma = __install_special_mapping( struct vm_area_struct *vma = __install_special_mapping(
mm, addr, len, vm_flags, &legacy_special_mapping_vmops, mm, addr, len, vm_flags, (void *)pages,
(void *)pages); &legacy_special_mapping_vmops);
return PTR_ERR_OR_ZERO(vma); return PTR_ERR_OR_ZERO(vma);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment