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 4BEC9C433FE for ; Thu, 3 Mar 2022 21:44:59 +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=pjD5fw5o+U/WQSZDVgIqFInQpEe0mAEMCFrkYNIANWQ=; b=Fj73btAiAM+Cb6 6W5t4u6l8c32UlH+s3eGn2zrqHsbIwgDMYPFZimTVddlEqg72amcT2v9dUoGLy46qqS0ldY038Urk 5Q8KuKZ2u8XUY218qzodGGvnQPLCD7kUAUYX82e0YT9KsBOMov//HnI5me/e4T8Ap9CT/JfILFEx5 YMCCAVfIR4Z9Q88aUeK9WfDe+PAFPrnLoqWZtw0XdgD3o80WTv7WAnV1PoPuets3cnFUDW63EZHbE A6GQro4J0764Kp0F3+LqIhx+doEh7ZaHsfvY0SC3ztYvXIlxk4woKsaaCMh0NWxAiWIcVg26jEu9c dduf9FD72Yexl1JoUz2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPtEl-007rOM-9f; Thu, 03 Mar 2022 21:43:51 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPtEf-007rMF-Td for linux-arm-kernel@lists.infradead.org; Thu, 03 Mar 2022 21:43:48 +0000 Received: by mail-qt1-x82c.google.com with SMTP id s15so5832043qtk.10 for ; Thu, 03 Mar 2022 13:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hTwwN6PiJVHaKqnPKPesjc7eXIn2FCgdMkVnCPREWLc=; b=bq6u4nU32h9czB4hqHrURQXbdgy/m7NrxkgoFp2Hqjia8te+uATT004m1EnZOopthW GaTmCBg8Xik6cbS1qGfn/dB5PE1l8OmlWNnFC1WEwdu0EKjaFsGPZd5uUw034wyTvgh/ O6UrmV5s5rdSOlBF+7Wz3yOiFHWzI6DVlAOh19zoSm/F9UD9jwpnv80X/k6AqicljJB2 h0KU8+QZaCRLxl78mf3LXT1f8fVPzTtYE2OiNQrWkE8P3qCE0pkNleQB8vD6O55BKalo wmrD51eJCZvV/qXZBBG09fPPU9Az1vVhsH5OdNVrecuZhj6Ft3kRYHUEoaxiOa4TtXIS TFhQ== 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=hTwwN6PiJVHaKqnPKPesjc7eXIn2FCgdMkVnCPREWLc=; b=GmLvaQvc+bN0jEw9v0jhi5kGteuIJp+nPRSWhYR4PEABGEFjvAlOezhAsfoXHmVeOY Vuyuocdl3PWRtY0Oie7ARDDpNmTjVA3Jhs23lBMY/DH7dFZhN/Qs6CZaPPrK9+9jU/Xh iELNW12digr+roHN6MsbXaXqE4abCIpdO3ujNyG5T1SPK+6Dl7KeLG39txbbow9/PgTM Tsq3IuY2wNOy0ozn9FV2+YPnJqAW8IQzUZztGiWxEKjvKMnAIbteLQmHXWbg7j9fxEQD mQU0AWc7ddZmO5z/AxOaKZE/OOaj/IgGBEzZlhkKQQJOF+sGniSnKCJBFw3EqyDkmDRi mVDw== X-Gm-Message-State: AOAM5337e9lvF5IRwrJWU4mPoiFl0i6M6rBqUG6KGOAGk23N+B5b/aBw j43h7xMZlsaHciV43CKarjabGA== X-Google-Smtp-Source: ABdhPJzFu79fPe/pA+ZUmBn0NTH8kz6UBe2UfFjuH7s7jtI5XJqDyMox+AgQF9nHb+vLn+ADauoR2g== X-Received: by 2002:ac8:7c4b:0:b0:2dc:a139:52c7 with SMTP id o11-20020ac87c4b000000b002dca13952c7mr29178649qtv.188.1646343824657; Thu, 03 Mar 2022 13:43:44 -0800 (PST) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id c6-20020ac87d86000000b002ddd9f33ed1sm2376259qtd.44.2022.03.03.13.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 13:43:43 -0800 (PST) Date: Thu, 3 Mar 2022 16:43:43 -0500 From: Johannes Weiner To: Yu Zhao Cc: Andrew Morton , Mel Gorman , Michal Hocko , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Michael Larabel , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , Linux-MM , Kernel Page Reclaim v2 , the arch/x86 maintainers , Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?iso-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh Subject: Re: [PATCH v7 04/12] mm: multigenerational LRU: groundwork Message-ID: References: <20220208081902.3550911-1-yuzhao@google.com> <20220208081902.3550911-5-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-20220303_134345_995418_FD30565D X-CRM114-Status: GOOD ( 32.32 ) 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, Mar 03, 2022 at 12:26:45PM -0700, Yu Zhao wrote: > On Thu, Mar 3, 2022 at 8:29 AM Johannes Weiner wrote: > > On Mon, Feb 21, 2022 at 01:14:24AM -0700, Yu Zhao wrote: > > > On Tue, Feb 15, 2022 at 04:53:56PM -0500, Johannes Weiner wrote: > > > > On Tue, Feb 15, 2022 at 02:43:05AM -0700, Yu Zhao wrote: > > > > > On Thu, Feb 10, 2022 at 03:41:57PM -0500, Johannes Weiner wrote: > > > > > > You can drop the memcg parameter and use lruvec_memcg(). > > > > > > > > > > lruvec_memcg() isn't available yet when pgdat_init_internals() calls > > > > > this function because mem_cgroup_disabled() is initialized afterward. > > > > > > > > Good catch. That'll container_of() into garbage. However, we have to > > > > assume that somebody's going to try that simplification again, so we > > > > should set up the code now to prevent issues. > > > > > > > > cgroup_disable parsing is self-contained, so we can pull it ahead in > > > > the init sequence. How about this? > > > > > > > > diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c > > > > index 9d05c3ca2d5e..b544d768edc8 100644 > > > > --- a/kernel/cgroup/cgroup.c > > > > +++ b/kernel/cgroup/cgroup.c > > > > @@ -6464,9 +6464,9 @@ static int __init cgroup_disable(char *str) > > > > break; > > > > } > > > > } > > > > - return 1; > > > > + return 0; > > > > } > > > > -__setup("cgroup_disable=", cgroup_disable); > > > > +early_param("cgroup_disable", cgroup_disable); > > > > > > I think early_param() is still after pgdat_init_internals(), no? > > > > It's called twice for some reason, but AFAICS the first one is always > > called before pgdat_init_internals(): > > > > start_kernel() > > setup_arch() > > parse_early_param() > > x86_init.paging.pagetable_init(); > > paging_init() > > zone_sizes_init() > > free_area_init() > > free_area_init_node() > > free_area_init_core() > > pgdat_init_internals() > > parse_early_param() > > > > It's the same/similar for arm, sparc and mips. > > Thanks for checking. But I'd rather live with an additional parameter > than risk breaking some archs. As per above, somebody is going to try to make that simplification again in the future. It doesn't make a lot of sense to have a reviewer trip over it, have a discussion about just how subtle this dependency is, and then still leave it in for others. parse_early_param() is documented to be called by arch code early on, there isn't a good reason to mistrust our own codebase like that. And special-casing this situation just complicates maintainability and hackability. Please just fix the ordering and use lruvec_memcg(), thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel