From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D158CC433DF for ; Fri, 22 May 2020 13:33:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6C31120738 for ; Fri, 22 May 2020 13:33:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="HO+B/Vs0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C31120738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 11D1580008; Fri, 22 May 2020 09:33:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CE4E80007; Fri, 22 May 2020 09:33:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F253980008; Fri, 22 May 2020 09:33:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id D88E980007 for ; Fri, 22 May 2020 09:33:43 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9E194181AEF30 for ; Fri, 22 May 2020 13:33:43 +0000 (UTC) X-FDA: 76844447526.17.kite44_3d906cc546118 X-HE-Tag: kite44_3d906cc546118 X-Filterd-Recvd-Size: 5699 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 May 2020 13:33:42 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id r3so4721697qve.1 for ; Fri, 22 May 2020 06:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OJPtBO5fmTTaWhSyWjmcp4bLb1ODXwI1HZb2MVRuSrs=; b=HO+B/Vs0fG0dX2f482MYjKlz50owpKdPJx3oKJmiRRX+4cnEVto2lrMy/dOZhbiifz Ao7g28y88lmaF3/S43LJvmmiPs/V1b17YIJ7uKBLEoF8Q0gPtS5v+xEZ4Nztd8GY6HlQ 19Ikja1eGIQaAf8/uYyCOKFH88kcfrnFCryyBvFr1fzjLjXajckuFD6M0tuKcgu4dssL BZZJNPRYqqhncHrvSjZQ3yjW6c6/t1QkAc5du40LrvudCv5WvNbcJQwFs8unz72RcQLU NtzfEZJ49+gWO/7myExdDPaxENqNboC2D6+w6j0HEjgvtsC29zkhaz61ihb/Rm/89ZZj tVWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OJPtBO5fmTTaWhSyWjmcp4bLb1ODXwI1HZb2MVRuSrs=; b=W5h2nCMe8uREB02pEh1nIdQ9uKkd9gxYDvbr++/NzhjQDTikU/TDIQKRTmgYA5MdIV 0jd3IkLuqazwrkwG7N12vb7QmRcYrK5Zi4LL/Q+oI6w0lu2WKowVQQYO1KeaMMti0CDb se8ZW8UvRrM5ycQu8vdnnsKuSUwElYebdE1tILliWM9TnN09hwQcqQY836e/dEDiqGiM musB1JhMVpnz5T6ARxe4n/llSYhnEZwHO8dbUYUVNES4+vOAhjL8M7dti3ie9Oxg7ptC pbNMwVRC37wwBm0rSqB7jR+ozla47rYrZ6GtCgMDY7MhdmD5zG88wFR+0qVYp3e3vfek sdag== X-Gm-Message-State: AOAM5320yRCawMf63wITXTzqlEE1uEeR71J6fJ2q49e9/NoRWc5RpSao IH7opebeVXzf6h17IQ2QpMUsvA== X-Google-Smtp-Source: ABdhPJxbewbRX/Ts4Y9fzEt5gZHRZaShxSaLAa1tzmXd0uhUXABvvvQRi4bi1zs4Q57wjfUEIO02sA== X-Received: by 2002:ad4:4690:: with SMTP id bq16mr3655502qvb.20.1590154422147; Fri, 22 May 2020 06:33:42 -0700 (PDT) Received: from Qians-MacBook-Air.local (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id o6sm1325452qtd.59.2020.05.22.06.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 06:33:41 -0700 (PDT) Date: Fri, 22 May 2020 09:33:35 -0400 From: Qian Cai To: Johannes Weiner Cc: linux-mm@kvack.org, Rik van Riel , Minchan Kim , Michal Hocko , Andrew Morton , Joonsoo Kim , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 09/14] mm: deactivations shouldn't bias the LRU balance Message-ID: <20200522133335.GA624@Qians-MacBook-Air.local> References: <20200520232525.798933-1-hannes@cmpxchg.org> <20200520232525.798933-10-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520232525.798933-10-hannes@cmpxchg.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 20, 2020 at 07:25:20PM -0400, Johannes Weiner wrote: > Operations like MADV_FREE, FADV_DONTNEED etc. currently move any > affected active pages to the inactive list to accelerate their reclaim > (good) but also steer page reclaim toward that LRU type, or away from > the other (bad). > > The reason why this is undesirable is that such operations are not > part of the regular page aging cycle, and rather a fluke that doesn't > say much about the remaining pages on that list; they might all be in > heavy use, and once the chunk of easy victims has been purged, the VM > continues to apply elevated pressure on those remaining hot pages. The > other LRU, meanwhile, might have easily reclaimable pages, and there > was never a need to steer away from it in the first place. > > As the previous patch outlined, we should focus on recording actually > observed cost to steer the balance rather than speculating about the > potential value of one LRU list over the other. In that spirit, leave > explicitely deactivated pages to the LRU algorithm to pick up, and let > rotations decide which list is the easiest to reclaim. > > Signed-off-by: Johannes Weiner > Acked-by: Minchan Kim > Acked-by: Michal Hocko > --- > mm/swap.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/mm/swap.c b/mm/swap.c > index 5d62c5a0c651..d7912bfb597f 100644 > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -515,14 +515,12 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec, > > if (active) > __count_vm_event(PGDEACTIVATE); > - lru_note_cost(lruvec, !file, hpage_nr_pages(page)); > } > [] mm/swap.c: In function 'lru_deactivate_file_fn': mm/swap.c:504:11: warning: variable 'file' set but not used [-Wunused-but-set-variable] int lru, file; ^~~~ This? diff --git a/mm/swap.c b/mm/swap.c index fedf5847dfdb..9c38c1b545af 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -501,7 +501,7 @@ void lru_cache_add_active_or_unevictable(struct page *page, static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec, void *arg) { - int lru, file; + int lru; bool active; if (!PageLRU(page)) @@ -515,7 +515,6 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec, return; active = PageActive(page); - file = page_is_file_lru(page); lru = page_lru_base_type(page); del_page_from_lru_list(page, lruvec, lru + active);