Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1893709lqe; Tue, 9 Apr 2024 03:54:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1K/CmxBywPIcBfrVvqh2APMRT/shbZI8H6MdDz3PIkUBshjJXsj/j7/HP2JXpJdjOAtbeo7sfK6IjW+GPqCXVIGJPys+N5yDZJDibSw== X-Google-Smtp-Source: AGHT+IHCS4n3QoDkIa6TBSxx3MfMMvSuHGysH0g6awYrddBPSlrrVi850piMhcrufV7Z1BBHtPQ6 X-Received: by 2002:a81:7b85:0:b0:611:85da:1a66 with SMTP id w127-20020a817b85000000b0061185da1a66mr10611465ywc.35.1712660060890; Tue, 09 Apr 2024 03:54:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712660060; cv=pass; d=google.com; s=arc-20160816; b=nsc8p6+7tZgZnJ6RWaCvtxHQ0APG1PmL4k0/heN6Ai3wqFXrT6Nlqbw/OnLGEjBqPI iBoL8LV0lcBCVmvdDyn8yNA+KWSbgQryx4IzaMVgVEjaBpSioVeIAXcqIFKRtpqsLqxV IxtQ1QwxG2xgL1oFcPwBGQT9YupeuvRkTjU+/e1wrwDQNqZjLQkawEpsCQIMJk7xgdRS TxBt38KyEOXbObdx0bbBHR8KMzfJzZKQO09eDRcB/v1bXFRY/T2R3FniOc7FTOR4PieT ECDxzrhkfHfG7pVdxYooTkHYNcKz9qzzipaVQFMF7fc2SCOpnJtd/XzMaHnogi01VoGK w+/w== 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=YQhaAeu4zgh+swBjyQ1jvBjfUntN8xbRTvW1O/c0dxA=; fh=5ZgsBp531Z/TnicYuMjJd/Em595GtQzH4MQc5+/9Dho=; b=OKar/gc5d2NTz8EznJD6G0XqQSGW2Z3Iqcwu+Fcxsy2VkyD3pXu9ngEeEaLSjgjOYk wEaT2Vq+CxTxhFoWk4fWzBK3TWBkkMo8rhbFFax/U54Z/zKNRSzOWEiCCudN6xLARv1n pGuD/JSOB84mtq/mqw0M7aaRwHQhn9kYRF5Ga4Ww4N3pc62FTsDDFHRdOS369vviAmqQ MWcik+AduLIZHcsvWQ4VwfFIwMcOSMH+0LuP07URe7HIl3Pt7iUVQi1Re3xdfs8BSqj6 v/IDYCr9vy1NaED8LVlj/jXApYimqZ/VMhzU/VdHWj4sgsGd3giesxcA2JdxzRhDg1EG S09A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QAEJsKG7; 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-136707-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s37-20020a05622a1aa500b00434ea5fa3b7si433697qtc.149.2024.04.09.03.54.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 03:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136707-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QAEJsKG7; 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-136707-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136707-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9D01C1C22CF2 for ; Tue, 9 Apr 2024 10:54:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F97883CB0; Tue, 9 Apr 2024 10:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QAEJsKG7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="42LboFMA" 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 52B9541C60; Tue, 9 Apr 2024 10:54:09 +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=1712660050; cv=none; b=sSAyGF6rvTDxfDzclAlFwgPH1hFiX1Xmg+MU1Nn0y5PhlOVRjeg8WcSWbUp5gizKhsgkLQPa/u6eYStpVXmK4j0aYBn8neDRkt2yFSay4Nw6NC1Acx1f/IozRLLuGT032IrHeJvt7FOVdH4z6EhEKR5UesU8dmGEcnMovppxXP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712660050; c=relaxed/simple; bh=AmtCJGio7+/c/U3LCQSr/M+tiho4jMrfzm0pFOKmd3w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rEf70V/GVPj7XN/GTQxR5ERYUMmAyMSPKIWxED1+nZAg8gmGf1FwnXa8f1FwVKmeWjIPtgggIKnX1guVP/6ZhEBU9hEAxVa/9dRTkKBEvOPKjv2ezoBKMHFQFZVcQ3lwU70rXnRuzn7oUtxbIkLI7YIjGZmLNU62ZdM/gtQpl9E= 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=QAEJsKG7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=42LboFMA; 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: Tue, 9 Apr 2024 12:54:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712660047; 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=YQhaAeu4zgh+swBjyQ1jvBjfUntN8xbRTvW1O/c0dxA=; b=QAEJsKG7EVYQa2Z4t2aXt3o1PU1qIL4S8OiHBMEeHgMJBGjMs0m+FsoNlhMhZP9xyutEys yq3sETvUtGyANdyJhJXv/LAIhqy6tUyBx1Vx6iqQzUXk8Fljn2qhlJFI+wE+LR8GT2E5ty 0xOU8NysRauK/kiK8G2QEX1wB9RmDsCL7JerVkMc3iGXzwLsOcJopaU47zLj2MX6TUDVqx mfYQESpoMk3zgpKx6wy2Mrzc5NrdMaCpnEjLDUj9c7qTxpupQs6mqQjD0igZiqDyG9QdeC XWRIYuY1gBhxABJy4TZVXLECivGxVN0Apj8+ys8I4Hmu7AbAbA8KV5lkXIHRXQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712660047; 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=YQhaAeu4zgh+swBjyQ1jvBjfUntN8xbRTvW1O/c0dxA=; b=42LboFMA3NIVV3c+yMBb0UPahS9AascTDZk/gUmQrgZT1T0ItSX8WBB1bQAgnriJzTKKNl p/TScuwMfOA3fQAQ== 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: <20240409105405.TXUU--_W@linutronix.de> References: <20240322065208.60456-1-bigeasy@linutronix.de> <20240322065208.60456-4-bigeasy@linutronix.de> <20240409062501.h4rA_ck4@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-09 12:35:46 [+0200], Frederic Weisbecker wrote: > > > > @@ -6800,10 +6792,6 @@ static void perf_pending_task(struct callback_head *head) > > > > local_dec(&event->ctx->nr_pending); > > > > } > > > > > > > > - if (rctx >= 0) > > > > - perf_swevent_put_recursion_context(rctx); > > > > - preempt_enable_notrace(); > > > > > > Well, if a software event happens during perf_sigtrap(), the task work > > > may be requeued endlessly and the task may get stuck in task_work_run()... > > > > The last time I checked it had no users in the task context. How would > > that happen? > > I guess many tracepoint events would do the trick. Such as trace_lock_acquire() > for example. So the perf_trace_buf_alloc() is invoked from that trace point and avoids the recursion. And any trace event from within perf_sigtrap() would trigger the endless loop? > Thanks. Sebastian