Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp3018562rdb; Mon, 4 Dec 2023 14:19:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEls3RxqZVCpKR7fNUJ+dn3Oi6ROvUnysFVwpxKGKK46yIh602Zc10wQRYj52/OjWJ8jDb X-Received: by 2002:a05:6358:592a:b0:170:30db:1188 with SMTP id g42-20020a056358592a00b0017030db1188mr1937441rwf.24.1701728356582; Mon, 04 Dec 2023 14:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701728356; cv=none; d=google.com; s=arc-20160816; b=ZWFsif1AlAtYb+ycqIkStiPfrIG2uaHqCJY7CqICOZtzp7Ksq4SEAvHu8dTf1hjovh Bci2lvDANckdaIZR7IFNRvV1IZxidvT82dyTZr7trjrgoWY6GeYOodTBZuE4CmtcvZE5 qv0dzjD1C/ifBYskYEBiDjxOmxCpSlBNzAL+BitvC6GBW+j7o47nTinNp58UZgGjInaM tbCPslg2aSK5n6HJ6HnKwWpIxCpeHQ9ttasu3cf8dGIoxw9fnFTuTR3+J0H7vtedgUGb Cw4EZ7xABOCunvgGT0Y0/VlcjVO4q4SsEIn/U/3T33VU6Z/gXUavY5tZqXo2ddejTkzM 0MMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YYU4akPtvFm5xz51DoEaDieWeepv6tFYyNIW+3QSnxY=; fh=563ygQeAaLaFmLxeiWEAjkv7foW3Ssijws9/6y2pFNg=; b=KP3/SkYCXZ6DXmfriIDf6lrwfCsJbNRs3cWMHOZJ4wQf2oRrsU0Ceah0oqSZumXN01 6GT/+fJ42HP63p1K57sahdtD7i6qwpfaiaxSKovqdlP0MyEGHT11elH6LWGibvxMSLkz pJjQWDg/C8kuGeYiF6cL5rZqbPJW5EqlGeT3bP6yIgJeuJ0A2IB345iOw0qLaoZ9P6/x SomlQYEEPLEOLbrp9VPys7TJ7f7QiLtWeKY3YDiUydtPA4jK29jChYVT+wKdeoA52hHX NwMGajoZ/kVL7gu5vgNXRkRunGk7pWUL5tL+nEhX89ydYs9nskgHNcgvMqJp/lniWEn+ VZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KAADVfoC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id dr8-20020a056a004a8800b006ce65842c57si667017pfb.130.2023.12.04.14.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 14:19:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KAADVfoC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 1BA37806AFD9; Mon, 4 Dec 2023 14:19:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234415AbjLDWS7 (ORCPT + 99 others); Mon, 4 Dec 2023 17:18:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231317AbjLDWS6 (ORCPT ); Mon, 4 Dec 2023 17:18:58 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D2E2A1; Mon, 4 Dec 2023 14:19:03 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a195a1474easo485966366b.2; Mon, 04 Dec 2023 14:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701728342; x=1702333142; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YYU4akPtvFm5xz51DoEaDieWeepv6tFYyNIW+3QSnxY=; b=KAADVfoCnlfXgN3YXaoXrYBMr9E/Xw9hYBXS3OriU0jVISiciHhp9PPVxypPa5oXYC K5AtwUSJfY4E4d3LN5apBONlehklpHhbR/GXXwtgOWIq+FBtNS69/B6Da84d/6rZcW+F D1DQevQnQcPZxFFX1oFFabYWvVobAXEbOQGvacyKe9BFn/Srgxdq/qJHbsqbs2vvKgzo jBRLqY/SsjvjuOU+2IgUCc+vJa7+4taGHZNha3Ol2ClEob0pyPCRALFCsaT0kKSrt3Y0 TVGck94E+EAu7lzr2z8QSG0QBg5CruLdrTNhzA8pvSERDz+BCT8QER1gIHd+3Mo8KEsX 7uug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701728342; x=1702333142; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YYU4akPtvFm5xz51DoEaDieWeepv6tFYyNIW+3QSnxY=; b=RkIBqva/FQA3Jh7KD6zeFUjOXEEdZAuOOSsi8YES6OCQv2V5Ynky/JOC/Kg2HQcPnT iTFJQUeotxgvN913KP8D/xLy50o/bih2b14D9BO1SWHRP5UFpG/gY/IZWhr1zV8VM3n2 DUnRQXgwdNKf9uG6/Z+hS9X2AIko+dPLJu+i0Pj6iol5b2S4LSRs5SPGZcVciN8hnebP 59wRv8c4OmIZU2O5y8IbuAGYfMIKa+MhejcXvxtR3O3UD6EpN6pCC5k0nXis8Yo1wjVx pm9Rgtfaa3ty4Rrz1jSl1zXEjKKyVbXFtVbRemBW+rvMQFA/1LY1XOfGRTFi387FPY/d OUDw== X-Gm-Message-State: AOJu0Yzszh034Ld4JAjOJSi63pkUlCczKr+OhxDXJDa311NtTSDKysh1 9fmCBBA66sx31j8mhhS13i78lMnS6Z7jjuXZ2RE= X-Received: by 2002:a17:906:51c5:b0:a12:635d:fcd1 with SMTP id v5-20020a17090651c500b00a12635dfcd1mr519128ejk.35.1701728341626; Mon, 04 Dec 2023 14:19:01 -0800 (PST) MIME-Version: 1.0 References: <20231204201406.341074-1-khuey@kylehuey.com> <20231204201406.341074-2-khuey@kylehuey.com> In-Reply-To: <20231204201406.341074-2-khuey@kylehuey.com> From: Andrii Nakryiko Date: Mon, 4 Dec 2023 14:18:49 -0800 Message-ID: Subject: Re: [PATCH 1/2] perf/bpf: Allow a bpf program to suppress I/O signals. To: Kyle Huey Cc: Kyle Huey , linux-kernel@vger.kernel.org, "Robert O'Callahan" , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 14:19:14 -0800 (PST) On Mon, Dec 4, 2023 at 12:14=E2=80=AFPM 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 > --- > 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_eve= nt *event, > rcu_read_unlock(); > out: > __this_cpu_dec(bpf_prog_active); > - if (!ret) > + if (!ret) { > + event->pending_kill =3D 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. > > event->orig_overflow_handler(event, data, regs); > } > -- > 2.34.1 > >