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=-8.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 BB42DC35280 for ; Wed, 2 Oct 2019 08:40:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5BD6C206C0 for ; Wed, 2 Oct 2019 08:40:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BD6C206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 956ED6B0005; Wed, 2 Oct 2019 04:40:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E1E46B0006; Wed, 2 Oct 2019 04:40:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CF316B0007; Wed, 2 Oct 2019 04:40:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 56CE36B0005 for ; Wed, 2 Oct 2019 04:40:21 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id CC6AA6D8D for ; Wed, 2 Oct 2019 08:40:20 +0000 (UTC) X-FDA: 75998197800.13.toe41_5a4bfee962753 X-HE-Tag: toe41_5a4bfee962753 X-Filterd-Recvd-Size: 3261 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Oct 2019 08:40:20 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 35023ACE1; Wed, 2 Oct 2019 08:40:16 +0000 (UTC) Date: Wed, 2 Oct 2019 10:40:14 +0200 From: Michal Hocko To: Yang Shi Cc: kirill.shutemov@linux.intel.com, ktkhai@virtuozzo.com, hannes@cmpxchg.org, hughd@google.com, shakeelb@google.com, rientjes@google.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm thp: shrink deferred split THPs harder Message-ID: <20191002084014.GH15624@dhcp22.suse.cz> References: <1569974210-55366-1-git-send-email-yang.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1569974210-55366-1-git-send-email-yang.shi@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 02-10-19 07:56:50, Yang Shi wrote: > The deferred split THPs may get accumulated with some workloads, they > would get shrunk when memory pressure is hit. Now we use DEFAULT_SEEKS > to determine how many objects would get scanned then split if possible, > but actually they are not like other system cache objects, i.e. inode > cache which would incur extra I/O if over reclaimed, the unmapped pages > will not be accessed anymore, so we could shrink them more aggressively. > > We could shrink THPs more pro-actively even though memory pressure is not > hit, however, IMHO waiting for memory pressure is still a good > compromise and trade-off. And, we do have simpler ways to shrink these > objects harder until we have to take other means do pro-actively drain. > > Change shrinker->seeks to 0 to shrink deferred split THPs harder. Do you have any numbers on the effect of this patch. Btw. the whole thing is getting more and more complex and I still believe the approach is just wrong. We are tunning for something that doesn't really belong to the memory reclaim in the first place IMHO. > Cc: Kirill A. Shutemov > Cc: Kirill Tkhai > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Hugh Dickins > Cc: Shakeel Butt > Cc: David Rientjes > Signed-off-by: Yang Shi > --- > mm/huge_memory.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 3b78910..1d6b1f1 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -2955,7 +2955,7 @@ static unsigned long deferred_split_scan(struct shrinker *shrink, > static struct shrinker deferred_split_shrinker = { > .count_objects = deferred_split_count, > .scan_objects = deferred_split_scan, > - .seeks = DEFAULT_SEEKS, > + .seeks = 0, > .flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE | > SHRINKER_NONSLAB, > }; > -- > 1.8.3.1 -- Michal Hocko SUSE Labs