Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2720672rdb; Wed, 4 Oct 2023 09:24:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzlngvgThlvgPlN8hiDDZbro/oX/yjg2KKOfffIxc3i+FbIiZHdF99woESXL3PO0ENfHVw X-Received: by 2002:a05:6a21:66c6:b0:148:f16f:113f with SMTP id ze6-20020a056a2166c600b00148f16f113fmr2308882pzb.12.1696436692142; Wed, 04 Oct 2023 09:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696436692; cv=none; d=google.com; s=arc-20160816; b=ZapTQOcuIWyZ1yN365dPhLU8zaPobyP1+4yKs4D0MjBDsPIG/W15bUy9FmJt4Z3n1q QPwz5zrcqO9E+IMEj6auJMjiUzSBhJprQlg7dOCFdVzlO9NZwIWQBh/RMp8cHLThBgRj vHkWaAVyvpyD2lzxcQbbpP8G1hBNx49/5070MJTOXADEPozfcV3zPyF5T+BExxfDkMvo eNHThMSm/IQ9v0ZBubndLTcLFX/Tnd+N5S/8Zpne6ALw0i4JyCTH8rVAJ4oo+dCI48Yl vZ0Y8QC+g0oyiOrJGwVz3ZqFnFsuTKg+U8lVHeaU3SNZspHTiAPK+6cyAB4YE+jJmHV+ MSVg== 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id c8-20020a633508000000b005774c943feasi4140648pga.735.2023.10.04.09.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 09:24:52 -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 4F89081B17C6; Wed, 4 Oct 2023 09:24:49 -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 S243350AbjJDQYa (ORCPT + 99 others); Wed, 4 Oct 2023 12:24:30 -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 ); 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 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: 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:24:49 -0700 (PDT) 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(-) -- 2.41.0