From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, ying.huang@intel.com,
willy@infradead.org, linmiaohe@huawei.com, hughd@google.com,
david@redhat.com, kasong@tencent.com, akpm@linux-foundation.org
Subject: + swap-avoid-a-redundant-pte-map-if-ra-window-is-1.patch added to mm-unstable branch
Date: Mon, 19 Dec 2022 12:14:24 -0800 [thread overview]
Message-ID: <20221219201425.B343BC433EF@smtp.kernel.org> (raw)
The patch titled
Subject: swap: avoid a redundant pte map if ra window is 1
has been added to the -mm mm-unstable branch. Its filename is
swap-avoid-a-redundant-pte-map-if-ra-window-is-1.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/swap-avoid-a-redundant-pte-map-if-ra-window-is-1.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Kairui Song <kasong@tencent.com>
Subject: swap: avoid a redundant pte map if ra window is 1
Date: Tue, 20 Dec 2022 02:58:38 +0800
Avoid a redundant pte map/unmap when swap readahead window is 1.
Link: https://lkml.kernel.org/r/20221219185840.25441-3-ryncsn@gmail.com
Signed-off-by: Kairui Song <kasong@tencent.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/swap_state.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/mm/swap_state.c~swap-avoid-a-redundant-pte-map-if-ra-window-is-1
+++ a/mm/swap_state.c
@@ -727,8 +727,6 @@ static void swap_ra_info(struct vm_fault
}
faddr = vmf->address;
- orig_pte = pte = pte_offset_map(vmf->pmd, faddr);
-
fpfn = PFN_DOWN(faddr);
ra_val = GET_SWAP_RA_VAL(vma);
pfn = PFN_DOWN(SWAP_RA_ADDR(ra_val));
@@ -739,12 +737,11 @@ static void swap_ra_info(struct vm_fault
atomic_long_set(&vma->swap_readahead_info,
SWAP_RA_VAL(faddr, win, 0));
- if (win == 1) {
- pte_unmap(orig_pte);
+ if (win == 1)
return;
- }
/* Copy the PTEs because the page table may be unmapped */
+ orig_pte = pte = pte_offset_map(vmf->pmd, faddr);
if (fpfn == pfn + 1)
swap_ra_clamp_pfn(vma, faddr, fpfn, fpfn + win, &start, &end);
else if (pfn == fpfn + 1)
_
Patches currently in -mm which might be from kasong@tencent.com are
swapfile-get-rid-of-volatile-and-avoid-redundant-read.patch
swap-avoid-a-redundant-pte-map-if-ra-window-is-1.patch
swap-fold-swap_ra_clamp_pfn-into-swap_ra_info.patch
swap-avoid-holding-swap-reference-in-swap_cache_get_folio.patch
reply other threads:[~2022-12-19 20:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221219201425.B343BC433EF@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=kasong@tencent.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.