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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C20F2C433EF for ; Thu, 12 May 2022 02:05:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA80E8D0002; Wed, 11 May 2022 22:05:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2F368D0001; Wed, 11 May 2022 22:05:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA8178D0002; Wed, 11 May 2022 22:05:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B45FE8D0001 for ; Wed, 11 May 2022 22:05:26 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 765673112E for ; Thu, 12 May 2022 02:05:26 +0000 (UTC) X-FDA: 79455449052.24.E477DD4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 8F965400A7 for ; Thu, 12 May 2022 02:05:23 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EEB1660BD4; Thu, 12 May 2022 02:05:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09974C340EE; Thu, 12 May 2022 02:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652321124; bh=yxFRds1Pcg/OQ1UUPuRr6YvsChTNPVzsOfJva8s6jvo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pEXmVdnJizJwS6RzO8590cF/lPKNz00suPvYyvizRI5sKB8CJIErNrzEDaUbvg9dE VIRveG9ox9HlD4bjI3S8sW48i4ZJWS+BdgvJhWfYw0fuh5CIDWqmMXUzDdxssjpP28 2qjaUq02IscCgOxHdyQDb+rTbg+JSc9jPgTrJF3g= Date: Wed, 11 May 2022 19:05:23 -0700 From: Andrew Morton To: Minchan Kim Cc: LKML , linux-mm , Suren Baghdasaryan , Michal Hocko , John Dias , Tim Murray , Matthew Wilcox , Vladimir Davydov , Martin Liu , Johannes Weiner Subject: Re: [PATCH v4] mm: don't be stuck to rmap lock on reclaim path Message-Id: <20220511190523.7d159b2e9caccbf13469e74e@linux-foundation.org> In-Reply-To: References: <20220510215423.164547-1-minchan@kernel.org> <20220511153349.045ab3865f25920dce11ca16@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8F965400A7 X-Stat-Signature: ru8wqxmx8dtpfhm1wpz7d9fxspeprztz Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=pEXmVdnJ; dmarc=none; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-HE-Tag: 1652321123-474065 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, 11 May 2022 15:57:09 -0700 Minchan Kim wrote: > > > > Could we burn much CPU time pointlessly churning though the LRU? Could > > it mess up aging decisions enough to be performance-affecting in any > > workload? > > Yes, correct. However, we are already churning LRUs by several > ways. For example, isolate and putback from LRU list for page > migration from several sources(typical example is compaction) > and trylock_page and sc->gfp_mask not allowing page to be > reclaimed in shrink_page_list. Well. "we're already doing a risky thing so it's OK to do more of that thing"? > > > > Something else? > > One thing I am worry about was the granularity of the churning. > Example above was page granuarity churning so might be execuse > but this one is address space's churning, especically for file LRU > (i_mmap_rwsem) which might cause too many rotating and live-lock > in the end(keey rotating in small LRU with heavy memory pressure). > > If it could be a problem, maybe we use sc->priority to stop > the skipping on a certain level of memory pressure. > > Any thought? Do we really need it? Are we able to think of a test which might demonstrate any worst case? Whip that up and see what the numbers say? It's a bit of a drag, but if we don't do it, our users surely will ;)