LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [v7 PATCH 1/2] mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned
@ 2019-05-28  6:44 Yang Shi
  2019-05-28  6:44 ` [v7 PATCH 2/2] mm: vmscan: correct some vmscan counters for THP swapout Yang Shi
  2019-06-10 21:36 ` [v7 PATCH 1/2] mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned Oscar Salvador
  0 siblings, 2 replies; 6+ messages in thread
From: Yang Shi @ 2019-05-28  6:44 UTC (permalink / raw)
  To: ying.huang, hannes, mhocko, mgorman, kirill.shutemov, josef,
	hughd, shakeelb, hdanton, akpm
  Cc: yang.shi, linux-mm, linux-kernel

The commit 9092c71bb724 ("mm: use sc->priority for slab shrink targets")
has broken up the relationship between sc->nr_scanned and slab pressure.
The sc->nr_scanned can't double slab pressure anymore.  So, it sounds no
sense to still keep sc->nr_scanned inc'ed.  Actually, it would prevent
from adding pressure on slab shrink since excessive sc->nr_scanned would
prevent from scan->priority raise.

The bonnie test doesn't show this would change the behavior of
slab shrinkers.

				w/		w/o
			  /sec    %CP      /sec      %CP
Sequential delete: 	3960.6    94.6    3997.6     96.2
Random delete: 		2518      63.8    2561.6     64.6

The slight increase of "/sec" without the patch would be caused by the
slight increase of CPU usage.

Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Michal Hocko <mhocko@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
---
v4: Added Johannes's ack

 mm/vmscan.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 7acd0af..b65bc50 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1137,11 +1137,6 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 		if (!sc->may_unmap && page_mapped(page))
 			goto keep_locked;
 
-		/* Double the slab pressure for mapped and swapcache pages */
-		if ((page_mapped(page) || PageSwapCache(page)) &&
-		    !(PageAnon(page) && !PageSwapBacked(page)))
-			sc->nr_scanned++;
-
 		may_enter_fs = (sc->gfp_mask & __GFP_FS) ||
 			(PageSwapCache(page) && (sc->gfp_mask & __GFP_IO));
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-11 17:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28  6:44 [v7 PATCH 1/2] mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned Yang Shi
2019-05-28  6:44 ` [v7 PATCH 2/2] mm: vmscan: correct some vmscan counters for THP swapout Yang Shi
2019-05-29  0:57   ` Huang, Ying
2019-06-10 21:36 ` [v7 PATCH 1/2] mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned Oscar Salvador
2019-06-11 17:12   ` Yang Shi
2019-06-11 17:17     ` Yang Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).