From mboxrd@z Thu Jan 1 00:00:00 1970 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 326763563EB for ; Wed, 10 Jun 2026 19:51:07 +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=1781121068; cv=none; b=W70umm5PxNB0ki1oy0tjz33Cxd0PFiGG8d8yESYqHyrZRg9qFmF6wOCaeo6N/zr6sXP3AGuEgKdd0cpWcca+y+2H0nM8YgEQH23jIayrbgiHyqMNib4AFe8GvuDoHD5sZDFVAHIqdxXBvNfK/+uhwXUFdL38JG0kT3V/+IEw3ko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781121068; c=relaxed/simple; bh=tX9o0Y9MMKMnSklZAvSZe6K0Nt3EhGpNCvXaq3nPOm8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=oHa5hddLm13q3oAzr5suH3x+0FPIw1vVKMdxQBxRr+CFTL9mlrK+v3sG0YnBz2OCF7+Pfw3tivAbE5XgpVn9Kfh01yiEio8PzfC1UPvzpQAEJuQ0ZHmeLG/kW+CsyJO3pRgEktMdyINZSIbjebuzlXxfmpooCgRHBOijdkx1jhE= 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=g37rf3LJ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=hBIAo8jc; 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="g37rf3LJ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="hBIAo8jc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781121066; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tRFqrK+FD8/ttWzWSAic+qFGoF10SyTo3eAZoCNE+ag=; b=g37rf3LJmVNRxES8wAzisNo3q23KK65SO7m1bb86sdOxv2btbkdamrbZHkZmEfq/DK3rPV JcvX8oJdWzkuj5s9FBrHN1ei8ez6Uvfi6r+bWQ5NCA6B1zX5LMNwfQ7ydOzAwzsYiV8bBK 4f1o6nZgcRKRbr7FjolySc3M0oB8pAU= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-649-vLtWtxX-NgKbCicIm2QNeA-1; Wed, 10 Jun 2026 15:51:05 -0400 X-MC-Unique: vLtWtxX-NgKbCicIm2QNeA-1 X-Mimecast-MFC-AGG-ID: vLtWtxX-NgKbCicIm2QNeA_1781121065 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-5177f07ea82so171105681cf.3 for ; Wed, 10 Jun 2026 12:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1781121064; x=1781725864; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=tRFqrK+FD8/ttWzWSAic+qFGoF10SyTo3eAZoCNE+ag=; b=hBIAo8jcFsit7K2nrQxLL9qwKZFvWtipZD0p0vAVe7KRZX24tuRFPZHNNSQGart2Yl mMMZ2xRDek3LUah3S8BpzExozpQV+lJXgqDBPIfRs0jbJ5xtRHUp98qJeWLsJC17+X89 aLI5NAMKpqvmfP6B8SKPcd2NheCFcpFBPGQY3i++T1mlDXFfd1PNiREUx7h44yn4qPA9 MqprUaFTbDCbOiuQtJUP5VQM7piMlM0kZO4HNZVrG+9NtmKT6X2AkxdCB3sEglQ5BW3O tPblytEip7rXfiAKp+KEjS6h3yEu8IEqjEN+NT337XEkUDi2eWMTbnWD5Lrz/yoInmxt sd5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781121064; x=1781725864; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tRFqrK+FD8/ttWzWSAic+qFGoF10SyTo3eAZoCNE+ag=; b=bg2fg+XpnJRzQ2GpcGfrEIJKaW25CNUvpwGc15ydbwA5wMlmno+ROcDYMBlIB0Pjgy is3N9W6leCYeSGxygPVV7h3palQ/tRO/a1LfUoCTSO/HsL3QwLUjD5nWysReuQ6xOeM0 SissW3HUwuSYdKA+ft0JHZOmeq+gpJ5OUVu6QlPqk2najD/Qji/WFcZJxeEVtG7J7VXo 0LcZ7+ZYlW6Z2Y9btzH7X0TryLr9M3rHElrAP81w/BiI1y6evENib0tPv8Csm+kxAgjD CX2RiLXRyHBugc17jx0O/LrCU9YODUWkAFB1E41DaxZDlAXth88NaogBPVF1yodpG2Dd a5pA== X-Forwarded-Encrypted: i=1; AFNElJ/TxHMAJd9klKZUDWrAvATenVmYey2cPLMNcNFzJYlovymlKVw2VRyOXvLG/02hOrsb4G/9fqCuBjttHBY=@vger.kernel.org X-Gm-Message-State: AOJu0YxL02ZWhc0u/dYsIpT7a7CquIpuQjmYwMl7Ty9vMYpbguxSaZPF gG6Dp7aHEvnMhpR+5jc5BiuGS71VRl3UHX8CEZQQVQQ8wPiD/RIahiHPKOTrNNAIiwfrnDoRGoZ nf9fuaVnL7yywnZdLqWdolyA6T1SjUj/dI9F8r1xn7KZ5HTEsAft0cmO+YcuTCDpxMQ== X-Gm-Gg: Acq92OFSDT8llIfvAlZ1LVh0FBYYEQaHXK7aEwDcTbB9nnti0GmnXKAOI3AH2wuz8ej JiQu8CybKdtm0tcFdmlkLeUdf54RJ9aCHC2MaGkeNG0diOBES4Ub7CbD3aFZhuUhGwFrWxm7I8B 9hKSB+8LIXqoNq6i/BEKYU/LWjRIMctC4+eG2m/8B0sIX0xj6rHX217Co9RtdM39qfnT5zGyQpq 7upJ7cdQk639G/5z39BzVTF1QN0uTBQ93BQWf3RIcKLloXbYN0lrOFbR+ViR251kuinj61C7ieI 5lVUGooYyLiZ32UqMShVxQanOzkChgPat2zf79yB2ojjpz74nmisv7fu+Iccht/otrluFHYapKY lBTLAkECC0chQvrYxd71TyfyvTtq+Z2dXtEPACKF1bON8+e1XR4ruPhJ+VIgfSUqf X-Received: by 2002:a05:622a:114c:b0:517:d869:4293 with SMTP id d75a77b69052e-517eaa95694mr12023561cf.43.1781121064483; Wed, 10 Jun 2026 12:51:04 -0700 (PDT) X-Received: by 2002:a05:622a:114c:b0:517:d869:4293 with SMTP id d75a77b69052e-517eaa95694mr12023101cf.43.1781121064032; Wed, 10 Jun 2026 12:51:04 -0700 (PDT) Received: from crwood-thinkpadp16vgen1.minnmso.csb ([2601:447:cc81:56d0:ab94:b2cb:29a6:7ac0]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8ceccd9fa53sm243219196d6.8.2026.06.10.12.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 12:51:03 -0700 (PDT) Message-ID: Subject: Re: [RFC PATCH 1/2] tracing/osnoise: Sample IPI counts From: Crystal Wood To: Valentin Schneider , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Tomas Glozar , Costa Shulyupin , Ivan Pravdin Date: Wed, 10 Jun 2026 14:51:02 -0500 In-Reply-To: <20260610130457.1304245-2-vschneid@redhat.com> References: <20260610130457.1304245-1-vschneid@redhat.com> <20260610130457.1304245-2-vschneid@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.1 (3.60.1-1.fc44) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-06-10 at 15:04 +0200, Valentin Schneider wrote: > Osnoise already implictly accounts IPIs via its IRQ tracking, Does it? It seems that IPIs bypass the kernel/irq subsystem on some arches (including x86, but not ARM). It would be nice to solve this properly by adding generic ipi entry/exit tracing (similar to what ARM already has). > however it > can be interesting to distiguish between the two: undesired IPIs usually > imply a software configuration issue (e.g. wrong/incomplete CPU isolation= ) > whereas undesired (non-IPI) IRQs usually imply a hardware configuration > issue. >=20 > Signed-off-by: Valentin Schneider > --- > Note that this is modifying the osnoise:osnoise_entry Ftrace entry; I kno= w > trace events are sort of supposed to be stable, but I'm not sure about > ftrace entries. I think old rtla will be OK with this since it looks up fields by name rather than assuming a fixed layout. > Alternatively I can have this be purely supported in userspace osnoise by > hooking into the IPI events and counting IPIs separately from the osnoise > events. One benefit I could see of doing this in kernel osnoise would be if you could atomically correlate the count with the particular noise interval, but this patch doesn't do that. > +static void ipi_emission(struct osnoise_variables *osn_var, unsigned int= dst_cpu) > +{ > + if (!osn_var->sampling) > + return; > + > + osn_var->ipi.count++; > +} > + > +static void trace_ipi_send_cpu_callback(void *data, unsigned int cpu, > + unsigned long callsite, void *callback) > +{ > + struct osnoise_variables *osn_var; > + > + osn_var =3D per_cpu_ptr(&per_cpu_osnoise_var, cpu); > + ipi_emission(osn_var, cpu); > +} > + > +static void trace_ipi_send_cpumask_callback(void *data, const struct cpu= mask *cpumask, > + unsigned long callsite, void *callback) > +{ > + struct osnoise_variables *osn_var; > + int cpu; > + > + for_each_cpu_and(cpu, cpumask, &osnoise_cpumask) { > + osn_var =3D per_cpu_ptr(&per_cpu_osnoise_var, cpu); > + ipi_emission(osn_var, cpu); > + } > +} Isn't this racy to do from a different CPU? Both in terms of the counter, and the timing of the increment relative to when the IPI is actually received. Not necessarily a huge deal if you only care about zero versus bignum, but still. At least worth a comment, if we go with this approach. -Crystal