Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp936299rwb; Fri, 7 Oct 2022 06:12:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62g5d31GcIpfxlP39yljkXhF7EW+74UnjHlDALna46Z/WLO7NHJYQ8S/wBSG3kXFvNmSqi X-Received: by 2002:a17:907:a0e:b0:780:72bb:5ce4 with SMTP id bb14-20020a1709070a0e00b0078072bb5ce4mr4126513ejc.234.1665148320927; Fri, 07 Oct 2022 06:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665148320; cv=none; d=google.com; s=arc-20160816; b=E/1eUhw3bn1jpB45CbuKWJHlpYy+lyI3DAE9qZz5VLrcmpk+KYIVr2cEetdv0QlYZc jD2MCjOcMImBwh34y9oMRnX6MhMWKkojGWvavv/Ss3/Jq49a/bxNXeBW1WdQG/r6GdUs vudmB1sGCC+rI5Xe8hT2xksQTjf5cqh5n/XoAJsrhNh4GTDBkR3YXAUbu8mdK0C/ixtc /VIn2Ty3+FOyDdfSBWvL0E7kY9YLVL2nvtRHOYLaPxgjjebJtDJRJHiRUnUCCDpU50+G s/LAuGXaWMMKimqdqoXrSdhm2uptsnTQyFWiISVbvJMw2Gsv4b9bjRi6rHFx46/Medbi XSwg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0BeKBcF7ouX2G91odn0fVr+GuMOLBqXSocw/B9YMzNQ=; b=bSdCNrCIoAfNXn8eQUvE4BLOXgAGICsBYcT//kkfixGzNznw3YuVe43gULEEIR/laR b2C1ULlmgd93SxYXL8keLJG9lFn7yB9x5Huw11X/H01CmSRfAGoEeKi867UaaqYL+Bh+ E/YMfMk/TwUa/wngxjXidNNEaLNQVidCObTbAgrePCZ9MK5PB43UbjKvW3IajwGaDuGD ABqGHlvnEdSMuNuqOXhxGFTPj9d72uCr798HZE48J6/2EMBZ6PJy4105/mlMDobJ37Wd nTPqHzqy4rEEihQxEFEGzMNjV6UaTYK359Jwd6EYGXCKAQJjmyq3XqI3q31edURfxww7 WCJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=nEqRyilq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a50d6c8000000b00459479f47absi1809928edj.146.2022.10.07.06.11.19; Fri, 07 Oct 2022 06:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=nEqRyilq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbiJGNJc (ORCPT + 99 others); Fri, 7 Oct 2022 09:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbiJGNJ3 (ORCPT ); Fri, 7 Oct 2022 09:09:29 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664C5CBFD2; Fri, 7 Oct 2022 06:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0BeKBcF7ouX2G91odn0fVr+GuMOLBqXSocw/B9YMzNQ=; b=nEqRyilqSYRnop1hcQ4p+Obmvq iH/L/WeUXcWmsKz+z/g7DKlYcUt9aVvfYj+ghXrJeQ9KDfoiy60mF8aySpZlJq+Q0wovEuM1RXtHY c1LClyOdf4SCgCtiiFPO0QzXchdPa8c7iWfcovXPCpI6ojPoLNzdbevq1Z59E4MXYsV2NjrkRJyYy 7KPGzL1sSLlcx46Yh0kezEeQJfMTzPzHKnTg9uLbzb+lGVT58bgnT4rI/7znt7OJ6/IQxIzyPHY2C YmNnHiKedAD4xJnHc6oQ0/4gYHCJhnrIP4BdRMkVwBGGrImWyUfYkm1qPA6p1na2fR+EgSvkXP5tu 1LTISozw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogn6L-001THF-Il; Fri, 07 Oct 2022 13:09:17 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0D51A300155; Fri, 7 Oct 2022 15:09:17 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E2DB92BDA8BD6; Fri, 7 Oct 2022 15:09:16 +0200 (CEST) Date: Fri, 7 Oct 2022 15:09:16 +0200 From: Peter Zijlstra To: Marco Elver Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Dmitry Vyukov Subject: Re: [PATCH] perf: Fix missing SIGTRAPs Message-ID: References: <20220927121322.1236730-1-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 07, 2022 at 11:37:34AM +0200, Marco Elver wrote: > That worked. In addition I had to disable the ctx->task != current check > if we're in task_work, because presumably the event might have already > been disabled/moved?? Uhmmm... uhhh... damn. (wall-time was significantly longer) Does this help? --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6490,8 +6490,8 @@ static void __perf_pending_irq(struct pe if (cpu == smp_processor_id()) { if (event->pending_sigtrap) { event->pending_sigtrap = 0; - local_dec(&event->ctx->nr_pending); perf_sigtrap(event); + local_dec(&event->ctx->nr_pending); } if (event->pending_disable) { event->pending_disable = 0; @@ -6563,8 +6563,8 @@ static void perf_pending_task(struct cal if (event->pending_work) { event->pending_work = 0; - local_dec(&event->ctx->nr_pending); perf_sigtrap(event); + local_dec(&event->ctx->nr_pending); } if (rctx >= 0)