Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp152358lqj; Wed, 10 Apr 2024 06:55:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFhorIccJCGTpsAJOx5xdGu5o7tKESZAU8UqPtPrOSAeRn3g0C/1wHg9rF5JvPw9Uj0wXn+eOY30sfFKhI72Dw8IktzZe6I+Ox+G0DJw== X-Google-Smtp-Source: AGHT+IE45TATB/3hERvsYSlnhKDSs6fFtziN2ofmpXtoL5htuDeYH1RD1BqOI/sdbrkWqt4InnaF X-Received: by 2002:a17:906:af1b:b0:a52:17f:e693 with SMTP id lx27-20020a170906af1b00b00a52017fe693mr1556919ejb.18.1712757310889; Wed, 10 Apr 2024 06:55:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712757310; cv=pass; d=google.com; s=arc-20160816; b=jDC1uWu9XaCtkt5HTHMb3v1OkmOm2NO8aSu0V9pmG98fC2B64Kvxc1sGeBdZexP4br 0h1GBVmOx9lCq4vqr5kZG/nnXWCYs8AN1F35jDChzEOMV04am3ztxIHfSugsYqwdD+Gu Ie7qKY9H4OsTriQrROGqFx3crhkaIAGi8H0Hai5nSO4W2wQlKB4vI71jkr7SeFgEpGI9 18TAV9+D1yPHa3DbwqXucPPtZKHc3eRqK9ELWcBrtTqAAIuMApDS/PYE6C/KW0CNXIU2 qWkGXG4kAlLFjIyglBuNGeDDZzNDRoJ7lRrk35IhxmLt++JOzkVVY7EMcdRsu/6u4Wkd +V/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=mhPMkf0CnmtshBlL7f3oui1BPAffLvF7f43OGucaSdU=; fh=5ZgsBp531Z/TnicYuMjJd/Em595GtQzH4MQc5+/9Dho=; b=KWKD8uUKc4V1J7ta5QnVuM+PI3wKuobyYUDsWsQbcQ8oNSeN2KG2BQ2z8k3+87M8Ir yEdfJB1Dw0lJcxWscflCQUk2yNEhWRsDd3D5fkPsJ+QhKoz9AKfUOThQ4X/6Qm/nTDNS Gz03MnBwMIHTigHD8u9/93RUBUozlIWoasHvpV+kMr4mG65GwQaY/BF8mQxwh0ga00rk HOMM2a9cGuio6ddXTc4Jss9EbsUSGU/d/v/ON+RJBiN0Dg/hQ6E/22zMpB3/aACenHxY Ite7U5uKoSfLQu/e0sKv4NghRv4r8B/McNW54tTI1/9ihJHEqDq1N4HsTcAk+ZxVlGNk O7aQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Riu6LYCO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-138673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fy15-20020a170906b7cf00b00a51a12d91aesi5559496ejb.605.2024.04.10.06.55.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 06:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Riu6LYCO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-138673-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 832311F32E96 for ; Wed, 10 Apr 2024 13:55:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DB2B15EFD8; Wed, 10 Apr 2024 13:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Riu6LYCO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="09FWCbA5" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 2E1391854; Wed, 10 Apr 2024 13:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712756827; cv=none; b=BuXz9uJqk49qZMhfR/DeDlZYNapPJ9DmUHopOlBJv9MbqcSNuHeVq3xLvPuGG0OFNiznqkOhEel7HNogEGgSn3MMaQYhX5RfaRuW+Ix1V4zX3EvyjBtcIKekFCbx4ULIF3gW29P4yOJ58OKSMxg5vhSpMCLe/nJPzismxHi/j8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712756827; c=relaxed/simple; bh=9ai/S2RKppG6/QBUvnM1yQb2xUplPv+uZ4oIw+16Bus=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lzKPn/emKf6uUMprV1LkvnR9jZItlNGeO16N65hy8LHrx8xRg1JbIpp3+lFk19zLO87DaXLQLIO27mLPHIYsZcCcLAakPt7oP5lRwZlmlcNPaljHk5X82GENaPxxXiJYpwLNEyYOrAS9cbqEUo/qOTln8elIQ1iWR6wZ7BablnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Riu6LYCO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=09FWCbA5; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 10 Apr 2024 15:47:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712756824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mhPMkf0CnmtshBlL7f3oui1BPAffLvF7f43OGucaSdU=; b=Riu6LYCOxJAkNl00u5Bj3HXspqVWVG8Ca0CkgDTEEZdAXPg+FqRORQt7OVj/m2G/OHAx1L i7P/0rTdHxhgdlPN/SIs1X+Xi42IVCNdem15ynQyHGWdywtcCJNTtl9nNKLOzHnFM+QK6w vQe/d9++1fx1E7jXFHgKOpQ4Mz+6FJyw64nLx4Cd8CsRJfasMJx++Tj0OPOe3g7/ixH6x7 OZcbWQtmHgPds9NhAr+SodvnCBdXpXbsdN9xLtXKquna6/Ok8h5azRkL7q0IvG5v8Mk+ge 8YJpyOEnnOYVd+VdrawJvzDV+F/HWIrqdWqIllcYMp1lIwSrOy7a+w6Fd342dA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712756824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mhPMkf0CnmtshBlL7f3oui1BPAffLvF7f43OGucaSdU=; b=09FWCbA5NEKVjftJWaJb8Fqv88LdWfqW+AD4/9Dpfxi4KOIBw6/ksIx75cNeLY5EdYE5Ca GAil9/8NDHFboaDw== From: Sebastian Andrzej Siewior To: Frederic Weisbecker 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: <20240410134702.dcWYciZB@linutronix.de> References: <20240322065208.60456-1-bigeasy@linutronix.de> <20240322065208.60456-3-bigeasy@linutronix.de> <20240409085732.FBItbOSO@linutronix.de> <20240409134729.JpcBYOsK@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=utf-8 Content-Disposition: inline In-Reply-To: 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). > Thanks. > > > > Thanks. Sebastian