Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp271977lqz; Fri, 29 Mar 2024 16:58:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyi9JzkfKOMxVJhwxZv0c1giDAGoD0gWBdQTjghzW0HiZQajshFKLvN4wdnYXvRr8y0WSdp/athft8ru2eu5ofPVMqTX/B8dViufq3Tw== X-Google-Smtp-Source: AGHT+IGQfPcENuKgZmgeTrNB53yAeiDkmTNb3502xjseAnmFPhU7WAnjgmP6rjCxE9IvABbNWly4 X-Received: by 2002:ac8:5cc6:0:b0:432:c8b8:84f9 with SMTP id s6-20020ac85cc6000000b00432c8b884f9mr3481730qta.17.1711756727048; Fri, 29 Mar 2024 16:58:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711756727; cv=pass; d=google.com; s=arc-20160816; b=BsByHP/H/qm7EbcKsZdWBphUed7T9JZmPdEjM9KAti5yicPkQySf3uuwQFAt6ZSxax my5VAXGVj6aUYlvUKxRkAr3gf8aGlvchSEpfmf7ATBRzztyR88TXwzuULWUk4Y4Y8ADf frth1GdOCQP/69UzsteUbqVgnW5udVuhtQj52d1wR6nV9Z3xJNVqis3uC01q3JuzdryG 1ag+RDdQ94JyqrNNBqrUnnD8P/17VYO/cFqpneQh38uejeJOprb7Y9UTFpRI2n8Y45Ah DL4U8ACIyG9XPs4TFy8tHtMtDI1ix3De/e0WmOBz9UGmoP0Gpr6YOlABaak3x2ZPBM2F 09vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=DWS8mFvmjYY6X6kuj0AhswXAFhorkPSPKe3p+FsP9Os=; fh=BasZ6imObaSLWGBXoO3nTfE3OEy4PpiGWQ2EQ75eivU=; b=dkDdY3NvB9ebr46O0277on3U0lerZFmDNERdrpSoloQIH4DApnpBruO/cWv/oZKpqu UaoK7ud4oqUFB3wvbRgLHQ6TnA0UVJvPJthreXQLS09FnPT7UKcwVJ8Mxs6DWFhBzots 3KqiLFwzef2RqA9v/84Gzhi7tH4kZKFNkYGd+2m7lLaJXAYCQFdC5aIlYgP6r2uHrB/4 mydtm1PG6lo7Wwdz/kffgzXRyhFz1fsNJGtz2dft26daTEr4IBktvRmfe/E8mnCE+0qP PIRM5L92d3tjeNNLKv5kMSuc4ZPgecCtQKBIlAYTaJvxc6E3L901SUAX609RKAzsPICy YkhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xz2rWwEN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125542-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 9-20020ac85709000000b004315aa130fbsi4960506qtw.427.2024.03.29.16.58.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 16:58:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125542-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xz2rWwEN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-125542-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125542-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 184B81C21117 for ; Fri, 29 Mar 2024 23:58:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 824A113E403; Fri, 29 Mar 2024 23:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xz2rWwEN" 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 AD4F8196 for ; Fri, 29 Mar 2024 23:58:39 +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=1711756719; cv=none; b=MyqDEyp7Nfzge3i/m8s5iYg/dicOTj+MepiGVD1qVMh0YfLBEz/nuB1um365V7xUiuKf93rRt7tkNXsuZiMv6Is6w13q/ZHG4Q2ifJPFd43vsHLHFHRCmOUJJ2YiFJBBvbWpIKg3LJ6bZHspBi01uyIc0I4msCthmFo9Et+FAcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711756719; c=relaxed/simple; bh=cJaitjfY5WidVNtM7vvFrtqfN1QF2TDI+z/3GVbG1Pc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=C6Zv/pfWliBHyhVwf25dAp1W168h+lCWSb91HFF4pgJSQSbhyXCtfiex89Z5dq+P9eseDMehzbzEUurPf7x+kPHhaaFQaWJKFKYsyrErInixVtHpcY4jTHBubSKi9RmcdlbSBF7MYiHDpYmpUeMsh34NJ29SVRQ++4Rk97gdvM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xz2rWwEN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 899BAC433C7; Fri, 29 Mar 2024 23:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711756719; bh=cJaitjfY5WidVNtM7vvFrtqfN1QF2TDI+z/3GVbG1Pc=; h=From:To:Cc:Subject:Date:From; b=Xz2rWwEN+IOqbdKxzgSXLM9KdAddMeiT8mmdctMG1jwnJnh5RIlo5uRvd2xabkvkk t+lLJ2oVJbllMXzyvHjH6XCEVVsdw4J2UxXWIreF2AVn3opvpO5JIUUIQhYzIMxh/q z736jv9QxyU3a0C2iYTjEsJ7+8vPDnJjolDQ+Mc5S09ERJIMO9pe1dJsbrG/xVvtID TyOA2CQU5uOyUHSPrNajwWS6vEKOLvuuH44fbpLeNfo4F5pe3stXoyUdhglfyiAi/F xBvpoOEdjjNePjk6IvGXpqyKZJxu/YY6PSf1zZsgmVKEL8t7gZqvelzx7NaM5uJMmI haj2ce8D2Rq4g== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter Subject: [PATCH 0/4] perf: Fix leaked events when sigtrap = 1 Date: Sat, 30 Mar 2024 00:58:08 +0100 Message-ID: <20240329235812.18917-1-frederic@kernel.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit While looking at task_work users I just noticed that perf doesn't flush its own upon event exiting. This looks especially problematic with child events. Please have a thourough look at the last patch, I may easily have missed something within the maze. Frederic Weisbecker (4): task_work: s/task_work_cancel()/task_work_cancel_func()/ task_work: Introduce task_work_cancel() again perf: Fix event leak upon exit perf: Fix event leak upon exec and file release include/linux/perf_event.h | 1 + include/linux/task_work.h | 3 ++- kernel/events/core.c | 40 +++++++++++++++++++++++++++++++------- kernel/irq/manage.c | 2 +- kernel/task_work.c | 34 +++++++++++++++++++++++++++----- security/keys/keyctl.c | 2 +- 6 files changed, 67 insertions(+), 15 deletions(-) -- 2.44.0