Message ID | 20231004162339.200702-1-void@manifault.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp252810vqb; Wed, 4 Oct 2023 09:25:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOSFr05j3wFpZ3suKDpQYsZnou6nw+VpzInf8wlV0J1nqvNeuM1w5t5I36pmwy+ZmT4f07 X-Received: by 2002:a05:6a21:498a:b0:160:b670:5236 with SMTP id ax10-20020a056a21498a00b00160b6705236mr2503315pzc.61.1696436705563; Wed, 04 Oct 2023 09:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696436705; cv=none; d=google.com; s=arc-20160816; b=WKY2AwVlVRsB6yuo8QPYeff/ufsg/wZg7dHAbiwwyHGH6xjfp6K0nyGS03Pixi3Jr1 jsppf4meGAm4QF1hX3ABIpaN7zTUkn3IEDvkOBHEXLTvNwsJD2ij+QKQCy6+1LCdA4ZN 4vx2Y5LHEq8OEEOlJe6SDTytiOkzCR+5k+q1SeXEI/5qqT2AINfK5wGbZwGtmPOdEMgY dapvxLL7hl4CwprDc667TRq/XzxuILiFsp42dFPlim8WUDhN4qiTXG2FekIQQkHvqTYF e5p86xid5iIZWNFC2hI4H+p7HneuGqO8H0m0Eg1WXR+Y9OJl2Lf5ZT8moVh2aImLXCfh Doww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=aJcPkTtQzYDODeSqUGSI+V2+1I2wYR9LJJZ2Ou20RpU=; fh=fRduVGGcbGNLOU4DUo/BPZE9kW2AdZyQZjfnRZNvspU=; b=wjXRcNdfI7VSlB+yS79JpfIhS1Od60T2TvMdie94kmH9JzvnWB9ry4elj12EEvTzjS B93tjgYahIwvIg+RsWgWAgNllrxVP/mhtBoDwDMLiTgw3JLHmK/goXuU5SQXPph7V4HM ljR0e0z+d7ZhcWNBMZ8mcgZUy2eXIMKMgEowH3QCMhZlTEivolWFnS989A3zh3ynH+e/ NV3LNmZ+1o317k11IkKww47LqEEmD0E6SVl47iot5DyWwvrgmS1CykO0ccr7FN6sn872 qmAy8f0VprUMBGTlwW9mY4fFReS9+PIWk0LcAmrpVLrWFAFqqrVfmShFmGf5MYtt5vv3 zLTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id e6-20020a056a001a8600b0069018a768cesi4076818pfv.405.2023.10.04.09.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 09:25:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1712281B17EC; Wed, 4 Oct 2023 09:25:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243351AbjJDQYb (ORCPT <rfc822;ezelljr.billy@gmail.com> + 19 others); Wed, 4 Oct 2023 12:24:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243315AbjJDQYY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 12:24:24 -0400 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12011D9; Wed, 4 Oct 2023 09:23:43 -0700 (PDT) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-69335ddbe16so1822437b3a.1; Wed, 04 Oct 2023 09:23:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696436622; x=1697041422; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aJcPkTtQzYDODeSqUGSI+V2+1I2wYR9LJJZ2Ou20RpU=; b=Yql+nLSENlm/lWLdzws6WHhZuQpxVEW4TgpUMUr9vqTKksCdEwJmu/w167Mzk4+Sk9 B4PkTPQokMkcQxQ0v6YlBq44gHkJQCXXHBCPQQuD34OYEfWle8pj9pI0iLrZ5iZYnyVi yfdaq361tlyZbn2BrMNxv4OBCFcsNOeItr0IxLNQ8LrelGF4pCHgFnyAJS0Hy/wtrsQv AmGyEYV6baPbinkIOEXg877v3m5GTYaWSkfaILR9SwccG7iBZlaJP/Ifv2g6v15MzOTU xqMDGBssOqz4LRNgVIXwYBLpvTglJDOzDGhopArlFOAKzyVXsK0qxG+BJYdP+RUVPowX DYmg== X-Gm-Message-State: AOJu0YyI7R9rv8B+iOVbkt+9b8YNrnOzhpYeWMcyAJXs0vWIOpJUR6Wl 0AGrnDAHWsCueDo2IMcKn1qZ2CztkblBWUgO X-Received: by 2002:a05:6a21:328b:b0:15e:986:d92b with SMTP id yt11-20020a056a21328b00b0015e0986d92bmr3134825pzb.16.1696436622065; Wed, 04 Oct 2023 09:23:42 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:3ce7]) by smtp.gmail.com with ESMTPSA id a24-20020aa780d8000000b0068fcb70ccafsm3387438pfn.129.2023.10.04.09.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 09:23:41 -0700 (PDT) From: David Vernet <void@manifault.com> To: bpf@vger.kernel.org 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, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v2 0/2] bpf: Add ability to pin bpf timer to calling CPU Date: Wed, 4 Oct 2023 11:23:37 -0500 Message-ID: <20231004162339.200702-1-void@manifault.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 09:25:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778842778591462112 X-GMAIL-MSGID: 1778842815084060262 |
Series |
bpf: Add ability to pin bpf timer to calling CPU
|
|
Message
David Vernet
Oct. 4, 2023, 4:23 p.m. UTC
BPF supports creating high resolution timers using bpf_timer_* helper functions. Currently, only the BPF_F_TIMER_ABS flag is supported, which specifies that the timeout should be interpreted as absolute time. It would also be useful to be able to pin that timer to a core. For example, if you wanted to make a subset of cores run without timer interrupts, and only have the timer be invoked on a single core. This patch set adds support for this with a new BPF_F_TIMER_CPU_PIN flag. When specified, the HRTIMER_MODE_PINNED flag is passed to hrtimer_start(). This patch set is based off of commit 93fb2776f43e ("Merge branch 'bpf-xsk-sh-umem'"). --- v1: https://lore.kernel.org/bpf/20231002234708.331192-1-void@manifault.com/ v1 -> v2 changes: - Put declaration of soft_timer_pinned and abs_timer_pinned selftest maps on same line as abs_timer (Song) David Vernet (2): bpf: Add ability to pin bpf timer to calling CPU bpf/selftests: Test pinning bpf timer to a core include/uapi/linux/bpf.h | 4 ++ kernel/bpf/helpers.c | 5 +- tools/include/uapi/linux/bpf.h | 4 ++ .../testing/selftests/bpf/prog_tests/timer.c | 4 ++ tools/testing/selftests/bpf/progs/timer.c | 63 ++++++++++++++++++- 5 files changed, 78 insertions(+), 2 deletions(-)
Comments
Hello: This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Wed, 4 Oct 2023 11:23:37 -0500 you wrote: > BPF supports creating high resolution timers using bpf_timer_* helper > functions. Currently, only the BPF_F_TIMER_ABS flag is supported, which > specifies that the timeout should be interpreted as absolute time. It > would also be useful to be able to pin that timer to a core. For > example, if you wanted to make a subset of cores run without timer > interrupts, and only have the timer be invoked on a single core. > > [...] Here is the summary with links: - [bpf-next,v2,1/2] bpf: Add ability to pin bpf timer to calling CPU https://git.kernel.org/bpf/bpf-next/c/d6247ecb6c1e - [bpf-next,v2,2/2] bpf/selftests: Test pinning bpf timer to a core https://git.kernel.org/bpf/bpf-next/c/0d7ae0686075 You are awesome, thank you!