Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp163153lqj; Wed, 10 Apr 2024 07:09:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQ/nXQ3NvK9yMudUNiqAxAQmtN9TDuZEzD4Dli1t0yOilN0FSaROxrBgqItFVzVtSekJmb7MC/gWPnGKl093Up3Q4xn8pz+4HX4+oZ5g== X-Google-Smtp-Source: AGHT+IES1EMc4ddy4rCbPLnu93eD5DotqMgzxHKHOZEfp85tOGA7B6dUKfG6/Eoe4ulSg0/Aw8L/ X-Received: by 2002:a05:6358:6b0c:b0:186:27ce:639c with SMTP id y12-20020a0563586b0c00b0018627ce639cmr2779773rwg.18.1712758178712; Wed, 10 Apr 2024 07:09:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712758178; cv=pass; d=google.com; s=arc-20160816; b=kXRpSMg7zc0Gm6kODFVNZci0h+Bpf+e1YcZFLBww00mCTwzst3o9kbnj0yP+6n7AZP jqTgVrxri8jOMaNZbeWkTrKu2vIAzuAm+y+lbsa3C2m0swOMCjK/gxXbWgxpC7DbnhuH arVghh257n1TKucSMpimMxGHVLUAw50OY0x6bPeIufYDgJQpl5JJDvhlhRaOnwL2n+uP z4agXJw2KSHWGMXDqKziHR2bl+G9HX/ErQDiJkV+VkyM0vxTtt8d0AXMt6xRTXJcDHqK 74M+A5SIjnf4/9dg3RN5unIwziCOc1CsNDm5EEp0wu3nhXhjV0E4f775N54MqyLtXqX+ 6W7g== 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=QDeYJHqTr9XLFHihyXWVbZqQi62K7821akpFbLeVKTo=; fh=tWedduKdZfmc5x5dPveXf04NtuTwlscpi5X/WE4lpxw=; b=mbUUAnOV7kdpdOQZvYXcecVxp/XXaRfHs4/qxcEDu27VeVbXtgtZo4NuBj4sUGDRE9 8w1Xdw89n7A7nLTZ1wH05UUUEJ3/B73efC2c2WdD1APhNziVjkrt1zV/ouE8j0N9oKP4 l5dJ8DBLHrDQWJOCIEWUbhprpoQHK09X3rTqlLd+LazyUhCsL56duXH/fBnSM9YDURpV LGPdHjIgcT9E3BXlGy97FPo4Kw7qf41vX9eoPHUQVFfpZ1/Wgli0yfX4el9dZHG697Oe rBvxAOJXNtVxVBAj0ttv7O2bff7NH82PmJQ20RTs//qkKHitSXz64B0YU3vydPLAxqTd pmXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fegQ3CO9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138710-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138710-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w3-20020a63c103000000b005e8d662dffasi11014375pgf.707.2024.04.10.07.09.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 07:09:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138710-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fegQ3CO9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138710-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138710-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E6796285BB0 for ; Wed, 10 Apr 2024 14:04:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51265160783; Wed, 10 Apr 2024 14:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fegQ3CO9" 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 73BF615FA85; Wed, 10 Apr 2024 14:00:20 +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=1712757620; cv=none; b=PIuuD+Qqocq08IUs5qmXCOEMub9pFqptgogoMQnxsPAWEfuHOSq947TWXHzymKbinfZDaGST2HymhgReAgVNhjjT4JEF3FmjX4+tq6qt3B8R9wqLRmLNs4+aEkXyluZlHndEzfAVNs61zmsC56P7m4kNCgUYNAZQoiYphlyTkzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712757620; c=relaxed/simple; bh=X2T9/6im6fX+kU9/Z4tPG9Rx1cuH7ekkKBiLwPpECEU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TaxDJvgrwl2fBxJ59Tbf+RDG/7eYej8ZrQ9FEtieb9/cHUNvXMQDJ0jnR+w++2WdL+rbexniK/qR6Yzf9Yv8GVUcJroXSbXkhCXcCkdCk2QRQT07uYF2/eGI5TnotcvfAZWJciePHNdB7gWwhpR42+pQROOVqP2XMsFSBUlc4KU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fegQ3CO9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DDE3C433F1; Wed, 10 Apr 2024 14:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712757620; bh=X2T9/6im6fX+kU9/Z4tPG9Rx1cuH7ekkKBiLwPpECEU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fegQ3CO9RVfuDhv50USvMf/NWXuaO4FBE4zgHKwL2I6xQMUsrYWQEKQUgIhIkM6/r vwP7NIir6MYiqhUkh62e5pEabN4wptOuKHGCpUgM/dABEQqYGPPdxylu+UQ0njq/ui bvHqCtCBK1P7uuHKTcf1qGU+PdQivHleXQWfOroIy4NByha9JDvUjRZqVpH7E/LoU/ XiWKCBFOfSpxriFQKqUabQqj7fDD7ZFFJnOHLEw9M7FUp9NPKeJtQB8KHfwHfStujm ZoXBIrAB1fg10DVpOXiZ+AZVg5PjagnncQgLqmGfKrsJeQMaUWLj+vfBHo1qnvB6Um YoOIYtcmAB8TQ== Date: Wed, 10 Apr 2024 16:00:17 +0200 From: Frederic Weisbecker To: Sebastian Andrzej Siewior Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Ian Rogers , Ingo Molnar , Jiri Olsa , Marco Elver , Mark Rutland , Namhyung Kim , Peter Zijlstra , Thomas Gleixner , Arnaldo Carvalho de Melo Subject: Re: [PATCH v3 2/4] perf: Enqueue SIGTRAP always via task_work. Message-ID: References: <20240322065208.60456-1-bigeasy@linutronix.de> <20240322065208.60456-3-bigeasy@linutronix.de> <20240409085732.FBItbOSO@linutronix.de> <20240409134729.JpcBYOsK@linutronix.de> <20240410134702.dcWYciZB@linutronix.de> 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: <20240410134702.dcWYciZB@linutronix.de> Le Wed, Apr 10, 2024 at 03:47:02PM +0200, Sebastian Andrzej Siewior a ?crit : > On 2024-04-10 13:37:05 [+0200], Frederic Weisbecker wrote: > > > Couldn't we either flush _or_ remove the task_work in perf_release()? > > > > Right so the problem in perf_release() is that we may be dealing with task works > > of other tasks than current. In that case, task_work_cancel() is fine if it > > successes. But if it fails, you don't have the guarantee that the task work > > isn't concurrently running or about to run. And you have no way to know about > > that. So then you need some sort of flushing indeed. > > Since perf_release() preemptible, a wait/sleep for completion would be > best (instead of flushing). Like this then? https://lore.kernel.org/all/202403310406.TPrIela8-lkp@intel.com/T/#m63c28147d8ac06b21c64d7784d49f892e06c0e50 > > Thanks. > > > > > > Thanks. > > Sebastian