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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70D97C433F5 for ; Sun, 23 Jan 2022 21:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mYCCdITWb3ONgS4Yt+L6eeHDUAl26UcYwhu+NlY4LRY=; b=2bv12YUd2hE5py uwy/RWFSJqjuwSdnWtZhnezrAgD1FD13ZqVLVZm7Vhzqe5GYodY1Pdl/Zqi2AD2HTN8MfMuq9H6ZR l4hvc/zYJR9FJP7v8Htj/F+E9kL4IeKcRaA16ZoyLVVAK/LzUQp/l4nibd1i4gbZI4SATMyQIQjLH Ru0dHbybPV2iNEtx5lwzqvOuTalJSnbEwjrk2ypLYfC/HQw7l3swXYz0XpLiYUKqYWfX7LvaUd35D 8XRDx+KyhcqQBwEhg0vkpyqx9jPtCfBQlC8+BzzBCie3MsU7S+Ng1xj54JfH7Nmv7BrnTIRnkMEb5 8YGiGH6v4TAagQ8hbrkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBkbO-001pYi-10; Sun, 23 Jan 2022 21:40:46 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBkbK-001pXk-EI for linux-arm-kernel@lists.infradead.org; Sun, 23 Jan 2022 21:40:43 +0000 Received: by mail-io1-xd33.google.com with SMTP id w7so17288843ioj.5 for ; Sun, 23 Jan 2022 13:40:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IyKNPXR0xXBAL80gtxnxeT19PyLCAGmnDeiaMG7++bM=; b=ZMlU5JvaMGRzZqWwhMytbclyq2hK+DR3jCfjxiTok0CS8FFyYCsm/UFaEtOyfdSk5d kdtDiVMulhEgRlVhTMXABPMK7hLpwFGzeajhi/W9rVzcnuu9ME4FK9ShDLgi/D0BXH+O PQiTqpuxJngULJ6oaET3u7sRaihthGRaApk0q5G5fZTetiQ/60Kocm74RrILXTUc1tT8 SAaEc8KTvcOMSd3QUG+gAnOEsETBwbGBmdvn/pETf8PFCVxiQtnjoA9jMVbQeparWeJ+ sRpsptQQ0obvOnaqu5N0/rjQ/Zg1xGqcTus8V6e1Ykc2aqAFUi9zfKZ/IYjWxqn2tSr2 ifSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IyKNPXR0xXBAL80gtxnxeT19PyLCAGmnDeiaMG7++bM=; b=DeYWgi3+JKZDE2VjsYeKgWOyvbdiGXqQ6+mDQtfQsQCRK2r0P1Q/yi17PQGlfR1f4T KNHEodod+nOo1oxmyHD9FWY3eLzvdiyWt/hAI1WK1L+q1HX1Ous3Gs/cVz2LrkIoAtli D+REJC9vmNA9NKza6mhpLTXP/2Qoi08Gf9QPTB9TchcXGmk4O0XzGneVpHn5N19eUhIL imJa/22KPcS5v0AYRCkRHqhe9LzdRojdPfNKlSEY4H9cQ8X8KwHDb3GlK1IwJ0VuTmp+ OZ9WKV10i5bZhkctJGeZJUqmAm5tPKVgvdFGRpEkNB0XKvmGqYKAzKGnHC3/Wsd455n6 wLGA== X-Gm-Message-State: AOAM533CLZQalr94eUY6KDM/qqflpVe3cilWrDrPAIXV9Cdl8Vu0DxKB BnY8Ja9YqcPZO0s7vMKCA92Srw== X-Google-Smtp-Source: ABdhPJzxHVZd/U5xuji1+wbXuf3oi0S1JW3F72Mw005SIgUl8rEA/x+DErKmKSlc6HG3ZjPbcd2wog== X-Received: by 2002:a05:6638:ec7:: with SMTP id q7mr5992263jas.210.1642974041316; Sun, 23 Jan 2022 13:40:41 -0800 (PST) Received: from google.com ([2620:15c:183:200:b551:d37:7fd2:5a1a]) by smtp.gmail.com with ESMTPSA id w19sm5474492iov.16.2022.01.23.13.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 13:40:40 -0800 (PST) Date: Sun, 23 Jan 2022 14:40:36 -0700 From: Yu Zhao To: Michal Hocko Cc: Andrew Morton , Linus Torvalds , Andi Kleen , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Matthew Wilcox , Mel Gorman , Michael Larabel , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Konstantin Kharlamov Subject: Re: [PATCH v6 6/9] mm: multigenerational lru: aging Message-ID: References: <20220104202227.2903605-1-yuzhao@google.com> <20220104202227.2903605-7-yuzhao@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220123_134042_523582_36F71553 X-CRM114-Status: GOOD ( 20.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 13, 2022 at 12:57:35PM +0100, Michal Hocko wrote: > On Wed 12-01-22 16:43:15, Yu Zhao wrote: > > On Wed, Jan 12, 2022 at 11:17:53AM +0100, Michal Hocko wrote: > [...] > > > Is there any reason you are not using folio_memcg_lock in the > > > pte walk instead? > > > > We have a particular lruvec (the first arg), hence a particular memcg > > to lock. But we don't have a particular page to lock. > > That is certainly true at this layer but the locking should be needed > only for specific pages, no? Yes. > So you can move the lock down to the > callback which examines respective pages. Or is there anything > preventing that? No. > To be honest, and that is the reason I am asking, I really do not like > to open code the migration synchronization outside of the memcg proper. Agreed. > Code paths which need a stable memcg are supposed to be using > folio_memcg_lock for the specific examination time. No argument here, just a clarification: when possible I prefer to lock a batch of pages rather than individual ones. > If you prefer a > trylock approach for this usecase then we can add one. Done. Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel