“a363bf7bd23fb6ee3e1690bd300a5e285f9c88df”上不存在“include/linux/hyperv.h”
提交 c43bc03d 编写于 作者: X Xianting Tian 提交者: Linus Torvalds

mm/memory-failure: do pgoff calculation before for_each_process()

There is no need to calculate pgoff in each loop of for_each_process(), so
move it to the place before for_each_process(), which can save some CPU
cycles.
Signed-off-by: NXianting Tian <tian.xianting@h3c.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Acked-by: NNaoya Horiguchi <naoya.horiguchi@nec.com>
Link: http://lkml.kernel.org/r/20200818082647.34322-1-tian.xianting@h3c.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 41a04814
...@@ -484,11 +484,12 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill, ...@@ -484,11 +484,12 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
struct vm_area_struct *vma; struct vm_area_struct *vma;
struct task_struct *tsk; struct task_struct *tsk;
struct address_space *mapping = page->mapping; struct address_space *mapping = page->mapping;
pgoff_t pgoff;
i_mmap_lock_read(mapping); i_mmap_lock_read(mapping);
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
pgoff = page_to_pgoff(page);
for_each_process(tsk) { for_each_process(tsk) {
pgoff_t pgoff = page_to_pgoff(page);
struct task_struct *t = task_early_kill(tsk, force_early); struct task_struct *t = task_early_kill(tsk, force_early);
if (!t) if (!t)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册