Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp50134rdb; Wed, 14 Feb 2024 12:18:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWzz6su62LXYoOe/UMYzfcr7zn8mQjI1hxyqCWP7rg5FEYYXOpcy/w/GVckJDuJ3exRPB3uqdlrD3/xfQ1NTKUowGOKpwfis7v7mr0M7Q== X-Google-Smtp-Source: AGHT+IHLFWJAsRKzQ6ogmgPDolZCNGt/AWLk9Y12A4c2wWeEL/Zi5wx1TlgaxzvEXTPR5ghKto1R X-Received: by 2002:a05:620a:2296:b0:783:f8aa:7546 with SMTP id o22-20020a05620a229600b00783f8aa7546mr2271146qkh.28.1707941890653; Wed, 14 Feb 2024 12:18:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707941890; cv=pass; d=google.com; s=arc-20160816; b=MJfclBJn3gmZfZtZrWcyhospdv183wfdHear9T1lhef56l8FAiObihswFS0invQFGz T3YYdFY4UGxR+tvmuJChT7rgQTBB/tNGMzBMc5oAkt6ep8VCzLK4cqeE8p31drZBIYWj TUCxA/cZ4Lml6XXfWpXX1G6aS2Fy8LsdH63wPXfxcI2cbTnUwgkIatwGAcEgDzYJF+CR +AtdC2LrbsO1JZIgLW95GoiCh6w/rf0rIhaqHqnbqZyngv8TEIiat5tj6oMSsn922cQA 0POCGrw47vwmU+5P0l07RkeVVfXfdomESRtH91XBLHY++ZN31DUurJA+B/eKdtR9hHnW muxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=DFRgEJKqx8IUK/onZJk4TNjtYloWEJQ2VMeYiwjP0ZI=; fh=2edgIw8yjO06jzZRxQot0uEzaHxY/HuQSZH19A2ctVU=; b=UJl6C1l46UeOVOxMah8v9VVSoqT9a6HHx7xAzQkRuom7x1YsnvaOXw74Jnvx/ZLe4C a/6zlLoC6RibUnk28NvEe0EY1Ym6916TLDBg8xKLi8kUC/kdM4PRdlI1ZO7Y9jxTXy1e bVIxEvPSraNBYtiUZYy8XACihel4pBwp0I/xz8QdkvgaVNlKkoWVod7PmGf9B3++rwZX UA8QvP26DszaXzToTI6IpEqRXQ7sxdu4zJGwcWYkMlu5Tu6WVi089UJce5o8ucWDNDw6 5mOqtP4HFRsN2ck2SgPtX7PYsEpBjCdV0PVTQLWbKmSsYNtyq3bmi8Lk44klycgH9nOP ZRSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=DiGIfItW; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-65925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65925-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; AJvYcCWLKlZbRrzgxe4M2lqWEhCRllYxHgsk7j0VoehMniaxpQ4cOCq/V7dIcSC2mDnehNTu4bTj+r3Xk8IhhfdE64S3SjCzPw4K2xsAO7fALQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g8-20020a05620a218800b0078725c5dc13si3329236qka.109.2024.02.14.12.18.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 12:18:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=DiGIfItW; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-65925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65925-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 4A77D1C2186B for ; Wed, 14 Feb 2024 20:18:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11A5F13EFEA; Wed, 14 Feb 2024 20:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DiGIfItW" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 8FCDD13DBAB for ; Wed, 14 Feb 2024 20:17:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707941875; cv=none; b=rE3kjyfkD/vq8UnDU9omD6V83ccuMJLjfQev/R/AynWc6hhtdpAMYEbxeXPVX9kJCuS5LaRYKGvhKgLp3GWTZA5o4ykt47UCIZvJ75xSJSin9SAUea2pJpHaZ8DJiB+CgIsFOKEyZFLl1XePoa9e+qAk8VdClXF/LDdeiTIqsWA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707941875; c=relaxed/simple; bh=LRwkqgTwbjojrvWlVJdTvGNtTmKNlI/lqhoWnlH86aU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pwABqscJGL3ui//2Rso6Nq2yZtNjD2qJeZBD2eXV3MUthwHplO58hnC3OANkmbCoV4Mxpr6jBdQg7QtIcUiy/Ad4G+rHKsRuTjDDjGiFX6DrcsR9SItxkdu5lNxF2NrK+P2YTf0QF+XSBoOAL5AinbnIP4PY8dmuJLsp5opdvGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=DiGIfItW; arc=none smtp.client-ip=209.85.128.201 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=flex--yosryahmed.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-607b3038b3fso2170227b3.2 for ; Wed, 14 Feb 2024 12:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707941872; x=1708546672; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DFRgEJKqx8IUK/onZJk4TNjtYloWEJQ2VMeYiwjP0ZI=; b=DiGIfItWbnQ5p1uLFwILlUgy2jXW0bqov0ksG0kcuH9lHg08UBB/puF+KuQMHafJhm snr6xO1Yjtvp1sIq4DH//10Dno5VuoTf3Q0R27qiOOXKpTOiNeT9Vn0D50M+W3fXukd5 8KmunndnPzJiSlBPI7gHgPcsei3UiqYprEncQVgDZACtvVIwlDzdB+BGRuj2NixpVRAI 4Wp0GAEdEdr/mlPmvpGL1gbGNp88p1OCmg/RTi4JTab6deKCPXgWGhAIeUp4sNz4FWDg TEjAqTqprDEUX00BxmyX2zhkr2m7bfQbl86rEb9vXQmlQ2BrNBZ/w3l+U8chNdGe+3oS Fq0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707941872; x=1708546672; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DFRgEJKqx8IUK/onZJk4TNjtYloWEJQ2VMeYiwjP0ZI=; b=uVtLkr1K/+pFk6ayxSsAFtcy1Z0CFooeLl79RMszBeDtWrQQa5hXriSM+2/Dt33ANB Zc9vIYBedjMwkO29L0N/aNkc8Rzrkhm6IabQZDTD2S3pMJUI4Ff8gvKFARsFLh49Tw9+ UCVPsooQTWz0HZiPk4rNkg1lmdY1Vy3O7lGHytG0LfNcENvBxSukffywj/4LOTiPgevM utPqv6K8tSTuEnsA4+TnlNl+DeCOWi13WxaJgVrZ53oSNdLMBSwQZV2+NaP6B/zcZIea AUQdZUYrDK6v8LG5dScCI49VvPxg/GuB+K7O14mqqv1nIEfJXyrnPSaV3pnrfd8Xek4Z BD3Q== X-Forwarded-Encrypted: i=1; AJvYcCUCfP4OgRC0jG809+jufhOk3+gOqao4EosLKnfKFgHarh4pj+/X3iTWMnk2vMxGUOkyRKuiZ4EZ0kY92H6UaMdu9KIt0WVb3wWDZHbb X-Gm-Message-State: AOJu0Ywq/Q+eJV8v1gHLyLbfbCNMaDyutz0pV9bYd8IhyymX8UnSOtXg b/g4d645uJMzk2xnUhnidArLA1yxZShoDfyUtgipjfUT0414g2qcCQoWHSCVyrzgphw6iMne97r olq6y4oYyvyYns+TlpQ== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a0d:eac3:0:b0:5ff:b07b:fb83 with SMTP id t186-20020a0deac3000000b005ffb07bfb83mr555354ywe.4.1707941872610; Wed, 14 Feb 2024 12:17:52 -0800 (PST) Date: Wed, 14 Feb 2024 20:17:50 +0000 In-Reply-To: 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> Message-ID: Subject: Re: [PATCH v3 00/35] Memory allocation profiling From: Yosry Ahmed To: Suren Baghdasaryan 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="us-ascii" > > > Performance overhead: > > > To evaluate performance we implemented an in-kernel test executing > > > multiple get_free_page/free_page and kmalloc/kfree calls with allocation > > > 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 results > > > from running the test on Ubuntu 22.04.2 LTS with 6.8.0-rc1 kernel on > > > 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.61%) > (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. > > (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. > > > > > > > >