Message ID | 20240221194052.927623-4-surenb@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-75382-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1257050dyc; Wed, 21 Feb 2024 11:43:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW4F5K/w4Hq6pZSCqglL+25t7sL7i64PwSuhDJ+s/FVZgqay9j178j81QzWcIvF+l5mA0g3J0D3z69Qvrmplv44JO/ncw== X-Google-Smtp-Source: AGHT+IElgmKMgl0DROMwY8b8kqoDOoAjUx2be2L17pcHR1KUO+iI9NGJyy9ODqoQmXI7ierBBYvJ X-Received: by 2002:a05:6358:2907:b0:178:950d:1175 with SMTP id y7-20020a056358290700b00178950d1175mr26562407rwb.13.1708544580133; Wed, 21 Feb 2024 11:43:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708544580; cv=pass; d=google.com; s=arc-20160816; b=rbq2JEPuhhztLV8mk/hYvGP2fvjVlRszurULDg14Yfp6MJgOJpmhnxIvOLv2K1xQoF nBkwi6ExBDAM6O1spyHW0QIRF/uAHIfkigfORoYmyIFxg4CztDrsRDYGDbzsXsRQM7uz 74imgGVcuHr4mVwMQm3rap4BtNvrfwlU41XLljsBwUa7ENLhMW04gZUFD14QqzHlbvXM r1izA5LkyUQJIrcm5oc9WIt4eGG96GXro2uE0n5bzOPLPd9HbKx6pMd+v1zoNKeb8sxG 3cphfUudr8biswpziLzVkjHIqUgucBRJqMm8dRI292i4UCg4nSD1COnBv+3s2iDD0rbj i7VA== 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=aDZXV5wClyo81E7oQNbL7t5gFNRFpKZi8JXsyoMDgnM=; fh=vRF6jBwESkpfYhvpO2aCDbQlC8VGpNeNqpMMhSwKro8=; b=mQ/RWsGUvyRDZLfkz+mX8fKX5yxAl+y0uu/R1geYahkgsy9avbUmKg/2IfQcrlyw8y LnFMeT9MPEQEJ0q4U0Hfk02WRV4rUYu+xCO8hNla5Ql+wo95vnEY+osOK7nxt6fl9LJ4 AV7OXL5S46FNTzps2SoT7DVK+t/A+VcS9bozY0y88F0Qd1zfkLZHQVl7suCm0tH1nvVn X7aK8EK3stqIAAWUGudqPllCbk4WfqaC1t7t/acEOmn6iC22FStmaYa0Q1fHGCAlUeTP 84TJcRF3u9+LXr8VSJNmZJySO2t5GAq1rXBuYVB2J7kcX6l/senOcHfvohQiXxlGTdPf vehQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yAuSI3zF; arc=pass (i=1 spf=pass spfdomain=flex--surenb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75382-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75382-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c12-20020a6566cc000000b005dccf9ac073si8677924pgw.282.2024.02.21.11.42.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 11:43:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75382-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yAuSI3zF; arc=pass (i=1 spf=pass spfdomain=flex--surenb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75382-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75382-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7EE8A2854E5 for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 19:42:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9E3C1272C7; Wed, 21 Feb 2024 19:41:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yAuSI3zF" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 3BCE5F9FD for <linux-kernel@vger.kernel.org>; Wed, 21 Feb 2024 19:41:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708544466; cv=none; b=L/mb/YtwefENBWTXF+FTgnSdozCXVyG1UFbfFOiqkoOWt3VEXerQ2F/VIEklcrb1U38JO1jACEvvbkDhK019Pee6yTtoGuiIymuE6KiH/ldhjDr5ykDnioMzT8ER5Zma5uA0NAqLE2L6pjKMq7XxJxXy7k5xqA3Z/McYyP/prF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708544466; c=relaxed/simple; bh=0jXC3LDzUrrolAiGzpejaFGts6g9gPbvSne6eR9EGZ0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DAPLnTykwPLno8oUpY98xUQGrjNW1T4XdMZsf6hKKwMH+nb8h9ja9nOQMzl6kglxP3mqHjlvlKiRVYBqtBcwj63JifwDJbXlk9xxFeWGhk7x+iVBCiNWfberEy+atGdNxRntJ2sM5VyS0CuNVWWCProArVg8pquaxl5S1qYnrZE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yAuSI3zF; arc=none smtp.client-ip=209.85.219.202 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--surenb.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc657e9bdc4so9081142276.0 for <linux-kernel@vger.kernel.org>; Wed, 21 Feb 2024 11:41:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708544463; x=1709149263; 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=aDZXV5wClyo81E7oQNbL7t5gFNRFpKZi8JXsyoMDgnM=; b=yAuSI3zFtBXJEqtOJqcZ7nFCZUwHdfr+Wu9iAy+CuCFuvUw5k6vUh7m1pSo109/ecX eSPLwSRNwaXOqgo30uW6xG4srrJBOp0FJJJ9WQg25TVgBagpMiS06f8PbtRUhpgZfJ+G /BENEgZ40l/qfZlXROmPnL3iaMo3Ir8io6yPVmam5fXDzpRaKEV2XWFuOw5c5anxWg4F L2iIEHk/SziLOzPkLdx9HL0V/ZcRdUwSWr2v+rTGBLMnGn/wimFfRjzk3cSpVk5LhOHb PA9J1utGbhUv15ENpNNyZeGO/9eT+53mAsavVQfxW85P+kvMf8JguBecVxFwrDEEHdth E2rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708544463; x=1709149263; 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=aDZXV5wClyo81E7oQNbL7t5gFNRFpKZi8JXsyoMDgnM=; b=Mpj7Vwy0y1q2N2NWA+mEII0GOW8M7UHUZKkaRGlhLM9Ku1GvUDyfuFqmjGkUo9NpmL 1DB6tGTqLhYQaBzuXfZ7E6Ghr6ykLzQNAA9iX/rit+x4xNTdvTpY3ImGhVurB84yWzhc 9QAePjRssrM9E1RUksM2q45YyHZgIOFVDZ9QmLOoaRUdF0zT5sBXXKgSJYzFPl1eFRPk IFElpBrl5m+/x/ZUkopN3kpjQa4moUE4aQI/W/d8FJES46kwoT2B9X0efpGCRYGPLkES 8zb8yrdzsxWPWpTPF7Q+O23WBgm2aELTNkPhvuULNcBLhFkoxK+AJbXkZlzlzJFNIPFP /oHw== X-Forwarded-Encrypted: i=1; AJvYcCXEVkF5D1D4bO1rgDFA5RE1sOJ81ZmPrttAnJd2UAaXsd37ZIrhleaeUW00GdFirAkTH8JI6jHJeQkUFBcfv84781qKCdr4JxuWX5sh X-Gm-Message-State: AOJu0Yxw00tAAF9MgwTRJbEAzO4MMR4dRG7eugBb01gEO9E8Msy61VOK Tm8a5vtkslFNUbXNB3E3rh8QFWMjlZ9HqFm5IS/8dzOn1W9jUqX10Rg3sZCrYDfdLxdTkAqSLJX vEg== X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:953b:9a4e:1e10:3f07]) (user=surenb job=sendgmr) by 2002:a05:6902:1008:b0:dc6:d9eb:6422 with SMTP id w8-20020a056902100800b00dc6d9eb6422mr17397ybt.10.1708544463028; Wed, 21 Feb 2024 11:41:03 -0800 (PST) Date: Wed, 21 Feb 2024 11:40:16 -0800 In-Reply-To: <20240221194052.927623-1-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 References: <20240221194052.927623-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240221194052.927623-4-surenb@google.com> Subject: [PATCH v4 03/36] mm/slub: Mark slab_free_freelist_hook() __always_inline From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: 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, penguin-kernel@i-love.sakura.ne.jp, 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, yosryahmed@google.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, surenb@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" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791538841148607459 X-GMAIL-MSGID: 1791538841148607459 |
Series |
Memory allocation profiling
|
|
Commit Message
Suren Baghdasaryan
Feb. 21, 2024, 7:40 p.m. UTC
From: Kent Overstreet <kent.overstreet@linux.dev> It seems we need to be more forceful with the compiler on this one. This is done for performance reasons only. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Suren Baghdasaryan <surenb@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Feb 21, 2024 at 2:41 PM Suren Baghdasaryan <surenb@google.com> wrote: > > From: Kent Overstreet <kent.overstreet@linux.dev> > > It seems we need to be more forceful with the compiler on this one. > This is done for performance reasons only. > > Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> > Signed-off-by: Suren Baghdasaryan <surenb@google.com> > Reviewed-by: Kees Cook <keescook@chromium.org> > --- > mm/slub.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/slub.c b/mm/slub.c > index 2ef88bbf56a3..d31b03a8d9d5 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2121,7 +2121,7 @@ bool slab_free_hook(struct kmem_cache *s, void *x, bool init) > return !kasan_slab_free(s, x, init); > } > > -static inline bool slab_free_freelist_hook(struct kmem_cache *s, > +static __always_inline bool slab_free_freelist_hook(struct kmem_cache *s, __fastpath_inline seems to me more appropriate here. It prioritizes memory vs performance. > void **head, void **tail, > int *cnt) > { > -- > 2.44.0.rc0.258.g7320e95886-goog >
diff --git a/mm/slub.c b/mm/slub.c index 2ef88bbf56a3..d31b03a8d9d5 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2121,7 +2121,7 @@ bool slab_free_hook(struct kmem_cache *s, void *x, bool init) return !kasan_slab_free(s, x, init); } -static inline bool slab_free_freelist_hook(struct kmem_cache *s, +static __always_inline bool slab_free_freelist_hook(struct kmem_cache *s, void **head, void **tail, int *cnt) {