All of lore.kernel.org
 help / color / mirror / Atom feed
* + memcg-charge-before-adding-to-swapcache-on-swapin-fix.patch added to -mm tree
@ 2021-03-18  3:09 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-03-18  3:09 UTC (permalink / raw)
  To: borntraeger, guro, hannes, hca, hughd, mhocko, mm-commits, sfr, shakeelb


The patch titled
     Subject: memcg: set page->private before calling swap_readpage
has been added to the -mm tree.  Its filename is
     memcg-charge-before-adding-to-swapcache-on-swapin-fix.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/memcg-charge-before-adding-to-swapcache-on-swapin-fix.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/memcg-charge-before-adding-to-swapcache-on-swapin-fix.patch

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 and is updated
there every 3-4 working days

------------------------------------------------------
From: Shakeel Butt <shakeelb@google.com>
Subject: memcg: set page->private before calling swap_readpage

The function swap_readpage() (and other functions it call) extracts swap
entry from page->private.  However for SWP_SYNCHRONOUS_IO, the kernel
skips the swapcache and thus we need to manually set the page->private
with the swap entry before calling swap_readpage().

Link: https://lkml.kernel.org/r/20210318015959.2986837-1-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Reported-by: Heiko Carstens <hca@linux.ibm.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/mm/memory.c~memcg-charge-before-adding-to-swapcache-on-swapin-fix
+++ a/mm/memory.c
@@ -3324,7 +3324,11 @@ vm_fault_t do_swap_page(struct vm_fault
 					workingset_refault(page, shadow);
 
 				lru_cache_add(page);
+
+				/* To provide entry to swap_readpage() */
+				set_page_private(page, entry.val);
 				swap_readpage(page, true);
+				set_page_private(page, 0);
 			}
 		} else {
 			page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
_

Patches currently in -mm which might be from shakeelb@google.com are

memcg-cleanup-root-memcg-checks.patch
memcg-enable-memcg-oom-kill-for-__gfp_nofail.patch
memcg-charge-before-adding-to-swapcache-on-swapin.patch
memcg-charge-before-adding-to-swapcache-on-swapin-fix.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-18  3:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18  3:09 + memcg-charge-before-adding-to-swapcache-on-swapin-fix.patch added to -mm tree akpm

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.