Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3941406pxb; Tue, 7 Sep 2021 10:51:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykuQCOnLl0N6h8dor6wx9wmww3zMharMIt2TaMkKqnGAZ+FVAgFspXhyMf9C9TUXf/lOge X-Received: by 2002:a05:6402:b37:: with SMTP id bo23mr690820edb.391.1631037087425; Tue, 07 Sep 2021 10:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631037087; cv=none; d=google.com; s=arc-20160816; b=0M09bHMblUtF+qmsx52Ab325YH5JQlvQ9Iq0yvW59OmcOg3kC0UtITfCB0yAx22PJ1 2GJerjTsi5CP3qIvkpIlkWGINRTINi4EGMuOg/tHJnVZshw0t98C5LLAZi7MdLmJ9vh6 /uF94jtWJydyZ1D7fipRA642uZZ1uKj8oLpsMU+blTpVBVpefIDjoyRQ/9vqBMLDTvpb aTRyS2fNawoCorKnIxZh5DmTZTM3PuzWl1KEzKdlFHq+2mW9dtEtytBWtAYNgsmQnEkg jGY27tN9dkbzPdISzjeq5M8ACx4FQ1MH+mWQTIG3Hnu4S+Af0aDG1WCz8HZ2XtHiitqJ xuSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9IXPyGiAA/X4aMsCwW53dWoNc2nCHqMqBLBp35K+EP8=; b=IM1t7WlywrvDDHWHSVGiEVlKQq4rLJP71K5k4nZKA1U0QJTzJwk7NRUg/1mh+ro2W4 qW6zIO2UF5ZOuOJEFjeG4Xb2RnqNHlfq4zuOxGhFP0AcZbM6xLZEqUrCccmhc/hS5d2U 77oxSuUAS0OJdHphXhl0OszuI+6hfn39N19QAuYUYL6wx9aNuRPYEu188FwYBLfK3hwq c2noshUf4ggpbOT14StWjH8W1etZOsboFV2gMRd37uQatfEkcGAXzT0A8Yn16cOSL4Kf o6oqYDHFOCn7XvmBNIgAqR08IyDboA5JF7f+VdJ0Hiyts/r2/6XSbVSPDqJELMlGvALD a2kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MyUI5QIP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd15si10997942edb.130.2021.09.07.10.51.03; Tue, 07 Sep 2021 10:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MyUI5QIP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233444AbhIGRtl (ORCPT + 99 others); Tue, 7 Sep 2021 13:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345667AbhIGRt0 (ORCPT ); Tue, 7 Sep 2021 13:49:26 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DA7FC061575 for ; Tue, 7 Sep 2021 10:48:20 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id f18so21004670lfk.12 for ; Tue, 07 Sep 2021 10:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9IXPyGiAA/X4aMsCwW53dWoNc2nCHqMqBLBp35K+EP8=; b=MyUI5QIPyPTdsUeaVxiSSonFsrWRV3WdSqFz6OS19+YnAoHxDe6cPZueAwSYrCqC0p LYULOFq+gIpvibOvB54t/l5LaZtTsx0rl1mA08rG/SvsmSBMkI0ODTn9G0lpT9qqI+Yx nRgcShBPaR+CHJjn1MFI1//O1xtg+OLp5ifmLP3CkiJCx+CWfL9njgSR8QR4rgogDvm4 jjSy0JYPtj6aP3/fuo9x8hgrxT9cuOWsd8f2OpG/Z2KHDJwfF7tiurnWv1E7C3wwkBGz ATMnhjy9K1lQgp9Tav6pB2W8yGQ2XHk6efUR2qOKTky/oJDYc2BKI/M/jhcoT8IaRKHl UGBg== 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=9IXPyGiAA/X4aMsCwW53dWoNc2nCHqMqBLBp35K+EP8=; b=iWzQgjTLMxxelLs4sEoZyICUjBHHCZBjUc/4TKLO8SL4Au9wSg8UJ13Tqs3gVhRuep f1VwFPTgJ7EXJPeas/dyOA/ZuxBlX3b4V/O5dwE5Tr64zwW+v5Iw4UGkZLAp1VrDS3T7 QKh1tu1e+trdengOvaxv/Y/JMa7/qY/EFDC9H+RtYvh4RZSmf2vy+1mcGWEWJJ/fFZFw kx+DwwezRMI2OJKH86fPavYg66hUDydsVrkYZeE4emis0gM5Z7riIqxb3gAzBpTzf84T P4ck6rm1JNt6bp91lZCVjaAGuHJshZCwvGjbyvVnMwJl4OpeQiG6A8fLEBIDlCI3+bcj yQQA== X-Gm-Message-State: AOAM533v2dMAio0cXgbFQd4X1mIt+MeRS8uaPAQY9jlr9E7Cd+0wYuNW yByFD6xe5a8khIsBv5QCAAes5SOvDpajr+9BDcH0hQ== X-Received: by 2002:ac2:4e0c:: with SMTP id e12mr13873258lfr.264.1631036898182; Tue, 07 Sep 2021 10:48:18 -0700 (PDT) MIME-Version: 1.0 References: <20210907150757.GE17617@xsang-OptiPlex-9020> <774dee70-69bd-9f95-d197-4cff83e4e633@kernel.dk> In-Reply-To: From: Shakeel Butt Date: Tue, 7 Sep 2021 10:48:06 -0700 Message-ID: Subject: Re: [memcg] 0f12156dff: will-it-scale.per_process_ops -33.6% regression To: Roman Gushchin Cc: Tejun Heo , Jens Axboe , Linus Torvalds , kernel test robot , Vasily Averin , Alexander Viro , Alexey Dobriyan , Andrei Vagin , Borislav Petkov , Borislav Petkov , Christian Brauner , Dmitry Safonov <0x7f454c46@gmail.com>, "Eric W. Biederman" , Greg Kroah-Hartman , "H. Peter Anvin" , Ingo Molnar , "J. Bruce Fields" , Jeff Layton , Jiri Slaby , Johannes Weiner , Kirill Tkhai , Michal Hocko , Oleg Nesterov , Serge Hallyn , Thomas Gleixner , Vladimir Davydov , Yutian Yang , Zefan Li , Andrew Morton , LKML , lkp@lists.01.org, kernel test robot , "Huang, Ying" , Feng Tang , Zhengjun Xing Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 7, 2021 at 10:31 AM Roman Gushchin wrote: > > On Tue, Sep 07, 2021 at 07:14:45AM -1000, Tejun Heo wrote: > > Hello, > > > > On Tue, Sep 07, 2021 at 10:11:21AM -0700, Roman Gushchin wrote: > > > There are two polar cases: > > > 1) a big number of relatively short-living allocations, which lifetime is well > > > bounded (e.g. by a lifetime of a task), > > > 2) a relatively small number of long-living allocations, which lifetime > > > is potentially indefinite (e.g. struct mount). > > > > > > We can't use the same approach for both cases, otherwise we'll run into either > > > performance or garbage collection problems (which also lead to performance > > > problems, but delayed). > > > > Wouldn't a front cache which expires after some seconds catch both cases? > > I'm not sure. For the second case we need to pack allocations from different > tasks/cgroups into a small number of shared pages. It means the front cache > should be really small/non-existing. For the first case we likely need a > substantial cache. Maybe we can do something really smart with scattering > the cache over multiple pages, but I really doubt. I think we need to prototype this to sensibly evaluate. Let me know if you want to take a stab at this otherwise I can try.