Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1050092rdg; Wed, 11 Oct 2023 12:51:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUCKcbxViPl3K3/gdMtCmCOTzon2On8on9LwZ77GbXTnkEpVJV11TXWFChgDUFwOpiIQKP X-Received: by 2002:a17:90a:1196:b0:262:f449:4497 with SMTP id e22-20020a17090a119600b00262f4494497mr20510664pja.2.1697053876180; Wed, 11 Oct 2023 12:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697053876; cv=none; d=google.com; s=arc-20160816; b=Fk3eXnm4Oz/TqI1iy/IRtcqvp8EUP1pJ5bSfk+e4W7bXbkZcl+MO0NmqrGfMeI8FP9 8+z9FnDAYbAgtauike83Qx5c4TVuLFqAWTKukcZHjH+wYMAb+HqBQ0I2QZ9eOCOANfI2 JLODPNmpFkGzVTn34H7aCdSHDFYlNTzfqGaWrrydXf+nhnq/jy0NyzM8QHxNNTiUeWoO LI0CMPJFjYVtWkjkeyaMcKWZnAaq4V5sWiz4ESgHOtCkpj6tux3iVIsjY5mRIcBTp2Ly KySUwxTDqzQrZQEO6cM22rvWBj39F9f2zUGtFw760AoSQBgjPGuPA48stE6WrcTNRB9U A9hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=d+xtwxP2GC6kynmr5TxkkaN6Dd0EQSD998taM6zjmZM=; fh=5yJCFl0E4GBItsE5gnZmBCRQCw2sx236sRuDrmal1bw=; b=K7bKe1bLoaMzM7SYLTxk3pPEDPjjOP01ctgDhHUN0mUkoGbiVty2i/4lazJDj2Egf7 Gns/kPSGARVPWbYOWqJZj41aAKCVnlLVtm+zB8dhBVHbKODkEjLxWlDRfiwblVXLcIv6 53PJIwCMbyYYSkS2DpyIfncAJaaRJ8zQk7ZAFlbf8NcARfuAR+UGqWy80MS3gYo8nywN yBhFinJ09uglJly4TeUn47WACylzhy7dcKKOU1O//tfWCvwv8/9w16N2J8t9A4tbdA91 Zfm1M8aTWBaz4MFiEcKo93EGvm6VwOLcR2uW9ezE29eBiMhhOmcEbTcS0u9ghi/3nyxl 3iFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=aH9SKfTj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ls9-20020a17090b350900b00276945c92c1si627849pjb.36.2023.10.11.12.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 12:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=aH9SKfTj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 69F11804238F; Wed, 11 Oct 2023 12:51:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233151AbjJKTvH (ORCPT + 99 others); Wed, 11 Oct 2023 15:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232789AbjJKTvG (ORCPT ); Wed, 11 Oct 2023 15:51:06 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39EAE94 for ; Wed, 11 Oct 2023 12:51:05 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5a7a6fd18abso3225087b3.1 for ; Wed, 11 Oct 2023 12:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697053864; x=1697658664; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=d+xtwxP2GC6kynmr5TxkkaN6Dd0EQSD998taM6zjmZM=; b=aH9SKfTjQQPm7zt5NpDoSSUrBv05JMJpjwuakeAh7Lqdm9ucO+spkUVIoQX4Tyie40 Ke9qmroayCawzLLFFaeQizOk5TB1T0r5N8au45Hh1SP3IqrR7BHe3Itau4ZlPollbtLN GP/BS0yAaT+n9waIRYfTQXhcV7ZaNrjtgXkcUqSEbq4q9D3zRNiWlaDNfjU+W5JH3RG/ z0DLm50Kyj1BNnfru9znffDzSgdwZI7EOZ5T31KXC10i04gyibFe2CKz98xIH7cFvPDa fkZD3m6Osomtu7uoGNPZcSq2JTIMD4GMDe6MZe/qfcD7n/O5VR/SxtpIbaf+FVXdUD5Z /sdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697053864; x=1697658664; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d+xtwxP2GC6kynmr5TxkkaN6Dd0EQSD998taM6zjmZM=; b=aGRoHejT9BxQM6tHWAKf2sCs/jS78Iutjo+WHFcgg5WMCRcLbTvKJMelXASnH6Xf8s pKd+l03EGNjTgj3loDFlnyYpi/75c3Qy1Uw6GS4TKHhOA9EGnv4NuMyAR4Ep9CJFWtjF 5goA4AyCo9H/6zo1qcCiPNS2gVme8s91YofiS1GNPJeri9NqBvroOyVsadhTQupGF7BM FwXOMZ141fK/0Fkw/sphz3O+4X2yvwK4pqyHcbrYV9ns64a+z/pjfjOD1SCxKsI9lYaO UuAsPCjHeFEYPr0AW5WKJ7koQKTPNhj1PVA/AE7j8p/LeM091hOV8Vn/sDA230aGQ69a kygw== X-Gm-Message-State: AOJu0YycUSv4Ee0F4t/WP2kDcolYBEEzVAd0g8xymHah8aKPpbtV4cQl s3l/vAgbCx6bzbgqjvTKArW/5Vu4iZng9Q== X-Received: from shakeelb.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:262e]) (user=shakeelb job=sendgmr) by 2002:a25:df45:0:b0:d9a:3e96:b549 with SMTP id w66-20020a25df45000000b00d9a3e96b549mr140481ybg.10.1697053864458; Wed, 11 Oct 2023 12:51:04 -0700 (PDT) Date: Wed, 11 Oct 2023 19:51:02 +0000 In-Reply-To: <20231010000929.450702-4-roman.gushchin@linux.dev> Mime-Version: 1.0 References: <20231010000929.450702-1-roman.gushchin@linux.dev> <20231010000929.450702-4-roman.gushchin@linux.dev> Message-ID: <20231011195102.mym2mrgqyavp3n6r@google.com> Subject: Re: [PATCH v2 3/5] mm: kmem: make memcg keep a reference to the original objcg From: Shakeel Butt To: Roman Gushchin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Johannes Weiner , Michal Hocko , Muchun Song , Dennis Zhou , Andrew Morton , David Rientjes , Vlastimil Babka , Naresh Kamboju Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 12:51:13 -0700 (PDT) On Mon, Oct 09, 2023 at 05:09:27PM -0700, Roman Gushchin wrote: > Keep a reference to the original objcg object for the entire life > of a memcg structure. > > This allows to simplify the synchronization on the kernel memory > allocation paths: pinning a (live) memcg will also pin the > corresponding objcg. > > The memory overhead of this change is minimal because object cgroups > usually outlive their corresponding memory cgroups even without this > change, so it's only an additional pointer per memcg. > > Signed-off-by: Roman Gushchin (Cruise) Acked-by: Shakeel Butt