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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 381D9C433DF for ; Wed, 27 May 2020 08:36:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E85F720723 for ; Wed, 27 May 2020 08:36:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FK/ZrIhn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E85F720723 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 9015D800B9; Wed, 27 May 2020 04:36:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B20F80010; Wed, 27 May 2020 04:36:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A0C8800B9; Wed, 27 May 2020 04:36:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5FBFD80010 for ; Wed, 27 May 2020 04:36:00 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 22598181AC9C6 for ; Wed, 27 May 2020 08:36:00 +0000 (UTC) X-FDA: 76861841280.28.pail75_3a0993026d50 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 028C76D6F for ; Wed, 27 May 2020 08:35:59 +0000 (UTC) X-HE-Tag: pail75_3a0993026d50 X-Filterd-Recvd-Size: 4917 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 May 2020 08:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590568558; 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=N+EZfAPIOq5wJKJ38yZey1nhxQDhBegdsue0IWqi4uU=; b=FK/ZrIhn1walx8z9++B4n4yGSzZbNShLphOJxeTsvDDK6XvpsU7bE/GZYOTpqaxdaELJhq UYip0U5G++0443brxAYCPuhQ+CljT7J+kvohs3PBCvFqrE3iCj5+2KwywbYB7zv15912Ja um5IUVbI3YPuEH44YDDy/0GjPaHllPc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-e4Pyv0JjOgCW32f8MUnx0A-1; Wed, 27 May 2020 04:35:54 -0400 X-MC-Unique: e4Pyv0JjOgCW32f8MUnx0A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC2DD1005510; Wed, 27 May 2020 08:35:52 +0000 (UTC) Received: from carbon (unknown [10.40.208.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F3F11A8EA; Wed, 27 May 2020 08:35:46 +0000 (UTC) Date: Wed, 27 May 2020 10:35:45 +0200 From: Jesper Dangaard Brouer To: Vlastimil Babka Cc: Roman Gushchin , Andrew Morton , Johannes Weiner , Michal Hocko , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org, Mel Gorman , brouer@redhat.com Subject: Re: [PATCH v3 17/19] mm: memcg/slab: use a single set of kmem_caches for all allocations Message-ID: <20200527103545.4348ac10@carbon> In-Reply-To: <8932b0f9-0d25-7298-c12c-b4ae455ef110@suse.cz> References: <20200422204708.2176080-1-guro@fb.com> <20200422204708.2176080-18-guro@fb.com> <8932b0f9-0d25-7298-c12c-b4ae455ef110@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Rspamd-Queue-Id: 028C76D6F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 Tue, 26 May 2020 16:55:05 +0200 Vlastimil Babka wrote: > On 4/22/20 10:47 PM, Roman Gushchin wrote: > > Instead of having two sets of kmem_caches: one for system-wide and > > non-accounted allocations and the second one shared by all accounted > > allocations, we can use just one. > > > > The idea is simple: space for obj_cgroup metadata can be allocated > > on demand and filled only for accounted allocations. > > > > It allows to remove a bunch of code which is required to handle > > kmem_cache clones for accounted allocations. There is no more need > > to create them, accumulate statistics, propagate attributes, etc. > > It's a quite significant simplification. > > > > Also, because the total number of slab_caches is reduced almost twice > > (not all kmem_caches have a memcg clone), some additional memory > > savings are expected. On my devvm it additionally saves about 3.5% > > of slab memory. > > > > Suggested-by: Johannes Weiner > > Signed-off-by: Roman Gushchin > > Reviewed-by: Vlastimil Babka > > However, as this series will affect slab fastpaths, and perhaps > especially this patch will affect even non-kmemcg allocations being > freed, I'm CCing Jesper and Mel for awareness as they AFAIK did work > on network stack memory management performance, and perhaps some > benchmarks are in order... Thanks for the heads-up! We (should) all know Mel Gorman's tests, which is here[1]: [1] https://github.com/gormanm/mmtests My guess is that these change will only be visible with micro benchmarks of the slub/slab. I my slab/slub micro benchmarks are located here [2] https://github.com/netoptimizer/prototype-kernel/ It is kernel modules that is compiled against your devel tree and pushed to the remote host. Results are simply printk'ed in dmesg. Usage compile+push commands documented here[3]: [3] https://prototype-kernel.readthedocs.io/en/latest/prototype-kernel/build-process.html I recommend trying: "slab_bulk_test01" modprobe slab_bulk_test01; rmmod slab_bulk_test01 dmesg Result from these kernel module benchmarks are included in some commits[4][5]. And in [4] I found some overhead caused by MEMCG. [4] https://git.kernel.org/torvalds/c/ca257195511d [5] https://git.kernel.org/torvalds/c/fbd02630c6e3 -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer