From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E04C1312813 for ; Wed, 7 Jan 2026 09:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767779510; cv=none; b=aHFg/EikWG/f8D/qlRPWWxCAHkKs6YrdcrFXccA7Ku17bsu0vlP5cYT4kRnKnUIML5K51z0Gi1w35RhLb+k+0Y1Q5NUfOYK3VEDiamt2oS8UV9NBqLQyt77xgKeOoNXzDcRP5VbAOXjAYAdMN76Dx/OjLTCcKUs+FiWXoKZEflY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767779510; c=relaxed/simple; bh=iiT2R8UnHUrK/rPGvAFhFVgfetfWj89nepLFbQiox64=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=im24zfXQsMByL9A5DvocT/lRGkFs94VFZsLKFtcM/9tp2Ioxu+xUAUO5R65CH9IyzQ0Gopq3Jodju7B/ty4lMHDZYSvdlkOL9DZP9oq7HZQ5410fe0yob631i7dEc/XKWUwkqQbEGTheeXJ7w3OqFvXNT6YlKijOf8oLChX+6+s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=e7V+MxZA; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="e7V+MxZA" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-47d211aee52so2290965e9.2 for ; Wed, 07 Jan 2026 01:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1767779502; x=1768384302; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=NkfocqoVaxgUjAmHmf02FgYq+uCwVg0Btx7TYoadT20=; b=e7V+MxZAX26mEbmvSSNJ3K6XCeKoHG3MzvXSddS6rwIRDWGPOUCaECYT3wUGcm9NkC frQtPnDcrWPCp8QG2kGuOMmaJ95vZUb/ytvpXWgO3H/fLACEhEWHZz2hi3vCZDTY8UFJ awKqfEHNOprlS9xqDl7fUXPbhUDIebty7YD2hqNcJ90ddEgYML8Sg0DDpIT8zYLQaxFo bO2fQiuT03Kwhx+Ha6RAPfQZCeBdWpuJypmVtX9cFE/S//K+ofgIcjcpqBoaN8QbYHK6 cRzAN9f0pbXib1Im1q/8AU9n1EtNEAkDSlVJNg8W9H0ZOHm8sBzSriBYTYD7e1oyffVk ISqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767779502; x=1768384302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NkfocqoVaxgUjAmHmf02FgYq+uCwVg0Btx7TYoadT20=; b=wMbPz4xbxfQxnI6kdxLjr8LdZ1EspM+UauzznyXwyaZKgYWkWcJjwEQ4fjcWq1l20P yluIa6p6fl4WCSeUhjHRCzXo8mH593fZHZy7utqLxKmPHerwNpMNUuEp9m9sOgG3C/gX Smt9GWpwZcBCZn3V2OTtVLy5J5QRRWcFyLRZcn+KhN99oMadpIKkrlq/phMo4gYqDWUA 8fhclwtyKHIMKbvNm2sRy7XC8gyhXyYTQ5lrizZKt+8hiVJUlUqgknIXmfq+RMoXDHJU C+A122D4ZwHlRytZs7JLHJ/gokHkV8gS0Nacs/0DWVUJaxQwarrVhK+GbLZ4CteSNngz Ooiw== X-Forwarded-Encrypted: i=1; AJvYcCWaQHg3nzpzcbH+e3RfgLZxhCOqcigvFzHv7Zg1NcdHLes5H8J9Th0kwO2EBfVgsC2oEFpx1ALi+JNckK0=@vger.kernel.org X-Gm-Message-State: AOJu0YzrNQXmKJYFeCtYfaEc76JqXizyom8eykqPeeJSJsWAJiHeM2er FPeIE2K4VoeQIbWo5tz6qGToQWhEANO58jMEd6osXCkfGLzvfQPuT/zxWyYzRGrigyY= X-Gm-Gg: AY/fxX58m8gKAC76ybd0bjU8xRBSsglSITStha0yUlbZFu5Hoop96DgyZbdnh2tZyBC jKn0cRr7n/LuRj+cBg+GN+Tyi1FbtLi54FkiV+pa3B3Y5bkPp/Z+yxg8QA6YEC8Mfno2HSqeldA DDcHHyUyy0zRWiYzOwnqJ+/HTxBP+WBJnqmE7TqWSg9nLw0bZB7RndEI4d3jexmPs0a3T3C5cmk uni+L3Tyl0FMLqZmXGxI9FCrQnHV/19KNTRGJY1Yf3FnEaGwAUodP8VuPD3Pgv8p2ABSh/5ErKQ sn/DgkfLZuK/bTaMfq1r9D9q2Uz8gAtp+SmDG0JdfnabrYAFXsFCVVECe3FG/p50OTcKudeSpix IKrj+WAXm5lRow2usNbpxzqF5nt2MscgpHKlmus5POVcu3a7GvH6JGGi6z+9uv0hg0P4lxeJ70b tgeOWRj0pZi/LOXcsmkXuHIX/n8v0JCA5oB6ztXIgOADD45/HglMT6wAkd0YD+N+c8yqWRDceW0 Ffn X-Google-Smtp-Source: AGHT+IFbMuCYRQqFyYc3iW2AQwZ3ygkAVP5hORsbEHKVe3DoFNpU5VkF5QR76ZXtOw48GVJBALlpkg== X-Received: by 2002:a05:600c:3556:b0:477:9fd6:7a53 with SMTP id 5b1f17b1804b1-47d84b04e1amr11902665e9.2.1767779501536; Wed, 07 Jan 2026 01:51:41 -0800 (PST) Received: from mordecai (dynamic-2a00-1028-83b8-1e7a-3010-3bd6-8521-caf1.ipv6.o2.cz. [2a00:1028:83b8:1e7a:3010:3bd6:8521:caf1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f703a8csm88569435e9.13.2026.01.07.01.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 01:51:41 -0800 (PST) Date: Wed, 7 Jan 2026 10:51:37 +0100 From: Petr Tesarik To: Steven Rostedt Cc: Masami Hiramatsu , Mathieu Desnoyers , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Subject: Re: [PATCH] ring-buffer: Use a housekeeping CPU to wake up waiters Message-ID: <20260107105137.4cf9a67e@mordecai> In-Reply-To: <20260107085009.58fcffd4@mordecai> References: <20260106091039.2012108-1-ptesarik@suse.com> <20260106170405.425f469e@gandalf.local.home> <20260107085009.58fcffd4@mordecai> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-suse-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 7 Jan 2026 08:50:09 +0100 Petr Tesarik wrote: > On Tue, 6 Jan 2026 17:04:05 -0500 > Steven Rostedt wrote: > > > On Tue, 6 Jan 2026 10:10:39 +0100 > > Petr Tesarik wrote: > > > > > Avoid running the wakeup irq_work on an isolated CPU. Since the wakeup can > > > run on any CPU, let's pick a housekeeping CPU to do the job. > > > > > > This change reduces additional noise when tracing isolated CPUs. For > > > example, the following ipi_send_cpu stack trace was captured with > > > nohz_full=2 on the isolated CPU: > > > > > > -0 [002] d.h4. 1255.379293: ipi_send_cpu: cpu=2 callsite=irq_work_queue+0x2d/0x50 callback=rb_wake_up_waiters+0x0/0x80 > > > -0 [002] d.h4. 1255.379329: > > > => trace_event_raw_event_ipi_send_cpu > > > => __irq_work_queue_local > > > => irq_work_queue > > > => ring_buffer_unlock_commit > > > => trace_buffer_unlock_commit_regs > > > => trace_event_buffer_commit > > > => trace_event_raw_event_x86_irq_vector > > > => __sysvec_apic_timer_interrupt > > > => sysvec_apic_timer_interrupt > > > => asm_sysvec_apic_timer_interrupt > > > => pv_native_safe_halt > > > => default_idle > > > => default_idle_call > > > => do_idle > > > => cpu_startup_entry > > > => start_secondary > > > => common_startup_64 > > > > I take it that even with this patch you would still get the above events. > > The only difference would be the "cpu=" in the event info will not be the > > same as the CPU it executed on, right? > > Yes, this is trace of a similar event after applying the patch: > > -0 [002] d.h4. 313.334367: ipi_send_cpu: cpu=1 callsite=irq_work_queue_on+0x55/0x90 callback=generic_smp_call_function_single_interrupt+0x0/0x20 > -0 [002] d.h4. 313.334390: > => trace_event_raw_event_ipi_send_cpu > => __smp_call_single_queue > => irq_work_queue_on > => ring_buffer_unlock_commit > => trace_buffer_unlock_commit_regs > => trace_event_buffer_commit > => trace_event_raw_event_x86_irq_vector > => __sysvec_apic_timer_interrupt > => sysvec_apic_timer_interrupt > => asm_sysvec_apic_timer_interrupt > => pv_native_safe_halt > => default_idle > => default_idle_call > => do_idle > => cpu_startup_entry > => start_secondary > => common_startup_64 > > The callback function in the trace event is different. That's because > send_call_function_single_ipi() always uses this value. Maybe it can be > improved, and I can look into it, but that's clearly a very separate > issue. Erm. It's actually good I had a look. :-( A helpful comment in irq_work_queue_on() explains that "arch remote IPI send/receive backend aren't NMI safe". That's something I wasn't aware of, and I'm afraid it's the end of story. The comment is followed by a WARN_ON_ONCE(in_nmi()), and I can easily trigger it with "perf top" while nmi:nmi_handler is traced. Please, remove the patch again. I'm sorry. Petr T