Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp206911rdb; Tue, 5 Dec 2023 03:16:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHW5nYWE2/d1+nDZxtOludZZqv5drC88/LdjYVgdFi1bw7UcMDHnLrz9brkgojOE2eZVvYD X-Received: by 2002:a17:90b:3a8e:b0:286:1df1:25be with SMTP id om14-20020a17090b3a8e00b002861df125bemr894424pjb.19.1701775015413; Tue, 05 Dec 2023 03:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775015; cv=none; d=google.com; s=arc-20160816; b=nLkJkdzQVY942vRfL422pdmZZ+ECMZcJliJjp5B4/37CYOcBuCflxsf1XK0Vozvvug lgi9Ulm0wr07yS8g9MR74lT/DdUWB+5ESfuCYvNqbtx50qDosCQ/I0mJPEMO7VC/IG1M thAfAxLonkAD+v1OBS+A29+yMsITK1WaWT/YlxKzMI+H3nsWoUYnXVR5y0OWBUkuSt0k 38UgbaQhS8RGF5VhrS9xiWzpgmjRc8+4qHlT29qwz9qjlOE5dj9LEnxgxEYqtgiYayH4 aY1xVVJvXS937JQSImQOu2lk/cu5iTz2RKePkd0kyG083CszJFI1CetzfuI5mRZzCbK4 bW0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=ti0EygLrXL1ybJV+2IwmkNvjqyvD5l8XhA94fC+ez5I=; fh=846ZFNE2oufR33tKZfcFccfoluQFllmUGJj2VULYpYk=; b=tmXv6zcdBdD4X0xgaK727V7AwDdZ7iorSISQx7+W4qqYmzgvpS/62DMMgE7dSrar7M VgtGQxTPy1cBvPB07Zd1Be5Qb++on7VFfwYRUGGru/ltKMv1UAY6ewCFJaVzusmVBfyD 17dwzpCbp/R9KeIiAeVvlhz/QeEtmKO3PlSdlk1W46tvGdOtE1LAGGnCt63UzINW4beP a5lcNsWfRdc3DmBfhIFOUxGv8Qpth6f0IzYa3hAnzrZIof9XKUA62UAHpR1m2UUquPja /8/bgll1rhEDQ6kkvvkw/mvCVRSmEzMoBCKPSchjJwKmNutm2jxVPl6M71vl59yc2auj oCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="IQrS/Mt0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cv4-20020a17090afd0400b00286db70cc7csi1122131pjb.70.2023.12.05.03.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="IQrS/Mt0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9355E8225C9A; Tue, 5 Dec 2023 03:16:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376894AbjLELQf (ORCPT + 99 others); Tue, 5 Dec 2023 06:16:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345052AbjLELQ2 (ORCPT ); Tue, 5 Dec 2023 06:16:28 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF4121A1; Tue, 5 Dec 2023 03:16:31 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a1c890f9b55so54542266b.1; Tue, 05 Dec 2023 03:16:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701774990; x=1702379790; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=ti0EygLrXL1ybJV+2IwmkNvjqyvD5l8XhA94fC+ez5I=; b=IQrS/Mt0jalyQNPuEp2OHaRHpB+o3D5drxbQ6PP53lztG2e5uxf8MsVeDS8D7+7PMn 8RkYZuwcad3Zup11PLM40MxhZOu8TFn9ysQgTePyFlajE0GR7pwgLzzxcpNRGDkbitwR DFYLhBtBbb0Xm4L3rrZXgB9xwz0KkOXRwVdT+ijQvLHVh9zc7irbpVAPvitlUG5Qs7vW VIskrv2HQpxj8GqfyZqoagKiIqshdz5Zwq8o70x5X9633myNWRvmbCizrLyGWZRE/Zdo CBR2t4MrAizAT7E3ScKhKlpI1xK84/9hIFJiZFYmFA6J0bwG00adoTGKYus83Fa1mKkn 72+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701774990; x=1702379790; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ti0EygLrXL1ybJV+2IwmkNvjqyvD5l8XhA94fC+ez5I=; b=NRcqOpYH8QpYbB0OPfVvzMa81SoTTvUmvMsdYmVs9rk319j7YrIv+UGd3GdrS4oLls MvBuDZb9f87FB8CK6Dd4o0S23PyrJtmiaktOdDwOK9m3yapGdHFAX6V/5xhWfUnC4jjz dXF5cjDVbU8j6jWXRjaN6+cWKhzPFmyvWyHQaexeEUFg8BPb1B8hG4KEQqL9dwjNb9R9 AmZ2FnTrrDXiPxPh13PagHXKFSMtRfeN2H83HOD0rvobpsFCZtpVsQXtvI5cZOYtXIw+ 6WJd7fNYxxY9ejhjLCQ38YE88EI2h1c6QkApkGeuKPK4DN1hCfqOpk/8jRMVnQA8QDmI vEWg== X-Gm-Message-State: AOJu0Yxvqt9Ze4jWmzsIcgB+8l0h06gqjqkuEMQAgbPi3jwXoOchJS1Y nULef01jJGpzyO79r8eBD1Q= X-Received: by 2002:a17:906:dc:b0:a01:9d8b:db17 with SMTP id 28-20020a17090600dc00b00a019d8bdb17mr4727373eji.15.1701774990161; Tue, 05 Dec 2023 03:16:30 -0800 (PST) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id b6-20020a170906194600b00a1712cbddebsm1761143eje.187.2023.12.05.03.16.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:16:29 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Tue, 5 Dec 2023 12:16:27 +0100 To: Andrii Nakryiko Cc: Kyle Huey , Kyle Huey , linux-kernel@vger.kernel.org, Robert O'Callahan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH 1/2] perf/bpf: Allow a bpf program to suppress I/O signals. Message-ID: References: <20231204201406.341074-1-khuey@kylehuey.com> <20231204201406.341074-2-khuey@kylehuey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:16:52 -0800 (PST) On Mon, Dec 04, 2023 at 02:18:49PM -0800, Andrii Nakryiko wrote: > On Mon, Dec 4, 2023 at 12:14 PM Kyle Huey wrote: > > > > Returning zero from a bpf program attached to a perf event already > > suppresses any data output. This allows it to suppress I/O availability > > signals too. > > make sense, just one question below > > > > > Signed-off-by: Kyle Huey Acked-by: Jiri Olsa > > --- > > kernel/events/core.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > index b704d83a28b2..34d7b19d45eb 100644 > > --- a/kernel/events/core.c > > +++ b/kernel/events/core.c > > @@ -10417,8 +10417,10 @@ static void bpf_overflow_handler(struct perf_event *event, > > rcu_read_unlock(); > > out: > > __this_cpu_dec(bpf_prog_active); > > - if (!ret) > > + if (!ret) { > > + event->pending_kill = 0; > > return; > > + } > > What's the distinction between event->pending_kill and > event->pending_wakeup? Should we do something about pending_wakeup? > Asking out of complete ignorance of all these perf specifics. > I think zeroing pending_kill is enough.. when it's set the perf code sets pending_wakeup to call perf_event_wakeup in irq code that wakes up event's ring buffer readers and sends sigio if pending_kill is set jirka > > > > > event->orig_overflow_handler(event, data, regs); > > } > > -- > > 2.34.1 > > > >