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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 5D5BFC3A5A6 for ; Thu, 19 Sep 2019 21:10:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E7711217D6 for ; Thu, 19 Sep 2019 21:10:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Bm+fX8E+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7711217D6 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 6747C8E0007; Thu, 19 Sep 2019 17:10:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 625108E0003; Thu, 19 Sep 2019 17:10:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5142E8E0007; Thu, 19 Sep 2019 17:10:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 3115E8E0003 for ; Thu, 19 Sep 2019 17:10:25 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id C566B181AC9BF for ; Thu, 19 Sep 2019 21:10:24 +0000 (UTC) X-FDA: 75952913568.27.sheet32_3dc3027723f48 X-HE-Tag: sheet32_3dc3027723f48 X-Filterd-Recvd-Size: 4816 Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 19 Sep 2019 21:10:24 +0000 (UTC) Received: by mail-yw1-f66.google.com with SMTP id i207so1743543ywc.9 for ; Thu, 19 Sep 2019 14:10:24 -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=8fLuZdNyw0Snk0exp1fU4mQvEVp2x5alNsR3Ohooz1k=; b=Bm+fX8E+MsWWqY81xavfe3H5GLkrjQESG9r887oiAmSLvXqf8181s7bc/zmPHXEpVg Mg7AYO2OdJhxb5WVWdZOCkA+uaibGlu0EebIQdODcz4t79dvcx1cLSx+UeM8cgg4RFHQ WvjirispzY+V1lDwPTN2kPpCtZx+XD7A5D2E6Ij8Pwam5uSLI5qqHpx6M7U/ijJgEdaj 4BeiXMuJXWkmYvnAA1s1spqt7slmOHQ1bNin0UefIkOryrSUpzo7Oz3HPulkdBW3ritX 7454Ul7Dn43yZCg0DYGxDFHhWzDvcvw8FnHjrloKn/ybGR+Zz0oIDQyih7J7NhOxtMis iy/w== 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=8fLuZdNyw0Snk0exp1fU4mQvEVp2x5alNsR3Ohooz1k=; b=nWPpcO/qd6sXAuLjIdNTLeGHjN4Ak0qeFsHk0mXehVEM0fedme80Ly24MDy0Q61IAv cTiU0EmKI9HGo42TpGB4nTKgPUEtE9FpdK6ukeuw2SCrfYKE9BI3in6WU1zHdGONw5uy weApye7QXYJZBPke9MYmBbTvcPKp6C1bHtBDagDvhAiPvvan29kYjVpGhWFwKX4iWrXe V794l5Lmov1W8KopkB6DN6sZdJczxBZZ3vLV2NBhFeQxaWnr3WlSDB2Dst46tNRUofnD HNrCnd8sOiQfS6n6NgKlrKK85UtcMgmxNX6PIFpDZYJjobFmpLGBrF9iuSC1ud+nUKj6 78Iw== X-Gm-Message-State: APjAAAU6sRstlHFv7B5baxZJ3oeIhgaWl/J4/AS03qf0Tt8UDxwRSWEl 7VE8HUIU65taGlkDcvTcnI6SQWfKvnYoZeXQ2yvjIw== X-Google-Smtp-Source: APXvYqy05dUD5LdL2CsLc4dACa1bZKX2dz1Dlblo6H2A3XbIouWdeOe0BHBVElBSyh6Yw1pva4kChkZEAlJKgGu/w/I= X-Received: by 2002:a81:3c81:: with SMTP id j123mr9453956ywa.393.1568927423190; Thu, 19 Sep 2019 14:10:23 -0700 (PDT) MIME-Version: 1.0 References: <20190905214553.1643060-1-guro@fb.com> <20190919162204.GA20035@castle.dhcp.thefacebook.com> In-Reply-To: <20190919162204.GA20035@castle.dhcp.thefacebook.com> From: Suleiman Souhlal Date: Fri, 20 Sep 2019 06:10:11 +0900 Message-ID: Subject: Re: [PATCH RFC 00/14] The new slab memory controller To: Roman Gushchin Cc: "linux-mm@kvack.org" , Michal Hocko , Johannes Weiner , Linux Kernel , Kernel Team , Shakeel Butt , Vladimir Davydov , Waiman Long Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000069, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Sep 20, 2019 at 1:22 AM Roman Gushchin wrote: > > On Thu, Sep 19, 2019 at 10:39:18PM +0900, Suleiman Souhlal wrote: > > On Fri, Sep 6, 2019 at 6:57 AM Roman Gushchin wrote: > > > The patchset has been tested on a number of different workloads in our > > > production. In all cases, it saved hefty amounts of memory: > > > 1) web frontend, 650-700 Mb, ~42% of slab memory > > > 2) database cache, 750-800 Mb, ~35% of slab memory > > > 3) dns server, 700 Mb, ~36% of slab memory > > > > Do these workloads cycle through a lot of different memcgs? > > Not really, those are just plain services managed by systemd. > They aren't restarted too often, maybe several times per day at most. > > Also, there is nothing fb-specific. You can take any new modern > distributive (I've tried Fedora 30), boot it up and look at the > amount of slab memory. Numbers are roughly the same. Ah, ok. These numbers are kind of surprising to me. Do you know if the savings are similar if you use CONFIG_SLAB instead of CONFIG_SLUB? > > For workloads that don't, wouldn't this approach potentially use more > > memory? For example, a workload where everything is in one or two > > memcgs, and those memcgs last forever. > > > > Yes, it's true, if you have a very small and fixed number of memory cgroups, > in theory the new approach can take ~10% more memory. > > I don't think it's such a big problem though: it seems that the majority > of cgroup users have a lot of them, and they are dynamically created and > destroyed by systemd/kubernetes/whatever else. > > And if somebody has a very special setup with only 1-2 cgroups, arguably > kernel memory accounting isn't such a big thing for them, so it can be simple > disabled. Am I wrong and do you have a real-life example? No, I don't have any specific examples. -- Suleiman