Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5df863

Browse files
Matthew Wilcox (Oracle)torvalds
Matthew Wilcox (Oracle)
authored andcommitted
mm: use find_get_incore_page in memcontrol
The current code does not protect against swapoff of the underlyingswap device, so this is a bug fix as well as a worthwhile reduction incode complexity.Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Cc: Alexey Dobriyan <adobriyan@gmail.com>Cc: Chris Wilson <chris@chris-wilson.co.uk>Cc: Huang Ying <ying.huang@intel.com>Cc: Hugh Dickins <hughd@google.com>Cc: Jani Nikula <jani.nikula@linux.intel.com>Cc: Johannes Weiner <hannes@cmpxchg.org>Cc: Matthew Auld <matthew.auld@intel.com>Cc: William Kucharski <william.kucharski@oracle.com>Link:https://lkml.kernel.org/r/20200910183318.20139-3-willy@infradead.orgSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent61ef186 commitf5df863

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

‎mm/memcontrol.c‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5539,35 +5539,15 @@ static struct page *mc_handle_swap_pte(struct vm_area_struct *vma,
55395539
staticstructpage*mc_handle_file_pte(structvm_area_struct*vma,
55405540
unsigned longaddr,pte_tptent,swp_entry_t*entry)
55415541
{
5542-
structpage*page=NULL;
5543-
structaddress_space*mapping;
5544-
pgoff_tpgoff;
5545-
55465542
if (!vma->vm_file)/* anonymous vma */
55475543
returnNULL;
55485544
if (!(mc.flags&MOVE_FILE))
55495545
returnNULL;
55505546

5551-
mapping=vma->vm_file->f_mapping;
5552-
pgoff=linear_page_index(vma,addr);
5553-
55545547
/* page is moved even if it's not RSS of this task(page-faulted). */
5555-
#ifdefCONFIG_SWAP
55565548
/* shmem/tmpfs may report page out on swap: account for that too. */
5557-
if (shmem_mapping(mapping)) {
5558-
page=find_get_entry(mapping,pgoff);
5559-
if (xa_is_value(page)) {
5560-
swp_entry_tswp=radix_to_swp_entry(page);
5561-
*entry=swp;
5562-
page=find_get_page(swap_address_space(swp),
5563-
swp_offset(swp));
5564-
}
5565-
}else
5566-
page=find_get_page(mapping,pgoff);
5567-
#else
5568-
page=find_get_page(mapping,pgoff);
5569-
#endif
5570-
returnpage;
5549+
returnfind_get_incore_page(vma->vm_file->f_mapping,
5550+
linear_page_index(vma,addr));
55715551
}
55725552

55735553
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp