mm: cleanup: remove unused tsk arg from __access_remote_vm
Subsystems (4)
PATCH 1/1 mm: cleanup: remove unused tsk arg from __access_remote_vm
Despite a comment that said that page fault accounting would be charged to whatever task_struct* was passed into __access_remote_vm(), the tsk argument was actually unused.
Delete both the comment, and the argument.
---
Hi,
Just something that caught my eye when I was reviewing a semi-related patchset.
thanks,
John Hubbard
NVIDIA
include/linux/mm.h | 4 ++-- kernel/ptrace.c | 2 +- mm/memory.c | 11 +++++------ mm/nommu.c | 8 ++++---- 4 files changed, 12 insertions(+), 13 deletions(-)
include/linux/mm.h +2 -2
@@ -1716,8 +1716,8 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, unsigned int gup_flags);extern int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags); -extern int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, -unsigned long addr,void *buf,int len,unsigned int gup_flags); +extern int __access_remote_vm (struct mm_struct *mm,unsigned long addr, +void *buf,int len,unsigned int gup_flags); long get_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages,
kernel/ptrace.c +1 -1
@@ -57,7 +57,7 @@ int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,return 0 ; } - ret =__access_remote_vm (tsk, mm, addr, buf, len, gup_flags); + ret =__access_remote_vm (mm, addr, buf, len, gup_flags);mmput (mm);return ret;
mm/memory.c +5 -6
@@ -4874,11 +4874,10 @@ EXPORT_SYMBOL_GPL(generic_access_phys);#endif /* -* Access another process' address space as given in mm. If non-NULL, use the -* given task for page fault accounting. +* Access another process' address space as given in mm. */ -int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, -unsigned long addr,void *buf,int len,unsigned int gup_flags) +int __access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf, +int len,unsigned int gup_flags) {struct vm_area_struct *vma;void *old_buf = buf;
@@ -4955,7 +4954,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags) { -return __access_remote_vm (NULL , mm, addr, buf, len, gup_flags); +return __access_remote_vm (mm, addr, buf, len, gup_flags); }/*
@@ -4973,7 +4972,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr,if (!mm)return 0 ; - ret =__access_remote_vm (tsk, mm, addr, buf, len, gup_flags); + ret =__access_remote_vm (mm, addr, buf, len, gup_flags);mmput (mm);
mm/nommu.c +4 -4
@@ -1675,8 +1675,8 @@ void filemap_map_pages(struct vm_fault *vmf, }EXPORT_SYMBOL (filemap_map_pages); -int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, -unsigned long addr,void *buf,int len,unsigned int gup_flags) +int __access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf, +int len,unsigned int gup_flags) {struct vm_area_struct *vma;int write = gup_flags &FOLL_WRITE ;
@@ -1722,7 +1722,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags) { -return __access_remote_vm (NULL , mm, addr, buf, len, gup_flags); +return __access_remote_vm (mm, addr, buf, len, gup_flags); }/*
@@ -1741,7 +1741,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, inif (!mm)return 0 ; - len =__access_remote_vm (tsk, mm, addr, buf, len, gup_flags); + len =__access_remote_vm (mm, addr, buf, len, gup_flags);mmput (mm);return len;
base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec
Signature · 1 line
2.29.0
Quoted 5 lines · John Hubbard
Despite a comment that said that page fault accounting would be charged to whatever task_struct* was passed into
__access_remote_vm(), the tsk argument was actually unused.Delete both the comment, and the argument.
I'd also mention that making page fault accounting actually use this task struct is quite a project, so there is no point to keep tsk argument.
Quoted 2 lines
Signed-off-by John Hubbard <[email protected]>Cc Oleg Nesterov <[email protected]>
FWIW:
Quoted 121 lines
---
Hi,
Just something that caught my eye when I was reviewing a semi-related patchset.
thanks,
John Hubbard
NVIDIAinclude/linux/mm.h | 4 ++-- kernel/ptrace.c | 2 +- mm/memory.c | 11 +++++------ mm/nommu.c | 8 ++++---- 4 files changed, 12 insertions(+), 13 deletions(-)include/linux/mm.h +2
-2@@ -1716,8 +1716,8 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, unsigned int gup_flags);extern int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags); -extern int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, -unsigned long addr,void *buf,int len,unsigned int gup_flags); +extern int __access_remote_vm (struct mm_struct *mm,unsigned long addr, +void *buf,int len,unsigned int gup_flags); long get_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages,kernel/ptrace.c +1
-1@@ -57,7 +57,7 @@ int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,return 0 ; } - ret =__access_remote_vm (tsk, mm, addr, buf, len, gup_flags); + ret =__access_remote_vm (mm, addr, buf, len, gup_flags);mmput (mm);return ret;mm/memory.c +5
-6@@ -4874,11 +4874,10 @@ EXPORT_SYMBOL_GPL(generic_access_phys);#endif /* -* Access another process' address space as given in mm. If non-NULL, use the -* given task for page fault accounting. +* Access another process' address space as given in mm. */ -int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, -unsigned long addr,void *buf,int len,unsigned int gup_flags) +int __access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf, +int len,unsigned int gup_flags) {struct vm_area_struct *vma;void *old_buf = buf;@@ -4955,7 +4954,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags) { -return __access_remote_vm (NULL , mm, addr, buf, len, gup_flags); +return __access_remote_vm (mm, addr, buf, len, gup_flags); }/* @@ -4973,7 +4972,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr,if (!mm)return 0 ; - ret =__access_remote_vm (tsk, mm, addr, buf, len, gup_flags); + ret =__access_remote_vm (mm, addr, buf, len, gup_flags);mmput (mm);mm/nommu.c +4
-4@@ -1675,8 +1675,8 @@ void filemap_map_pages(struct vm_fault *vmf, }EXPORT_SYMBOL (filemap_map_pages); -int __access_remote_vm (struct task_struct *tsk,struct mm_struct *mm, -unsigned long addr,void *buf,int len,unsigned int gup_flags) +int __access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf, +int len,unsigned int gup_flags) {struct vm_area_struct *vma;int write = gup_flags &FOLL_WRITE ;@@ -1722,7 +1722,7 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,int access_remote_vm (struct mm_struct *mm,unsigned long addr,void *buf,int len,unsigned int gup_flags) { -return __access_remote_vm (NULL , mm, addr, buf, len, gup_flags); +return __access_remote_vm (mm, addr, buf, len, gup_flags); }/* @@ -1741,7 +1741,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, inif (!mm)return 0 ; - len =__access_remote_vm (tsk, mm, addr, buf, len, gup_flags); + len =__access_remote_vm (mm, addr, buf, len, gup_flags);mmput (mm);return len;base-commit:
3650b228f83adda7e5ee532e2b90429c03f7b9ecSignature · 1 line
2.29.0
Signature · 2 lines
Sincerely yours, Mike.