Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2155767rdb; Sun, 11 Feb 2024 14:20:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVBXQQiEwZnMLhdMwyptEwmTMRPIOFF1Y2YohrYI3Ox2i/nC6sT6IGqnb24V48vP2aiB0Sz5VOtcOKe2x7FoC2lmRwykTh/beWk4UYBOQ== X-Google-Smtp-Source: AGHT+IHQVnVuKXDHyYGGtgyCyiDKrytnB7ZPyw4M/mAdxEtoW4Ic0n+W37tLxLCOiSXdQPm80KbO X-Received: by 2002:a17:903:2a8b:b0:1d9:f62b:237b with SMTP id lv11-20020a1709032a8b00b001d9f62b237bmr6372019plb.39.1707690036618; Sun, 11 Feb 2024 14:20:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707690036; cv=pass; d=google.com; s=arc-20160816; b=i+Tr2RuaGhrLnqkXe2x/wbAup9k7CzRkZIDGiZQZyX8gN1xoRbld5aumMLTWxjx19g 8x76pSU4Gbes+/UsKTNOfovTCe7DrT+LtXiXQt+R/yK7LfaPGlvbop0Y9Nm7vyXs772S RdpsvFApHUjZAO/+wfnglsB4zobqKpkgYTbS+mWs5+hNdcPPyQ/+w4kwp2GG0jXWBXmJ r+6RJpnXnnIbeTnE++ikf/NVxpQ3b2f2PGy39dypWtY7BJo2N7mhIWBF2shSaiYIkLfK ui3n8xbdXH0/TlYwbjiAEd+dEX6YNfiIAEU8SbsSgPO3fWI+skNo15q3x+TNfmQCnXig G7WA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:date:message-id:from:subject :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=JxfDc5RuI7aU9wBIAzSzaNoryOGTOtpdUUJFUjZmaWw=; fh=Twcp4xeLrvQK/WHsyoaQpScrnWEw5yXIYGgVlz0sczg=; b=wzi2zfmErB60bztZJ+d1ogicTVEGb8YVVOLuRCm/Jflj1aOXWX8cWKxXiXoeCzsTZm HpI9QFiptB7S+tTjqvWVmhrmkLxJXsj1k9rPJ2GvSfC9ExVQgF2XJnyJeMytXs3esMNm +CK45PWrL4NgG5MUn006MzOoVvcKx0UzS2HrpVigouLJI28epd3sRS7nYRDzFDxJIHe9 TtslVxdILW+KPjnVuafWnoI7XJnQvL8o0rJm/og0kH8vCarpGDcBgakhKUH7n6NgTTMw v6s3ZcpbXNhDYqa6LWV0jskCgDjzfJpzbnVFvijD4EEmOv8/fQiUHG+HLAOdNbVz07ZT u5KQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FI7Q1tWO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCU7I0WXDYYhMcCa0TT3+fpzXBmqEeahyXLcpnnidfYfqylTIK5Kmb7Iu6CzxzB4zT/pJ/AFVpJ2ZHt9fa9ZpSmGWaqeCQM+QnLd7K8d5w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n9-20020a170902d2c900b001d76a542180si5395608plc.541.2024.02.11.14.20.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 14:20:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FI7Q1tWO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 4D32D283596 for ; Sun, 11 Feb 2024 22:20:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D6A15F844; Sun, 11 Feb 2024 22:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FI7Q1tWO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E7965B5DB; Sun, 11 Feb 2024 22:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707690026; cv=none; b=U3qgn/TVJawcFyPOG8ZHrRzVwkufsYmiDdFvlJt7uIPQbUef8/x5ii5ZOI+D2UZtTDDmq2TWjnzpUaMFeUPTkB08QNpflCT4yi8pPPWjM6HiHu8f9XXIo8ILaWU60WCgy3l56XyEiDtF2HOuPYBpLtNU0xYnwrdXhZs4RflkztQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707690026; c=relaxed/simple; bh=Nhy+1UGTj+1YbWErmpCp/rHyBjelzDo5aTxO0M771y0=; h=Content-Type:MIME-Version:Subject:From:Message-Id:Date:References: In-Reply-To:To:Cc; b=K5VWhHgCNlTgf8q8FgxMRKZk5OUp9aPKTcRG6OS6biURpb9uw9zI9yxGJ4NWn+MqF5rg/NhS3nZoaMFimvvr82b3wq0ryuGbI2KFd5rbbbLXWBAI8RUDhYmOqQ8zbLmSCfnt/TNfnb9YkK83g51fMI9roNIrODHRjUcs3MDnE/E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FI7Q1tWO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id E79E4C433C7; Sun, 11 Feb 2024 22:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707690026; bh=Nhy+1UGTj+1YbWErmpCp/rHyBjelzDo5aTxO0M771y0=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=FI7Q1tWOWxpVXkcp4pQbLKX9wfovdbY41ti+rf97H3BSG/dsJse+Q7RwQuRYAocgb 6lrxFH5H8DcGdd90hQxnHxf3OCSAcXdQTk5W/Z2q6iUxn9B/8iCq26/zaER3QD9bV0 LM7gYoHL4wkpMor6GA6i9W1YTLYNBqmrj7OYNeOqTkM85aFY+Jw0/wMqWK+hKow+MQ ycfRF5u9VpaOu6+A/FGFgGnyN36J3JRVNDgTJ6EkVl4+rmn8oFhc7aWefJjN5rVtNJ MPw+wjzA1DN5MTiPUDT2wN0O0BnZsH+p+mT6IXOzbnf8ST96OgJsaZgiL7PQBJBWVk Zz0Oo5AA2hb1w== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id CBF70D84BC4; Sun, 11 Feb 2024 22:20:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH bpf-next v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup() From: patchwork-bot+netdevbpf@kernel.org Message-Id: <170769002583.30556.5770636109504122664.git-patchwork-notify@kernel.org> Date: Sun, 11 Feb 2024 22:20:25 +0000 References: <20240207122626.3508658-1-elver@google.com> In-Reply-To: <20240207122626.3508658-1-elver@google.com> To: Marco Elver Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, shuah@kernel.org, iii@linux.ibm.com, laoar.shao@gmail.com, tj@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Hello: This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau : On Wed, 7 Feb 2024 13:26:17 +0100 you wrote: > In various performance profiles of kernels with BPF programs attached, > bpf_local_storage_lookup() appears as a significant portion of CPU > cycles spent. To enable the compiler generate more optimal code, turn > bpf_local_storage_lookup() into a static inline function, where only the > cache insertion code path is outlined > > Notably, outlining cache insertion helps avoid bloating callers by > duplicating setting up calls to raw_spin_{lock,unlock}_irqsave() (on > architectures which do not inline spin_lock/unlock, such as x86), which > would cause the compiler produce worse code by deciding to outline > otherwise inlinable functions. The call overhead is neutral, because we > make 2 calls either way: either calling raw_spin_lock_irqsave() and > raw_spin_unlock_irqsave(); or call __bpf_local_storage_insert_cache(), > which calls raw_spin_lock_irqsave(), followed by a tail-call to > raw_spin_unlock_irqsave() where the compiler can perform TCO and (in > optimized uninstrumented builds) turns it into a plain jump. The call to > __bpf_local_storage_insert_cache() can be elided entirely if > cacheit_lockit is a false constant expression. > > [...] Here is the summary with links: - [bpf-next,v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup() https://git.kernel.org/bpf/bpf-next/c/68bc61c26cac You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html