Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp56086rdb; Wed, 14 Feb 2024 12:31:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWy5/uP1E/d4RHD54H+BI4xLNRk1BGSxfrpzsUUuCyQU92tyxmKkB6ZDfvyoacXa8K2H2x62DnA0n8l6VU2eM9xOEtPGv1xAJuYayELoQ== X-Google-Smtp-Source: AGHT+IH9Yfe0Z6+HI3k5gIKTH9OVftM0fKmkjxHr+EPKjadRBGyNIWcX4n7DRnpk+juPLNpjGONk X-Received: by 2002:a05:6214:5096:b0:68c:c7f1:4311 with SMTP id kk22-20020a056214509600b0068cc7f14311mr3604344qvb.64.1707942679809; Wed, 14 Feb 2024 12:31:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707942679; cv=pass; d=google.com; s=arc-20160816; b=C0li+hKYt+ji8o1NDeQ+fencaghaXNWEJrVtxo/yyrQcAvheGOu7quycsiQfEjuvCv 3FVLsp/6gARpVZkmzs4Ce4Jr7rtH0/YKwF3ySKroAJx24zKLvd6JuHtagQYuXakTXiM0 FcxwZkMOOuQ4kdSTly91e4b+W0Hu4nxAgyMAkseHXivZwgEzVmL0Tjj6tRuXIy9npaNm Q6n03dgwYdwWxGV1zjIw3L3vnmxerH/pZDOA52o+YmKF8inSYMfo41n1SAfhI1ITtBKr el3c1uOsYnXEjIVsVbnCArNzu+x/Iy7hvF3ES/ODzchYrUJLy4lpKrf6syBACWf1iZBW WQig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=NcEj/SyVb+AY5aiDL6vEY+YAlLL1EeaxcCrjK4Q+5oY=; fh=7YTBClgncQF2JxyEACC08/TbPC1P5AiBuBGkAJbEgdQ=; b=wGmt3ldpXn1aEFwiUZE50idPtoU+K8vs1l/cQf+ArMwyHkXebhLSidqWOFvgTYwuWw cqcHNKyDu/1zpvNxVWayzjkFYcTRMXONZqwIYZVYVLLO+o57AI3iQbLHeh4GtnQcRWWS O4FWum37BnLhN4CCUvjc7XFugHseYH5NZmM2A+xGf2kI8iNJk3jNUt6ST+JzLkoktV5O 7/IbbYUVpMWcgRw22CAuMXP0dAenkfRCmUu/v84sNMengDe7RcXyzr6w+Ooy8/EAAJhM OikH3BwA7De9bAG3rLTelgqGUIVP1f7ntZzn3pjszD+yiodYt+E9ilWng43dq7SKTMKa u0CQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=e4v7JGa7; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-65936-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCWBqHLsgtjS4afyA89ONXRL1hi1jttq3FuxCrwLszS9BnSIWevqgwKl5dXYnks+caQWGwyUyGBiW5cjomPq72v6SEzARsdL9I8mp5bIJg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o9-20020ad45c89000000b0068c805ee350si6371530qvh.190.2024.02.14.12.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 12:31:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65936-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=e4v7JGa7; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-65936-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8093D1C26EC8 for ; Wed, 14 Feb 2024 20:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35D921292D4; Wed, 14 Feb 2024 20:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="e4v7JGa7" Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A83F31DDC1 for ; Wed, 14 Feb 2024 20:31:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707942665; cv=none; b=QHF3/mB6jC306OmGFV4Ko+eethUunlvCuvXWcYJDEPzatAtASb+2MmmbFEdl/9r2NZpTC5RgcZvMPshoIscH8es2AOWpRUU+gm9bl7yqJNmOzPjESaGOiRXh3H1juSZ9lmmFe44elwmtEqNKjLucpbCRLEdW2I6eb2MXyV/JRAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707942665; c=relaxed/simple; bh=Vd0j1FX9Ch3W6HoLjw5jsyZYk+r6JPnPHoqpsjH65ZQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=QrobwqNGW1435jvJFVaeWq36AhFhptfdN1OH1GYK9Azabe3cAJBNKWBumPGZRkVDiXssd4OjK43S1FHOXFYJIVyI+WBDMF7xB21vvu9aZqyBf3Uholf3oQSIYUWNoFWwQtOj+C3PA2Y3m3XCXxXlzedim3F3SACdYaHt5J4/W+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=e4v7JGa7; arc=none smtp.client-ip=209.85.219.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-dcc80d6004bso106504276.0 for ; Wed, 14 Feb 2024 12:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707942662; x=1708547462; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NcEj/SyVb+AY5aiDL6vEY+YAlLL1EeaxcCrjK4Q+5oY=; b=e4v7JGa7cWYIZNAW0huk/3rwOI/kwWdnUfrxj+106qY9WYGnNPyqqU+s/GPTR66aYq E6Z9CoturLO7WL9zR8anrnxQ1tb+X+eCL/0xXobCI1PZu988h9jXDuQTqjlbLLhKlZjJ l/Cqu8qc/n297fQbIV4Ppz5rL240ZYKpmBE2mnjVkY7hK06kO+MoKsA0DD5SlnFxEpPW lTYSBU/elbShzB86eaf1oNF1Zo/wl1EYTb90LOaZ7ulyXM1m0BUsR58hYhdeRibgMo0I vIHn30dBEWG2tg1H+Av6fegtFpmgrihEA1yRuOTVjHYV64g7odZ1JazgkMmJJb7cgpvH xsMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707942662; x=1708547462; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NcEj/SyVb+AY5aiDL6vEY+YAlLL1EeaxcCrjK4Q+5oY=; b=WGvZfPCJ8IcWGgvDTcmqUDeSoZOZYGhaW29g84AxpJGrBpKSmcxZvMalNbmsm9v1Dz cU5NJHavPvIhsPd4c4XqQr20yUiSIKfw+99r/dkOJV1cC2EA6zmXy1M6KojQjH1aXFz4 J22fUK3+3qdnjELTWBWNt0izynbrhs0c6P8/X19OXGtRgJXJERVuZTEVsnbCqsiuVbEF 2J8eKXKU3+DV/mt2VOa2dIb5U8A4swfkBuumkemmaypqF1yGzIsLQVEpRo/fxuouGJ8u HWbJ4Qw/hFqCTaUGeVmtlifz/pBrYD0UIe7vBTIs+VlLVatX6GKRU1UoMafv0mZwTHZM Y18w== X-Forwarded-Encrypted: i=1; AJvYcCV5Cehh37UsuDZe8VNyYCz40+NdMwWQiW+Jz1EVoMzC9H+dyLIt2G/2u9Pl7J2tiUfpAWcAtNybgtnS9n7wO6lQsT1NG41UtY1bNQqi X-Gm-Message-State: AOJu0YznEYDM3TOzvlQAG1bz9HJAX5/Y+n0vhS512yAjCDWS9A6svWLV Cxs5+TGcSaAM1PPLi1hb0uh3SqT5HMkRyV5JLnPcV25PTQfTH53QpgAILRbg579eHDv1C3MVqQl Uz0NhkjsFkCMjNz/JlPJDqPKGdWdO2rPHuC4n X-Received: by 2002:a25:4115:0:b0:dc6:bbeb:d889 with SMTP id o21-20020a254115000000b00dc6bbebd889mr3283052yba.52.1707942662262; Wed, 14 Feb 2024 12:31:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240212213922.783301-1-surenb@google.com> <4f24986587b53be3f9ece187a3105774eb27c12f.camel@linux.intel.com> In-Reply-To: From: Suren Baghdasaryan Date: Wed, 14 Feb 2024 12:30:49 -0800 Message-ID: Subject: Re: [PATCH v3 00/35] Memory allocation profiling To: Yosry Ahmed Cc: Tim Chen , akpm@linux-foundation.org, kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 14, 2024 at 12:17=E2=80=AFPM Yosry Ahmed wrote: > > > > > Performance overhead: > > > > To evaluate performance we implemented an in-kernel test executing > > > > multiple get_free_page/free_page and kmalloc/kfree calls with alloc= ation > > > > sizes growing from 8 to 240 bytes with CPU frequency set to max and= CPU > > > > affinity set to a specific CPU to minimize the noise. Below are res= ults > > > > from running the test on Ubuntu 22.04.2 LTS with 6.8.0-rc1 kernel o= n > > > > 56 core Intel Xeon: > > > > > > > > kmalloc pgalloc > > > > (1 baseline) 6.764s 16.902s > > > > (2 default disabled) 6.793s (+0.43%) 17.007s (+0.62%) > > > > (3 default enabled) 7.197s (+6.40%) 23.666s (+40.02%) > > > > (4 runtime enabled) 7.405s (+9.48%) 23.901s (+41.41%) > > > > (5 memcg) 13.388s (+97.94%) 48.460s (+186.71%) > > > > (6 default disabled+memcg) 13.332s (+97.10%) 48.105s (+184.6= 1%) > > (7 default enabled+memcg) 13.446s (+98.78%) 54.963s (+225.18%= ) > > I think these numbers are very interesting for folks that already use > memcg. Specifically, the difference between 6 & 7, which seems to be > ~0.85% and ~14.25%. IIUC, this means that the extra overhead is > relatively much lower if someone is already using memcgs. Well, yes, percentage-wise it's much lower. If you look at the absolute difference between 6 & 7 vs 2 & 3, it's quite close. > > > > > (6) shows a bit better performance than (5) but it's probably noise. I > > would expect them to be roughly the same. Hope this helps. > > > > > > > > > > > >