Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp143621lqj; Wed, 10 Apr 2024 06:39:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUU6SDbEU6BgruZuB37e7rF5hr5VhEvIpelpCOpvM2N20bvKEvZ79bsFe1M92Sx0+L6aLyBwTz0Z9EYcAc+52dTzFbRqe9FGVsPzHNdYA== X-Google-Smtp-Source: AGHT+IGsBmHjxiha+s6J2TL5qZipc+BlLrP5YTY+jUepLlpsfMFLa7kWcF6FvhwVZkNzaM5KY+yh X-Received: by 2002:a17:903:40c4:b0:1e3:d843:2056 with SMTP id t4-20020a17090340c400b001e3d8432056mr3099740pld.7.1712756382071; Wed, 10 Apr 2024 06:39:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712756382; cv=pass; d=google.com; s=arc-20160816; b=y3oYPkl+ax2oy3Kza3HkREYJDFxW6yk8i2cBlTv9yc3sWyjCe1rpiZAtSFGFKxlvg9 1p/xnipFH/vM36VU6+g7j0gS1EwE1HgYI5QJZ2tbhLS4osq5CQz5SresacnfKPd8UX/+ 74P9QSHv/L0HKk4cIqxs8YAGLfwiqpXPxsnUNDvR2vbTFaUA0Jzldi66m5OPldjigYpM UvmzkuGCLu0amCeb9ek2a8pUUkdPGnxst4WN/8npoZqrz3+/vg8MBoF8DGuItX4WYg3u X7JCMlG50MDuV2ND71CJF744fMAz0pAVVtBFYH3VErDPL+l9BMqQeAruYXRfrscDV8ot G7ww== 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=e4QXXsu71JXQrIDib+0DcdWbOZC0pgoPfrFmZFNP9YI=; fh=5ZgsBp531Z/TnicYuMjJd/Em595GtQzH4MQc5+/9Dho=; b=SEslNYa4PBpx5UENJDj4ece5qL32a5M0gKXPePl+o7ako4SNuOjN7Yas46X5zuXALc 1JeC/W5QHIT75dOb2ApD/t+EDeWBykGbmLN6SFOaeIQ+R3w6GHwjdowfgIeCp2fHEdem kH6/kEgjgeqHpMS6JoKI7NBI/16B+BaoG0LJGIT2BVJ0biaFrkvJVxtcWCV4tGnAprh7 kAgnTCT+XU2CN+U/w1kU/CL7cdXnniMcBFC+kjoIZUrGuGghEUDbrgJ/ldBS209bfxMh 1pMJooLwN6rp/+HZts+tipl9dVQAzVXeRcn99T4qAI5K6TluF2CIHY/f8HxqvhmnS8Ys X2Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iw2pEUtO; 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-138545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p13-20020a170902780d00b001e28c0db556si10446359pll.577.2024.04.10.06.39.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 06:39:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iw2pEUtO; 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-138545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138545-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BF79EB27785 for ; Wed, 10 Apr 2024 12:58:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A96FE15EFCC; Wed, 10 Apr 2024 12:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iw2pEUtO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="V7JASDXn" 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 6CEC115B995; Wed, 10 Apr 2024 12:51:30 +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=1712753491; cv=none; b=WGgzaL13acGzADfvkoAWn0xauCPEURexuld0Ozm9+WuBNrzibWcp8McQuvR2ZOobf62P24r3o7SRdw2gYjKNy/gf5NTFFnUzMLX6cRI0ZJu81NA6PgmGAWqOO+DGDSgj7mnZ8IrIhzZgjiRpBEcHyL0NZrSCJc07j9lprsRzvDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712753491; c=relaxed/simple; bh=LLMGp714NUJtAYoSJJfvg+tAURcKNyM+caOeo+Zjxmg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QNjOoaefTaayF9W1iF/fQLjzadMFe4c9fjf28mlF9GqBopjQmj5t5RDpCnX/MMfBm9HzYbTZmcBcMKe23qcL7rsQHB2qHLdVhByZtY6zVxUuM+hZNCrTrmmWnOCjl3F9k2rg1xKz4jGR8P3k2XLqIZn6F+OHtxdb9kef3eQTOKI= 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=iw2pEUtO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=V7JASDXn; 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 14:51:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712753488; 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=e4QXXsu71JXQrIDib+0DcdWbOZC0pgoPfrFmZFNP9YI=; b=iw2pEUtOI2eZiBNUtW4AgZjjSQmLZy0yBPIv5T+wXGvsHP/vuXHFfAEk+2JDNji2JuZLsQ Ab9vPegknyD5vGwSW1VGmsRYvrkc6QhlWj4C7ORnw/Hc35OFqr2Nsni17Zdvxtmmt12WSN Cnk7cFq/zsyrE985StGzJ6ugfTxqdCGYaCsj0bO3s+4fmd9+ObbRJAUezu8vuWqrbs4mTF f9+qNqR5q2gKGWAuoUl4QYUsayf4PCjKySbF32oNI0NktBVhyyH/rofwjqVDcPHiipmtF5 2nI8U2Si4vQxzDOcWhypE9RX2EYJFsyFh9Jftyq0U5sS76/6Ezesxl38Jjp+3A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712753488; 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=e4QXXsu71JXQrIDib+0DcdWbOZC0pgoPfrFmZFNP9YI=; b=V7JASDXnjHUwWxLVi//k+JlpDl2zSCScJLqjUnDnxSA1Nx3xsauxDrCktOo/z8fugJI5aN t2jNcUrovOpx6uDg== 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 3/4] perf: Remove perf_swevent_get_recursion_context() from perf_pending_task(). Message-ID: <20240410125126.X26tR8tM@linutronix.de> 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> 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 12:38:50 [+0200], Frederic Weisbecker wrote: > > Anyway, I misunderstood the concept > > before. That means we need to keep that counter here and a > > migrate_disable() is needed to avoid CPU migration which is sad. > > I fear that won't work either. The task is then pinned but another > task can come up on that CPU and its software events will be ignored... oh, right. > 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? 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()? If clearing pending_work late works, I would prefer to avoid yet another per-task counter if possible. > > > Thanks. Sebastian