Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp382518pxt; Wed, 4 Aug 2021 13:48:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLbyIG0YXDCpYs4uFdDHNJ0UCg2d5G/UN2qLOfeS5WGcPoCRoZTn6ggXh6xhQJmGf+ONEO X-Received: by 2002:a5d:8596:: with SMTP id f22mr1028682ioj.147.1628110096920; Wed, 04 Aug 2021 13:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628110096; cv=none; d=google.com; s=arc-20160816; b=zqog/I1WuS9ZoOWtBWKNJUscmnirLBTyjxvq5tlHNyiYmqZULiTn6mBh9GTpiZMiHf q/97qNr4ySIQJlZamUO8py8C7usPsBy4vWIU3dwatLl7NAzDI9blfP8t1/udiLPB4xzf Kfn130aTWxvhGbgVoKmweJrBeXjQ8MePtatX4jwuJlQksJPR/a9nChhhZdTAiA98f0I9 axVqAyBikkElHHBn0XybpfkzYB1c4SOez99ZkQ141tfcDyKMbfbFr7FNRDQ9vtoP5FXT tD8m6DGj2tV9Lpd82gjGl8rTkLrQBFjzrDvGjwl7wB5eZi9vmw4rL5zkUOHJ1H6Gcfqy erYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date; bh=bEMH7UUsBEWnC7tIC/ZWbSYYqyd4PC4b7smcWR7z1ac=; b=g81spybIfB09PFCkJKMYJrGhv3t5LSDIaMC0hdf0VLNFW0o1f7hATVC4V3iBURw9pq sUTpCAX18u07lQzjgq6WM7tsCsG/uHv7Z7mi4vOB9oWfoALGgt+JAkXE7BzNLtM+QpBK xlzIU5f/gKJnae2SZl18Pdid0bKOuTMm+27/tkti/Bj033nmIq3RZlPBdt+96SBO/sHD 1iT1w0fEC4o6HbLZLIdwip+NqAgMSz73bElSK+ZT2I7xSEYBn9WCrimwiCe2Qp0dzSJ+ MCHepor38HELYZwHrWWkd5bNJoVoXx6qM7xx6YEF7j+MK/+coGuBeW6jNs8wNzkwVSdj U1IQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d187si3517506iog.56.2021.08.04.13.48.04; Wed, 04 Aug 2021 13:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236064AbhHDST2 (ORCPT + 99 others); Wed, 4 Aug 2021 14:19:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:52284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhHDSTI (ORCPT ); Wed, 4 Aug 2021 14:19:08 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 490FA60F58; Wed, 4 Aug 2021 18:18:55 +0000 (UTC) Date: Wed, 4 Aug 2021 14:18:48 -0400 From: Steven Rostedt To: LKML Cc: Ingo Molnar , Andrew Morton , Daniel Bristot de Oliveira Subject: [PATCH] tracing: Quiet smp_processor_id() use in preemptable warning in hwlat Message-ID: <20210804141848.79edadc0@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" The hardware latency detector (hwlat) has a mode that it runs one thread across CPUs. The logic to move from the currently running CPU to the next one in the list does a smp_processor_id() to find where it currently is. Unfortunately, it's done with preemption enabled, and this triggers a warning for using smp_processor_id() in a preempt enabled section. As it is only using smp_processor_id() to get information on where it currently is in order to simply move it to the next CPU, it doesn't really care if it got moved in the mean time. It will simply balance out later if such a case arises. Switch smp_processor_id() to raw_smp_processor_id() to quiet that warning. Fixes: 8fa826b7344d ("trace/hwlat: Implement the mode config option") Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/trace_hwlat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c index a6c0cdaf4b87..14f46aae1981 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -327,7 +327,7 @@ static void move_to_next_cpu(void) get_online_cpus(); cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask); - next_cpu = cpumask_next(smp_processor_id(), current_mask); + next_cpu = cpumask_next(raw_smp_processor_id(), current_mask); put_online_cpus(); if (next_cpu >= nr_cpu_ids) -- 2.31.1