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=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 4915CC433B4 for ; Thu, 15 Apr 2021 13:17:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D1DF3611F1 for ; Thu, 15 Apr 2021 13:17:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1DF3611F1 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 4879E6B0036; Thu, 15 Apr 2021 09:17:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 45D2B6B006C; Thu, 15 Apr 2021 09:17:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 300486B0070; Thu, 15 Apr 2021 09:17:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 128386B0036 for ; Thu, 15 Apr 2021 09:17:46 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BC9DB18073F44 for ; Thu, 15 Apr 2021 13:17:45 +0000 (UTC) X-FDA: 78034653690.17.6B9A388 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 8F4F3A0003A8 for ; Thu, 15 Apr 2021 13:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618492664; 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=6ekDAkkr77eB7AxytMHc6R8nrzotwIpYRJxiGpMYfIQ=; b=S2xnvDfyrXXrUjlGZHOJeVwZMDREyByqLpqiy4HP9W6ptv4KuuzylRjKerx7GZ0T888z+W GQD9t3N5tbMBfokPF3cc7xPkmFpxav5h89xUOyiIUrvDFhpUPfL7OpuWL+F/T96OEmXis/ EJdeRtg94CF4HijOCiKJGaKnqcV7pAw= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472--u_BzF33Mc2ezxI95wNqQw-1; Thu, 15 Apr 2021 09:17:41 -0400 X-MC-Unique: -u_BzF33Mc2ezxI95wNqQw-1 Received: by mail-qv1-f69.google.com with SMTP id w3-20020a05621412e3b029019a7b97dd69so1737575qvv.14 for ; Thu, 15 Apr 2021 06:17:40 -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=6ekDAkkr77eB7AxytMHc6R8nrzotwIpYRJxiGpMYfIQ=; b=N4MIsbSVOqSl+IXKDoyuSUVH212U9iqsPPHTNfvAyrpO91qg3H7g3n52qE/NrYB5Xz PHHnP2p65nOLh1pl5SwnoHAdMmcZ5Dopi5UN4hAPQhCUGFH/qIxicJzprOxKaWOdrkuz +YzAeKZbsllxlVpMpJAWvpjZu3oniNy71Akncp9EJO0Mpa9ymwooEyEgqQLDf7LTz46w 90R/9h73kkGHNcYtElj6kV6nYRX7S8p7wOyab9mKhkkElIO55XsE/ElFJfckhL2Dy5wQ CI1/nLmdEo2oGO3e9UMKXn4NHZYqT+dtVZxHOEFe0W0HlADfWTeqcvVwKWGtT+iclnj3 7SBg== X-Gm-Message-State: AOAM532qaA/J/S7buT8P9opXyasQIQ8p8pQf1klzhqFFM76gediM2kpj fbg0WBM/ODrWwQRkqp0825QQ6q/mw1zyYD5lfJxAaRf0M9GrUCbs65N45rC2OcyuqGeMrTmp1JC mzLn6UEEuiW4= X-Received: by 2002:aed:2042:: with SMTP id 60mr2968659qta.340.1618492660577; Thu, 15 Apr 2021 06:17:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD+jDw+3d0Vt7K0lMNcqpB1cyAf1PizDO/B0uJhdje9Ty4/DaY0Axl2ZceZ8eUq0lZta2ATw== X-Received: by 2002:aed:2042:: with SMTP id 60mr2968619qta.340.1618492660352; Thu, 15 Apr 2021 06:17:40 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id h82sm1946504qke.30.2021.04.15.06.17.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Apr 2021 06:17:39 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH v3 0/5] mm/memcg: Reduce kmemcache memory accounting overhead To: Masayoshi Mizuma Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Tejun Heo , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt , Muchun Song , Alex Shi , Chris Down , Yafang Shao , Wei Yang , Xing Zhengjun References: <20210414012027.5352-1-longman@redhat.com> <20210415032642.gfaevezaxoj4od3d@gabell> Message-ID: <12cba05a-e268-3a5d-69d7-feb00e36ef40@redhat.com> Date: Thu, 15 Apr 2021 09:17:37 -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: <20210415032642.gfaevezaxoj4od3d@gabell> 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: rspam01 X-Rspamd-Queue-Id: 8F4F3A0003A8 X-Stat-Signature: p6qsc5w5bka8e8wnpybec5nb53icowy9 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618492663-691485 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/14/21 11:26 PM, Masayoshi Mizuma wrote: > > Hi Longman, > > Thank you for your patches. > I rerun the benchmark with your patches, it seems that the reduction > is small... The total duration of sendto() and recvfrom() system call > during the benchmark are as follows. > > - sendto > - v5.8 vanilla: 2576.056 msec (100%) > - v5.12-rc7 vanilla: 2988.911 msec (116%) > - v5.12-rc7 with your patches (1-5): 2984.307 msec (115%) > > - recvfrom > - v5.8 vanilla: 2113.156 msec (100%) > - v5.12-rc7 vanilla: 2305.810 msec (109%) > - v5.12-rc7 with your patches (1-5): 2287.351 msec (108%) > > kmem_cache_alloc()/kmem_cache_free() are called around 1,400,000 times during > the benchmark. I ran a loop in a kernel module as following. The duration > is reduced by your patches actually. > > --- > dummy_cache = KMEM_CACHE(dummy, SLAB_ACCOUNT); > for (i = 0; i < 1400000; i++) { > p = kmem_cache_alloc(dummy_cache, GFP_KERNEL); > kmem_cache_free(dummy_cache, p); > } > --- > > - v5.12-rc7 vanilla: 110 msec (100%) > - v5.12-rc7 with your patches (1-5): 85 msec (77%) > > It seems that the reduction is small for the benchmark though... > Anyway, I can see your patches reduce the overhead. > Please feel free to add: > > Tested-by: Masayoshi Mizuma > > Thanks! > Masa > Thanks for the testing. I was focusing on your kernel module benchmark in testing my patch. I will try out your pgbench benchmark to see if there can be other tuning that can be done. BTW, how many numa nodes does your test machine? I did my testing with a 2-socket system. The vmstat caching part may be less effective on systems with more numa nodes. I will try to find a larger 4-socket systems for testing. Cheers, Longman