Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4019687ioo; Wed, 25 May 2022 13:01:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn6BPJZxD174d7kN9kLuRs+p8eM2cM4/mGNz7EbTgl+jCLdQZHkjlHEf8RuDQgaOhTdAUD X-Received: by 2002:a63:c00c:0:b0:3f6:103:5bc1 with SMTP id h12-20020a63c00c000000b003f601035bc1mr30033519pgg.404.1653508919129; Wed, 25 May 2022 13:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653508919; cv=none; d=google.com; s=arc-20160816; b=cQV78s4kRMwf9YOTjrcT/WhxRWJHLh+c2x6RD3NyepdTDew5w60CAvaYfJysV+MI0V QvSRZnK2LT80sw/tnYpVbARgbpxl9or4gLE6coTVNpp7GAa1KTEPRcJWj/hD+uzfsnrq 4b/CkZa1eCXaLpj/X8QIQqlMQBkGEvKcpfb65ubZpJtqnNaGUazHGLlLAdY3aYDXOFhp /tSaEqjPPLvnsjcDFt8gsg91IOninEhRwxcO8gKedY2ddi2Q2UqXNGi+Z5WkDWSNgtgt 3RIjKwZAQC4R8pRzunK7+smnCrCJTggiFw7LEKkS+xt9tyvxaEAbYKW4cdJwq4n1pUdg iNqA== 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:dkim-signature; bh=nDxqtsfr0dKVwqZEkCAARcK1ckdc1oO5HqeANGAWehk=; b=xiOn+i90akH9R1hTTjO4iLZEPcMOVp+tx2vjx5qrTcGIBczQpl2yK3g+rIlii1kzNs tShrm3+bCmE64DnwvKO/ZCMMPxHiKwRejl1/lqK8hWjdWhc0OGwaQAJYn3UFjjAR4e7u P2i/cPfOHEhtzmzgJ2PYeBRgO83i3OJKSTgOJcKUAl9+CH0sH2yPnsfCqq2N5W3mtf01 1YNZoqUlNaEVefRww1S+0L4OK1SmAG3e8QH3POXMGruI15uQmQjYCEX6rFnhYGm5OdFJ SLQYV0SUc7JrF7NqJI2B1CFUU8QOx98Ln/6ZYR46xBLtLppSclmmAoI0JSg9RYctk9ku kAyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=BTlOkkjr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb18-20020a17090ae7d200b001e073312c32si4631334pjb.8.2022.05.25.13.01.45; Wed, 25 May 2022 13:01:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=BTlOkkjr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244379AbiEYNJT (ORCPT + 99 others); Wed, 25 May 2022 09:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243892AbiEYNJB (ORCPT ); Wed, 25 May 2022 09:09:01 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 208BEA502C for ; Wed, 25 May 2022 06:08:56 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id a13so7991808plh.6 for ; Wed, 25 May 2022 06:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=nDxqtsfr0dKVwqZEkCAARcK1ckdc1oO5HqeANGAWehk=; b=BTlOkkjr47cZ9JCfyJeGWXO9DhAslHTm3aWUPVMOoy0syMYRM3O1lIx7Fhj5JhFIj/ BCHNH5vbygawBpqwccbSGiDpUJqjmRoKB1f5k7E7jP9h4DiDDpwbHCX0vxZOHZXfp01i VOqg35B+4koUNfXOlszBZYSIVdJuZZoj3XLhVuJ2i3P1M2jcd1ZVN7/FFPfwNvTo8S9q nCs0ReL68nU+qNvBM43jdG9B9j0xcDGvFqrmDz591lh///Kfsy8i0r5xQbvoBl5bdO75 PXdDioYydc8Vss2c+0TnSd7ygr0IlGGQYKHhONkJQhQVKH4Z5q/O2tSAzQaSp/xKXsZV Th5Q== 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=nDxqtsfr0dKVwqZEkCAARcK1ckdc1oO5HqeANGAWehk=; b=Q1DT9RweLqxympynHebzSdvO21wp4YR8P3Q3uoKPMDgnWYjZwvLPcXtN/dIBi6UZ1e YWusIMrIKFVhmnzoQ1l/9zD2eyE2nR442xD+P44DVaU0SmMoonBXV4EIsFnu12nend77 6r2L+PD1eEB3JRx6nqarGODAFWy8JhIV5Vnn/u7Ea7UKDR3XCkNAWSJmL24lkOAchODT ewr7HKQipGL5UEozMdkWSRsAHPk/sNvIBjSkpPIVehDj/rOrStVLfSz2oRhBUzmU6Qw1 zBKaVntn1sAk1ktmZAfC9kN34e6cd+ire21KJ7eoIC/aqMwAC2nVJdgRfga53vszh3Xy Dx0g== X-Gm-Message-State: AOAM5303QR4X9/j9qPcp2OCVaKR5N3RIlIYPdffUeDybGhRrRVmimExC zOJqTHMPg3JhzW480+rQTagnPg== X-Received: by 2002:a17:903:2cf:b0:151:a932:f1f0 with SMTP id s15-20020a17090302cf00b00151a932f1f0mr32523630plk.130.1653484136125; Wed, 25 May 2022 06:08:56 -0700 (PDT) Received: from localhost ([2408:8207:18da:2310:c40f:7b5:4fa8:df3f]) by smtp.gmail.com with ESMTPSA id a11-20020a17090aa50b00b001df4e851aecsm1762072pjq.3.2022.05.25.06.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 06:08:55 -0700 (PDT) Date: Wed, 25 May 2022 21:08:51 +0800 From: Muchun Song To: Johannes Weiner Cc: Roman Gushchin , mhocko@kernel.org, shakeelb@google.com, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com, longman@redhat.com Subject: Re: [PATCH v4 01/11] mm: memcontrol: prepare objcg API for non-kmem usage Message-ID: References: <20220524060551.80037-1-songmuchun@bytedance.com> <20220524060551.80037-2-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 25, 2022 at 08:37:58AM -0400, Johannes Weiner wrote: > On Wed, May 25, 2022 at 03:57:17PM +0800, Muchun Song wrote: > > On Tue, May 24, 2022 at 07:36:24PM -0700, Roman Gushchin wrote: > > > On Tue, May 24, 2022 at 02:05:41PM +0800, Muchun Song wrote: > > > > - memcg_reparent_list_lrus(memcg, parent); > > > > + memcg_reparent_list_lrus(memcg, parent_mem_cgroup(memcg)); > > > We effectively dropped this: > > > if (!parent) > > > parent = root_mem_cgroup; > > > Is it safe? (assuming v1 non-hierarchical mode, it's usually when all > > > is getting complicated) > > Yes, it's correct. But it's a quiet, incidental cleanup, so I can see > why it's confusing. It might be better to split the dead code removal > into a separate patch - with the following in the changelog ;): > Well, I can split the dead code removal into a separate patch. :-) Thanks. > > Since no-hierarchy mode is deprecated after commit bef8620cd8e0 > > ("mm: memcg: deprecate the non-hierarchical mode"), so > > parent_mem_cgroup() cannot return a NULL except root memcg, > > however, root memcg will not be offline, so it is safe. Right? >