From nobody Mon Jun 8 19:36:30 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 2069F3B7B7A for ; Wed, 27 May 2026 07:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779866667; cv=none; b=UC3PY9YsgDyMLP369SqXd3O+UhK/W1qyZH2Qae100u7EqaTf8sblX1/+MZcm0K13leuuZUUpNnbMr5cBML0TlECZFRdaR/ObIH640rop+QrLQAj5Btg4o64/Llpgh8aMLfiiuw98/y9PMH15UlKC00iIKeVy+N6hEXVWbIrKuII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779866667; c=relaxed/simple; bh=yZD8BlIWibNDG3vNFFijxjWlLCkFemDXbhq9nyMYzNY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SaM+ZcUjr4LEK2PmIlM3IgCzU2ZqFsVHzoJWiKW9j4rPrGH+2QigAXVHdJBLjBzsFf0b0XpZCB4pzis7lCj0OBzAtNI3uolwdyazE34bMWf6YR/XlV2LSKEcAPCk2dO+d/D5Vu19g4YnE97DyELZNXAId3rkh7m5Tp+IkVuMW7M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bsNmDeLX; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bsNmDeLX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779866664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=BE4XyLT87Gg/bjycNNgnmr9xZqsrTBb+GlBCQ/isyoQ=; b=bsNmDeLXOrcG7aqSzk1ky3B3qEAsIVNAmw8sqMl6nyVnikLh8tMguWjWRZJYfeeHyaUZlJ sqahGrrXCOxzdEC0jiD7aL5TH89Yw8GgxsgIvWO3imKr60oawgzapppLHlhZcSKnCZ6dCd oaW6uo0khZCVlQJ2uzFGNIyyFI4VnKU= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-HTlYC6WbMy2mmvnldwO1fQ-1; Wed, 27 May 2026 03:24:18 -0400 X-MC-Unique: HTlYC6WbMy2mmvnldwO1fQ-1 X-Mimecast-MFC-AGG-ID: HTlYC6WbMy2mmvnldwO1fQ_1779866657 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E79C3180044D; Wed, 27 May 2026 07:24:16 +0000 (UTC) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (unknown [10.44.32.86]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D6F9C19560AB; Wed, 27 May 2026 07:24:13 +0000 (UTC) From: Gabriele Monaco To: linux-kernel@vger.kernel.org, Steven Rostedt , Gabriele Monaco , Masami Hiramatsu , linux-trace-kernel@vger.kernel.org Cc: Wen Yang , Nam Cao Subject: [PATCH] rv: Use 0 to check for preemption enabled in opid Date: Wed, 27 May 2026 09:24:07 +0200 Message-ID: <20260527072407.82062-1-gmonaco@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" Since tracepoint handlers no longer run with preemption disabled by default, the opid monitor should count 1 in the preemption count as preemption disabled. Change the rule for preempt_off to preempt > 0. Signed-off-by: Gabriele Monaco --- Forgot to add this commit to the fixes series. This is required since opid was merged with the commits enabling preemption in tracepoints, similarly to "rv: Prevent task migration while handling per-CPU events" --- kernel/trace/rv/monitors/opid/opid.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/kernel/trace/rv/monitors/opid/opid.c b/kernel/trace/rv/monitor= s/opid/opid.c index 2922318c6112..3b6a85e815b8 100644 --- a/kernel/trace/rv/monitors/opid/opid.c +++ b/kernel/trace/rv/monitors/opid/opid.c @@ -22,14 +22,8 @@ static u64 ha_get_env(struct ha_monitor *ha_mon, enum en= vs_opid env, u64 time_ns if (env =3D=3D irq_off_opid) return irqs_disabled(); else if (env =3D=3D preempt_off_opid) { - /* - * If CONFIG_PREEMPTION is enabled, then the tracepoint itself disables - * preemption (adding one to the preempt_count). Since we are - * interested in the preempt_count at the time the tracepoint was - * hit, we consider 1 as still enabled. - */ if (IS_ENABLED(CONFIG_PREEMPTION)) - return (preempt_count() & PREEMPT_MASK) > 1; + return (preempt_count() & PREEMPT_MASK) > 0; return true; } return ENV_INVALID_VALUE; base-commit: 8bc67e4db64aa72732c474b44ea8622062c903f0 --=20 2.54.0