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 X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A108C433E0 for ; Mon, 22 Jun 2020 16:56:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9704720707 for ; Mon, 22 Jun 2020 16:56:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UARv+KNJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9704720707 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ACDE46B0003; Mon, 22 Jun 2020 12:56:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A57CA6B0006; Mon, 22 Jun 2020 12:56:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9471A6B0007; Mon, 22 Jun 2020 12:56:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 753326B0003 for ; Mon, 22 Jun 2020 12:56:55 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F39F71803DD11 for ; Mon, 22 Jun 2020 16:56:54 +0000 (UTC) X-FDA: 76957452390.11.legs85_360379926e34 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 9C6C518047603 for ; Mon, 22 Jun 2020 16:56:54 +0000 (UTC) X-HE-Tag: legs85_360379926e34 X-Filterd-Recvd-Size: 4477 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 16:56:54 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id k15so3033427lfc.4 for ; Mon, 22 Jun 2020 09:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G56zBNbNj4Y3AhZRviN3/Dliwnmszp2+kuGZcYcuXG4=; b=UARv+KNJ4IB6uvPhHnkaASaBO2vDIEAMREBIbByZVBFC0SPsL8qncmblpxRoI4JhYN ILm+FhPJQkpJwbeD0auf/LVMUJ3xxZ8g0aHv4vAlokd+dgstpyte3AuJDIZoFnK+DMRO Tb03VRZG77XLcq1guQ+3SH1IgIfRyqMHwejTPNXu9o+nDnqpLZqfJmXI/fki9tbO5xqA QeodAxelUumcXGY6AVNRpVSNNsN8GrcWs/SZjX+Zs58UN7nty71TfQMCBEDWyLM378YW 37HUgm+71D1TUTxh4Ek8uRoPMHYAD3VINYLco9JXvyMnrpyVcjo90UXk8IR6+Eky1Gv1 BlIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G56zBNbNj4Y3AhZRviN3/Dliwnmszp2+kuGZcYcuXG4=; b=KNT0eY8hRQKV/6Crkl47Ln2f3yYapt/4sRAeYXbhCii5g3KambiUov/I62SVa+tSWI +DyUGe12qVOTtDAkUiiu0nEyo1hZshrFSfIPVHwnvLWCVQBi/btLLDvrS+gx77kqnXJ2 b1YoTFC3ZNItn4n2ZnzYUQlKbqmeOlxdNVexmAJFIR/f3PNDCDkelTBc+ie6/J/fdhhV YSjGIZRywGnBKBFNueyEfJJd67LWZJZAsFBiLFkoBiVI30h8itUk4jF6wEs2zLUgEqAr iyfq6uHjYIuTyDeo60C7zs8eDR2TTz3uZb1ubvFMlyuHeW3rgJgnQp72Wyk8FSfGDBIR ts3Q== X-Gm-Message-State: AOAM53056/oAf+kTtgvf4idpWXRXnfwh8Z2KjuHWPEwHkDUuDTzFVL6S Y7JmPQzgD94l3BJn/1Bq6Divv0ezV9ciY9fVnMx7Sg== X-Google-Smtp-Source: ABdhPJx+G3gCV2EIKYJWvVKwOMIN3Vwwb/ohIo/VPRgtLAyZMxdbSuPNlS7zIdjKZJLVvxtayYF2h3DUTcApcYcZ3w0= X-Received: by 2002:a05:6512:10c3:: with SMTP id k3mr10462732lfg.33.1592845012258; Mon, 22 Jun 2020 09:56:52 -0700 (PDT) MIME-Version: 1.0 References: <20200608230654.828134-1-guro@fb.com> <20200608230654.828134-13-guro@fb.com> In-Reply-To: <20200608230654.828134-13-guro@fb.com> From: Shakeel Butt Date: Mon, 22 Jun 2020 09:56:41 -0700 Message-ID: Subject: Re: [PATCH v6 12/19] mm: memcg/slab: use a single set of kmem_caches for all accounted allocations To: Roman Gushchin Cc: Andrew Morton , Christoph Lameter , Johannes Weiner , Michal Hocko , Linux MM , Vlastimil Babka , Kernel Team , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9C6C518047603 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 8, 2020 at 4:07 PM Roman Gushchin wrote: > > This is fairly big but mostly red patch, which makes all accounted > slab allocations use a single set of kmem_caches instead of > creating a separate set for each memory cgroup. > > Because the number of non-root kmem_caches is now capped by the number > of root kmem_caches, there is no need to shrink or destroy them > prematurely. They can be perfectly destroyed together with their > root counterparts. This allows to dramatically simplify the > management of non-root kmem_caches and delete a ton of code. > > This patch performs the following changes: > 1) introduces memcg_params.memcg_cache pointer to represent the > kmem_cache which will be used for all non-root allocations > 2) reuses the existing memcg kmem_cache creation mechanism > to create memcg kmem_cache on the first allocation attempt > 3) memcg kmem_caches are named -memcg, > e.g. dentry-memcg > 4) simplifies memcg_kmem_get_cache() to just return memcg kmem_cache > or schedule it's creation and return the root cache > 5) removes almost all non-root kmem_cache management code > (separate refcounter, reparenting, shrinking, etc) > 6) makes slab debugfs to display root_mem_cgroup css id and never > show :dead and :deact flags in the memcg_slabinfo attribute. > > Following patches in the series will simplify the kmem_cache creation. > > Signed-off-by: Roman Gushchin > Reviewed-by: Vlastimil Babka This is a very satisfying patch. Reviewed-by: Shakeel Butt