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 845DCC433EF for ; Thu, 12 May 2022 19:55:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCB836B0073; Thu, 12 May 2022 15:55:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B795F6B0075; Thu, 12 May 2022 15:55:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A42046B0078; Thu, 12 May 2022 15:55:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 964A66B0073 for ; Thu, 12 May 2022 15:55:21 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 57E5220D98 for ; Thu, 12 May 2022 19:55:21 +0000 (UTC) X-FDA: 79458145242.19.A4F9079 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf09.hostedemail.com (Postfix) with ESMTP id 4937A14009B for ; Thu, 12 May 2022 19:55:12 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id x23so5753351pff.9 for ; Thu, 12 May 2022 12:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BrAloknBKGzWWokXz+hazBEfwUJ2O3UP9AUvih3teCk=; b=N4D5cWFxJXwYO+Z9SIDfcfVXYPwfj3OhyZMfpDvEAmGo+DAn/cmubjX5MKM0VhBsIn wU4HSjOrYVW1O/W+wXtBbA23aBek6h9o8Bx+6BBHreVLaH09/hLYumbswb2T79VUL6P6 pGeV+TrdmMYy4XeKEgDprNkrcg3vbX4rhWELikMEt9hg0rgyPEbviQgDonAEhVXGn2dT nXseM+nxsKcjpzU2wi+psu7HGC7XTOSbK7ulO2Yfslb/jYTzWjVYOapwIveV5F+OFH+V DZRHnURF440henKLWxQGG40AVg28HKU382dttDznh6KMowlqSW+XYBwJNC5Rnkc1qpOU VqVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=BrAloknBKGzWWokXz+hazBEfwUJ2O3UP9AUvih3teCk=; b=ioaj+eD+ZcqR6EGZcfbj5qVGve4WzFp/O9cduFpwCttWXjrlt43jKoYao4qH2R9JMX o/m/JrqgxuyckMOAf2OcTN58TjDhnCCvq3tTZB/FMr1SAcaGFS0zmS4yikfdCj9DA6aR 9WrBquOHLspynnzpLhcbP5qv6moIxgKAg4I46A8vmruI59A7YsEnFJrHzkTAmPZQjoz9 LymwWG3Ti6Oy//suC/JYzPTkeC5go5APC6JDllW5Aog4XCMFx+DYdYHY5avCTugOB/tf prJlPGnzJej5m+WKqOlcRLO/qhkcwUfeE0ZGZ+gMVbyX8lDeCZ37sx01dPHwl2ySzNO2 4lqQ== X-Gm-Message-State: AOAM532tbliXjJwK7XKjImBwCCXSxPPOD4kvx2oAcCk5j4L4Y40KZVhz xWuhPyNWsWxXgFVKIgxaCxU= X-Google-Smtp-Source: ABdhPJzmTzf76vaLA/IN6uWCznkqk2dWYfJtSSj+skNIBq99cZP8XamENPr/f/xjBoqNDoDO85MJFA== X-Received: by 2002:a63:8741:0:b0:3c6:a7d9:5d05 with SMTP id i62-20020a638741000000b003c6a7d95d05mr966539pge.313.1652385319494; Thu, 12 May 2022 12:55:19 -0700 (PDT) Received: from google.com ([2620:15c:211:201:872f:bbca:8e23:fae5]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b0015e8d4eb21bsm307174plr.101.2022.05.12.12.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 12:55:18 -0700 (PDT) Date: Thu, 12 May 2022 12:55:16 -0700 From: Minchan Kim To: Andrew Morton 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: References: <20220510215423.164547-1-minchan@kernel.org> <20220511153349.045ab3865f25920dce11ca16@linux-foundation.org> <20220511190523.7d159b2e9caccbf13469e74e@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220511190523.7d159b2e9caccbf13469e74e@linux-foundation.org> X-Rspamd-Queue-Id: 4937A14009B X-Stat-Signature: ri966w988u5ur5mtbm5cnqpbhpmiwu4j X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=N4D5cWFx; spf=pass (imf09.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-Rspamd-Server: rspam09 X-HE-Tag: 1652385312-667146 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000589, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 11, 2022 at 07:05:23PM -0700, Andrew Morton wrote: > 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"? I meant the aging is not rocket science. > > > > > > > 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? Yeah, let me create a worst test case to see how it goes. A thread keep reading a file-backed vma with 2xRAM file but other threads keep changing other vmas mapped at the same file so heavy i_mmap_rwsem contention in aging path. > > It's a bit of a drag, but if we don't do it, our users surely will ;)