Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp20900lqj; Sat, 1 Jun 2024 06:35:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWd7l/O7EoUCretpBS2fBos81NEx7kL1f7kFSVd7nIr1/s7obsdA5Q0nQTlm423sylFY9JZenHC/+4rQyhQDh0+a4oUMRUPv/W8oPCidA== X-Google-Smtp-Source: AGHT+IGavgvIihyKM7HryswHcvNvTCuHGY0lZ/sBBm3JdXSSA5IJx7NXRbTPH8/SULXZm3dE5BnB X-Received: by 2002:ac2:43c4:0:b0:52b:13ad:f42f with SMTP id 2adb3069b0e04-52b896daca2mr2983430e87.67.1717248942435; Sat, 01 Jun 2024 06:35:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717248942; cv=pass; d=google.com; s=arc-20160816; b=d3/ni460rn85AXwOlOjlQfS3b4ssJPxCnkW2IwqjwyIekKcuH1sxEBfAtGeWT7PhTb wYyNbepuG13vnNxidaMP8Ry4oazMg6Rne8x3OwMMwCpyqNKu6lFiEwZMDT4pKJDoxsvi i0G3hoiDnUULIJTSSSA9dmbA+V7JpRLwZLC/XkW2eSFGX5FX45U+ViXLZeUVx/8OxlZ3 ptrGUno6rjRuJZQH2O6j0PdpRHXAbrSEMCNZmKaM4g+jW713ycbh3oNY3OjeUT5GhHbq umyMfsIYShVefO8wrqcisx8Ky4k4JXkNcvEhL5nfmXr88ZczocliX8vbuJaxoVJ5wgTJ z7PQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B7HdQv2/dOLVezJ5vqEsZ9dXToDXGYuDi5LMDtfpadc=; fh=ruN4FSlxluVQxGa24H6lsgDULyX72IEw+8/s+dr+DH4=; b=DRF7zWZKA5po/1ugeJwB/cyB4ZqUmS8mSpdHYG6ZAqcLSRuSdfwW8z0QomaHTTLo0i rdNVaxZWvY4x3pcu3kffCJ27lGMtG4ZLKy3abP1kMHkWlKa7H0vPPjQiKR9QypMuKQtg 3+hOl6RoQMsMzAgEK+MrdLHU32kt6bJ8DHOx2CDyZWNqERlRnIiqmFJLdYRAubEhP0fw k6DXCb/hxRbVv5pW+PeqAZI+ntiqXRDO9i7coWcy+c00GdZnuC3jjCFjj0J99/vs3xkn y1z0WbBdg7Qh20Gqj8xRBvgcFkPotM7edYVuNjiE3W6DfE/h3/qt09+rz9IrWINM+jRU PZHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OuU2BLIO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197873-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31b8132bsi2124912a12.78.2024.06.01.06.35.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 06:35:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OuU2BLIO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197873-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E26F41F21813 for ; Sat, 1 Jun 2024 13:35:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FFF01514F4; Sat, 1 Jun 2024 13:35:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OuU2BLIO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A464824AF for ; Sat, 1 Jun 2024 13:35:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717248934; cv=none; b=N6ugH2es97pieBb9/ZKlx0drRrl61oY1ksE7WTHeUhz9lGWk7Ito7kMOFwSwXwAH801gQiapMazJe/CqSsRvF1XbT8Bx2mSp/VoM3oIM56AgZZLnAZIkWv27aM0Jfl3ZEgkPd6CDLIe3vjDNn+8t1oGjgETFijO6EveWoAzEEvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717248934; c=relaxed/simple; bh=JiTSl7JBicjiXWGa8n+n3pZllni9FozR6cvrsMHpZOg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FiMX921JKOWtnPciOtygW9ghHAantAMEB0KOnuuj0kE/WUmyrLSk3quJ6vI4LAt8zQ9jSAbzkpEWydiU4Lhg5l2eOuCO5tpYXE8eBUU9CNht1DWuq3lB0LC24dV5zWO+G/imEa3lfAt3dOdVXTL/U1R63oCpNf9qE/7EavWCJHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OuU2BLIO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10F5BC116B1; Sat, 1 Jun 2024 13:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717248934; bh=JiTSl7JBicjiXWGa8n+n3pZllni9FozR6cvrsMHpZOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OuU2BLIOKPUdisGm/qv7+yh2X+cSqGwyYHqFqWTNY0wvIu4lFM1KPZkchK9GBHqSE qeizHQZTz+uBao790qeRX1OIVgZnOZRakm7N+kjec1IvWFFKsGiY0/5sXUogIDurgU 3Y6IefIV6PnE+a8IJljRWCn0wuFIS5EjTxHYwkU8CNHRADzudWNLSjhbLZwk6+9RSr 5JdOzWXvLW9TiEL55EvnGqR6LL7KQxvY82ykphSoiCrwTSux9PezeaYNPmRoP7BbHf LrZfcnh//TYL2vWwxxbcZ4lJfXJEPAtiXoS6jz6HCdTGWMXKOn7om7SxwkQ8VWd1yK wPkgx2b53nMZQ== Date: Sat, 1 Jun 2024 15:35:28 +0200 From: Frederic Weisbecker To: Arnaldo Carvalho de Melo Cc: LKML , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Sebastian Andrzej Siewior Subject: Re: [PATCH 0/4 v3] perf: Fix leaked sigtrap events Message-ID: References: <20240516140936.13694-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Le Fri, May 31, 2024 at 01:25:26PM -0300, Arnaldo Carvalho de Melo a ?crit : > With Frederic's patchset: > > [acme@nine linux]$ b4 am -ctsl --cc-trailers 20240516140936.13694-1-frederic@kernel.org > Grabbing thread from lore.kernel.org/all/20240516140936.13694-1-frederic@kernel.org/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Analyzing 5 messages in the thread > Looking for additional code-review trailers on lore.kernel.org > > Total patches: 4 > --- > Cover: ./v3_20240516_frederic_perf_fix_leaked_sigtrap_events.cover > Link: https://lore.kernel.org/r/20240516140936.13694-1-frederic@kernel.org > Base: not specified > git am ./v3_20240516_frederic_perf_fix_leaked_sigtrap_events.mbx > [acme@nine linux]$ git am ./v3_20240516_frederic_perf_fix_leaked_sigtrap_events.mbx > Applying: task_work: s/task_work_cancel()/task_work_cancel_func()/ > Applying: task_work: Introduce task_work_cancel() again > Applying: perf: Fix event leak upon exit > Applying: perf: Fix event leak upon exec and file release > [acme@nine linux]$ > > [acme@nine linux]$ git log --oneline -9 > 1f88fa6e3adb (HEAD -> linux-rt-devel-6.10.y-rt-sigtrap-fix-frederic-v3) perf: Fix event leak upon exec and file release > 44cde14a096c perf: Fix event leak upon exit > 512f8f5cbaed task_work: Introduce task_work_cancel() again > e7bee294ec69 task_work: s/task_work_cancel()/task_work_cancel_func()/ > 4de7b8e17201 Revert "perf: Move irq_work_queue() where the event is prepared." > 5efa195af234 Revert "perf: Enqueue SIGTRAP always via task_work." > 26ac4dfa180a Revert "perf: Remove perf_swevent_get_recursion_context() from perf_pending_task()." > c2fb5208a68e Revert "perf: Split __perf_pending_irq() out of perf_pending_irq()" > 6d20efa57a89 (tag: v6.10-rc1-rt1-rebase, tag: v6.10-rc1-rt1, linux-rt-devel/linux-6.10.y-rt-rebase, linux-rt-devel/linux-6.10.y-rt, linux-rt-devel/for-kbuild-bot/prepare-release, linux-rt-devel/for-kbuild-bot/current-stable) Add localversion for -RT release > [acme@nine linux]$ > > The workload that is used to do that, as a reminder, is 'perf test sigtrap'. > > [ 121.217475] BUG: scheduling while atomic: perf/7955/0x00000002 > [ 121.217478] BUG: scheduling while atomic: perf/7956/0x00000002 > > [ 121.217492] BUG: scheduling while atomic: perf/7954/0x00000002 > > [ 121.217570] Preemption disabled at: > > [ 121.217571] [<0000000000000000>] 0x0 > > [ 121.217609] Preemption disabled at: > > [ 121.217610] [<0000000000000000>] 0x0 Right because my patchset doesn't fix the pre-existing RT issue where perf_sigtrap takes a sleeping lock while preemption is disabled. Sebastian will need to rebase on top of this patchset and then also convert the perf recursion context to be per task on RT to avoid preemption disablement. Thanks.