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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 89C4BC433B4 for ; Mon, 12 Apr 2021 19:52:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AEA56103D for ; Mon, 12 Apr 2021 19:52:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AEA56103D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 857AE6B006C; Mon, 12 Apr 2021 15:52:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E05E6B006E; Mon, 12 Apr 2021 15:52:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60C326B0070; Mon, 12 Apr 2021 15:52:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 3A2B96B006C for ; Mon, 12 Apr 2021 15:52:23 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E68F0824934B for ; Mon, 12 Apr 2021 19:52:22 +0000 (UTC) X-FDA: 78024761724.02.871BE72 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf16.hostedemail.com (Postfix) with ESMTP id BD2A980192C0 for ; Mon, 12 Apr 2021 19:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618257141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kEsyK2g9kHom6z8QSkc+1WTaBxF4g3Yjct+1jOELHcQ=; b=c7/00ltqNSiQ6PdHoLaTZCAA9SicKWInj97K/N2PXeYifFT7Ifj06YuEk3JTGCsAKlnAmM J7FZ3IfwlTnZFExY1NvIy9LA03x5qtjHNYJI7h/ofvYbyBPFby47+axjDasV27gDXr8ySf VPaKfW78+E7vor96BN8d4fJykT41D8o= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-2wmEkd13NXSyOjyNHBm4Dg-1; Mon, 12 Apr 2021 15:52:07 -0400 X-MC-Unique: 2wmEkd13NXSyOjyNHBm4Dg-1 Received: by mail-qt1-f197.google.com with SMTP id h22so6866935qtb.6 for ; Mon, 12 Apr 2021 12:52:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=kEsyK2g9kHom6z8QSkc+1WTaBxF4g3Yjct+1jOELHcQ=; b=ZlW7dHrSW400rc23/7zWS0EB49miJACk+4pMed8pAUCDfZD0ipMEimrqB/eVoyd9Fp H5UCZ28qQHeztr9cCvI193xXkAka/fD/2KAPA6+fAx7+HXBuOeGVuumCicMF1/wKxndU pxRRDyaWbnlONwhWOtBYSsPx6f9zhZrLVsvU1mlioo52iXyS6kMxzhyLYNBOwyUehJ7q at9npbp/NHIAYXStn6UI2lnbL4v2gLv0IsKC3r+YdFXSO479TDASvk+DgmRWIEStzIPm euN61dqH/Cq+GCyt/9MV6ilhgAqlp86PQCizIBhali+Hi3EyQ1BwJF8AX012CGQbNcJy pvKg== X-Gm-Message-State: AOAM5330xIdLy+RQaVdHMmIXyqyYLVMYyLlef3uOEU4+ukTV+aU9ot+3 Xxrfof+k6UC4bXq59P6WV2Kc+k2FKBZW76jzUr2TL69Z+fixImtiF3Zp3qUkeY64uWLT/RJcSCK C+adIzeaSHVA= X-Received: by 2002:a05:620a:132a:: with SMTP id p10mr3286749qkj.165.1618257127138; Mon, 12 Apr 2021 12:52:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKH+lNuLlL7aD09WaoehTTXPuqbCVRZbhiAmNL0Qw6hKshPAX2h5hY1AbftX2FVtoNOxOIkQ== X-Received: by 2002:a05:620a:132a:: with SMTP id p10mr3286713qkj.165.1618257126892; Mon, 12 Apr 2021 12:52:06 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id j129sm8652011qkf.110.2021.04.12.12.52.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Apr 2021 12:52:06 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH 0/5] mm/memcg: Reduce kmemcache memory accounting overhead To: Roman Gushchin Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Tejun Heo , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt , Muchun Song , Alex Shi , Chris Down , Yafang Shao , Alexander Duyck , Wei Yang , Masayoshi Mizuma References: <20210409231842.8840-1-longman@redhat.com> Message-ID: <74f8abd9-9efc-3ded-e8cb-8e3465873383@redhat.com> Date: Mon, 12 Apr 2021 15:51:52 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=llong@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BD2A980192C0 X-Stat-Signature: bufpio9kh83ig65un8eufeq6j6z6ypm7 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618257141-370081 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 4/12/21 3:05 PM, Roman Gushchin wrote: > On Fri, Apr 09, 2021 at 07:18:37PM -0400, Waiman Long wrote: >> With the recent introduction of the new slab memory controller, we >> eliminate the need for having separate kmemcaches for each memory >> cgroup and reduce overall kernel memory usage. However, we also add >> additional memory accounting overhead to each call of kmem_cache_alloc() >> and kmem_cache_free(). >> >> For workloads that require a lot of kmemcache allocations and >> de-allocations, they may experience performance regression as illustrated >> in [1]. >> >> With a simple kernel module that performs repeated loop of 100,000,000 >> kmem_cache_alloc() and kmem_cache_free() of 64-byte object at module >> init. The execution time to load the kernel module with and without >> memory accounting were: >> >> with accounting = 6.798s >> w/o accounting = 1.758s >> >> That is an increase of 5.04s (287%). With this patchset applied, the >> execution time became 4.254s. So the memory accounting overhead is now >> 2.496s which is a 50% reduction. > Btw, there were two recent independent report about benchmark results > regression caused by the introduction of the per-object accounting: > 1) Xing reported a hackbench regression: > https://lkml.org/lkml/2021/1/13/1277 > 2) Masayoshi reported a pgbench regression: > https://www.spinics.net/lists/linux-mm/msg252540.html > > I wonder if you can run them (or at least one) and attach the result > to the series? It would be very helpful. Actually, it was a bug reported filed by Masayoshi-san that triggered me to work on reducing the memory accounting overhead. He is also in the cc line and so is aware of that. I will cc Xing in my v2 patch. Cheers, Longman