Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp942956iob; Fri, 13 May 2022 17:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNemPTR/aWNbSUm2odgoIjkYbSEtOei624+euobl510/uhfB7cadTxYfaAhqeXS3PpxXQK X-Received: by 2002:a05:6000:1f9a:b0:20c:fdab:118f with SMTP id bw26-20020a0560001f9a00b0020cfdab118fmr236275wrb.570.1652487337712; Fri, 13 May 2022 17:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652487337; cv=none; d=google.com; s=arc-20160816; b=poJ2R7iK9whpPuj9RcMbBDaLWFdvYjTtQwlunG5loLFMAYOx01rsKY58RJk7oNYXWi S7EbLr8+9LBSykxtSMEm4xKJglsxUuoRklCnEZrxhMNJ3LnCLEMlatsM+0KzJzQleDfZ 01vPg13Vkqd5z/QNqu2ApZKbyPa3I/GN7NNLKQA78C7ioTs1QlV0gXc+/qZuKohv3Y1q 58Ma4f96vNBE7cHAznksDtH9/rXAVflkqls/E38p8NcXzSBCYftpOXVdH+s2F1lmCc5C Kt+UlCbtusMwRIuvyqYaKt44nqE7gVOGkRzSfAunMMK5s0Yu7O9zVtYZVlFrbkWwchd/ wsqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=BrAloknBKGzWWokXz+hazBEfwUJ2O3UP9AUvih3teCk=; b=zt3hPJ4gV/73/XXY5ZLZZIEtQPaVl0OXwDvSTq3PoCXokjRkkESd4T87Y4GLTd4AGb T9I6cJYT2Yz1hF2C0X/t4wH5kI2nsaAxATUOUC+C1kcnIoSOje2Vxuok4MEU0HknjCb/ shwPBxfpNAb7mq5mtWYpD+cMbrd+wEL464DwmtdIbkHXl5EgYhPYVrTxjLDIQzNl8fLT n9UaUCNIRc0YjkV49cZrCb1SKMB7d0NqTLX66BXQh8A9knD9KJhDL7qe+qexxjZ7WWEL 7/y1ecneH6FhTgT505cakTTEy05CGVRKKWlEd9OvzpTXBRorewyJ6Ej/VuzMButG5HVK 9HMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N4D5cWFx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o25-20020a1c4d19000000b003943e9734edsi6614761wmh.6.2022.05.13.17.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:15:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N4D5cWFx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7C1732AAE7; Fri, 13 May 2022 16:15:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358220AbiELTzX (ORCPT + 99 others); Thu, 12 May 2022 15:55:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351922AbiELTzV (ORCPT ); Thu, 12 May 2022 15:55:21 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E122701B2 for ; Thu, 12 May 2022 12:55:20 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id p8so5741467pfh.8 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=Qq3On9E4wighdMZ6XnWwoU3Vm70aXKXVyF5x0hqq4d0J9OLplnw0fGOqpNlxATd8C6 ZI5jHj0SeO+G8yvYZbPrNijh9M2yEft+5G8YMalywPGiLQmL+qIdCV0cQWxbBz/kYrOF 1eoTYNnpDGxmpiy6ghtCWNUORLwDQsD/6SuTbSkt2k0bQH38drs4yHGWts4X5Ep+NOAA QHrSXBl72HH34zkMfGCyotpyC9sVJlZJtT1VKO7o5xcNasnQskPItjatSJ+TKwTIcRYA j/KuKPEAq9JWHzgXsRs/ZekfV/LLOHZ3q7Bkn2xWLx5MvAgGcaR8L3qBbHaIUDjcgusg lytw== X-Gm-Message-State: AOAM530UVuAWC7x8j2wfx6frui/Vw7jQrHrhD0G9ALzKwstwg7AsbK7y PdnlLD3GqEMqSN8GUKiyo80= 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) Sender: Minchan Kim 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ;)