Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp159032lqj; Wed, 10 Apr 2024 07:04:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMJ+Y8NVZ5sFYRYgWcQMDg4ztyNTkjaO0SGh73KNs7yh+RwD3vQNvenK93ib+x1M0q6sXoYR+0l1WuQUuPppqgg8FZ/qZIBc6v3dPWmA== X-Google-Smtp-Source: AGHT+IFnwX/rsL1eTIxW76f+Am9gd/XF38kzq6cEhkIb1s8rLKapmsFWaxTq/w3PqpViWxDitddc X-Received: by 2002:a17:906:6d0c:b0:a4e:fe3:ceff with SMTP id m12-20020a1709066d0c00b00a4e0fe3ceffmr1548206ejr.57.1712757877233; Wed, 10 Apr 2024 07:04:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712757877; cv=pass; d=google.com; s=arc-20160816; b=KBrCJcLNgS8QmY7ZpkHLKDyf2KUW7Qd5bUK3PiDcbZgEomMQ+fVZ0kTBXiRhqQlDmJ 3sjM8L36DDBbwUJdzBacZ7QiA/wBlCIesIOP36NAI4wUi5DyNoC6XQIAKXvi9nLBENOL JQXWFpxRgJqs3h3YuC0m1pYmKLjF2OgYEk/XiNN82DVvi11eL78uExJROZCt25m3BloT baggNPMhBd8f0AsQTuqLyM0JOiQKAZ5aMDboYhQEQfF26lwSLkzXfSQdRcOTayAlWyvk wBFOa52h2a4RXCP1RKeiiTiPtY5HCL2WcuA+yNHKXFipkYgEAR3canC751HvTBZW6dmN 3W4A== 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=hhOZinJgKgnxVfriZ2+moFDZGqlwgLAFRbmSi96sd3Y=; fh=tWedduKdZfmc5x5dPveXf04NtuTwlscpi5X/WE4lpxw=; b=dE+xK4icoy1reYJKn1tMY6y0ijj6xHRRSIxeV8A6gJUGLs+zRoVjqYa1vtukeDPxx4 I2M+CznfmWKJNFgRIKrf02dgdlZAJH4tYFEdzRGFMKAEOAZ4ALdMubWiSDlBHfhavg6V CDsottWJ87HIOObcTGrI3wp634CbOiWRzOsTi/wjkhaPI9kg+tRzMZ8MqD7N4z0Cyv3d qxCYWrl4UciGtKaIe1ayrCiiY+/eClbShyuhpQjEaxtGb9k0K7X+K58WB7AC5XbjqrUK JB+zkVbMEy3KyzIp1pYQlBrHy+WNf+wdN7cbs7NNd2vJLCxMv6UYqlVBsV6KsqDtKOSN 9FmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IQ5HWuEv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138692-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 s6-20020a1709067b8600b00a4e6cdf8ea3si5886068ejo.715.2024.04.10.07.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 07:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138692-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=IQ5HWuEv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138692-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 1E7721F293CB for ; Wed, 10 Apr 2024 14:00:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62EB516D30C; Wed, 10 Apr 2024 13:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IQ5HWuEv" 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 856B515CD4B; Wed, 10 Apr 2024 13:58:43 +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=1712757523; cv=none; b=iHzf78Ktbcna9XapkbAOkKhn/Hvn2XwhaTVnNveIik6+v0J1USCCVSMT0F7/iMIfwxTaODAI7ULFdxprr+UTTWAtFiVqpKqMOwLm5WbspTlYvYRHVCbV4cWPig0p9tt+g5dBfXG8P3nmfb6UKpCRNn1qM+hhWXq27AsMEI/KC9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712757523; c=relaxed/simple; bh=CteGrLp21p90H//plZVTRArhoHufEhyzcxklfO2rDtk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fXHIB+QwN+ccjjin5PE3+WJ2s9piNYsXYMyUJyzAc0wOHUIYjdQ7BZG0lUcRV233gZ1sz336NkV7HMOqgZCajZCH9qRKfkOnJ0znznr8hOO/0Gv3nBI9IWIo9FQqdNgK9pmUqDLM9n0TM0M66zWRd6ld95e19+XEfJvJWdTeGig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IQ5HWuEv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BABF5C433F1; Wed, 10 Apr 2024 13:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712757523; bh=CteGrLp21p90H//plZVTRArhoHufEhyzcxklfO2rDtk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IQ5HWuEviNHm1qAE+YQNb3OQsWEmGjHsMyckLuumeCpTAF5uQiCn/i7I85js2B5S4 KCSnBcl0DscAqrV2hvDLsXgE4+x9UfNnYH0QCU1G2dBDTdlwMDXbPRWphK1rk31m6W DPDNMOOjVuKynkZh4cimbDorssZ86nAhRUkolMbHmgeni28RBLS4pKCmuklVqwlIOv N7217bKyaDQfrhLSL6HweYfz7M6c4U0coXLvc68iuTuGq15hIdr86v3UaCYgZgarS9 usd7jU2TuBt4Tqr6O+gF/F5Q5FT819Fs61KxgShir0g2PC3zFnt5HQopQVQMucXSKV AeZdEqe6YyWpA== Date: Wed, 10 Apr 2024 15:58:40 +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 3/4] perf: Remove perf_swevent_get_recursion_context() from perf_pending_task(). Message-ID: References: <20240322065208.60456-1-bigeasy@linutronix.de> <20240322065208.60456-4-bigeasy@linutronix.de> <20240409062501.h4rA_ck4@linutronix.de> <20240409105405.TXUU--_W@linutronix.de> <20240409133336.Y4Io-16-@linutronix.de> <20240410125126.X26tR8tM@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: <20240410125126.X26tR8tM@linutronix.de> Le Wed, Apr 10, 2024 at 02:51:26PM +0200, Sebastian Andrzej Siewior a ?crit : > On 2024-04-10 12:38:50 [+0200], Frederic Weisbecker wrote: > > Some alternatives: > > > > _ Clear event->pending_work = 0 after perf_sigtrap(), preventing an > > event in there from adding a new task work. We may miss a signal though... > > > > _ Make the recursion context per task on -RT... > > The per-task counter would be indeed the easiest thing to do. But then > only for task context, right? It should work for CPU context as well. A context switch shouldn't be considered as recursion. Hopefully... > > But why would we miss a signal if we clean event->pending_work late? > Isn't cleaning late same as clearing in > perf_swevent_put_recursion_context()? Not exactly. perf_swevent_get_recursion_context() avoids a new software event altogether from being recorded. It is completely ignored. Whereas clearing late event->pending_work records new software events but ignores the signal. > If clearing pending_work late works, I would prefer to avoid yet another > per-task counter if possible. Yeah I know :-/ Thanks. > > > > > Thanks. > > Sebastian