Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp506540lqb; Thu, 14 Mar 2024 19:21:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMcnvMJspJ8Nu4xL5VxvUedt/0y73Aq+4SqKksqUzu7ymGgg3JKqEjzM/JXofftGDizJjdcMYF5m7Nm1a1jwHzR3BP34x6+5bB6XvqKg== X-Google-Smtp-Source: AGHT+IEKvGxeuHBjHZJ3n99wdr0OBCFE/TpsZSUUypkgnqYph125b6y0trlvsjg2l6VM8e8VzYEE X-Received: by 2002:ae9:e40b:0:b0:789:e2c1:40ac with SMTP id q11-20020ae9e40b000000b00789e2c140acmr1262589qkc.11.1710469267652; Thu, 14 Mar 2024 19:21:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710469267; cv=pass; d=google.com; s=arc-20160816; b=0AOUzL1BdBcj913400FnSkwS0ihGh14ykTgx+q4jEsdGmbiLD1WB418i3gieORTkXy J0Z7g3WjJ6qZXoOMSjuaNeWNeMQQZGLeZACQ6uv4JMWw/hkUlG0dpms+5rvBFAcFqcEt uXLyDcpsJQQfqTJQ5TjvAEaUu2GU8+sEE91Elj4LoclCyEXZj2fqp7vmcjFz11QN+370 KanRn6tx6N+/EZLT1JpDavS3LFUSatSG648SrULTRvXhs4L/pBhkCiEJuWO3qhKZzX+n v2P5FIvodREjXSsN/7gw8kqQ4LkYv9JwhGcWkukD/p3ETIDlAzjIZdbgMmdf6/ORmBlL 04Zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=IKd+qVzPekK4mMOT4fBjyBHRZnbYGLNCRm2s7GZrCu4=; fh=oE67OjXkWtngyWNkOVAqyl7lXTfATcfLd6MbZqfkHao=; b=znBqYVXLp5XQQwhDG7TnBcuh+a+wRDhZAKHNu+gk73CcGuH3KXluMJoiZAh9ZoHeT0 edmp4esw9j25rSjkf/S9rqM3opvP8OK9eNFesiRXqUFQw3aSQ0Cv31U5Vni5gU7U4zRs zAxsy0YmKQAVoSiChvFRsPte6gCzyC2AX81AijSHiS5N1fHnHJ5GIiatpx8hvavcGJpF QDbJ6NmBXWEAncZX84uJztb/dTnAvHwFvRqghOdkczIQqmpy+/1ljfAHmNy4HvZEeP1w 4X/Q1h6S4yqFz6agv/S5qEWtcBlcsDroTVp+0Dw9J6a7rFoVvNz4JKOQ15tNSmq98KsT 6SyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TzS9hYmU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d4-20020a05620a204400b00789cfd1269bsi2828631qka.37.2024.03.14.19.21.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 19:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103984-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=@gmail.com header.s=20230601 header.b=TzS9hYmU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 538A31C20DF4 for ; Fri, 15 Mar 2024 02:21:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A14BC6FDC; Fri, 15 Mar 2024 02:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TzS9hYmU" Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 ED6A5323D; Fri, 15 Mar 2024 02:20:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710469259; cv=none; b=QthW/83icp6118QcYkCPMS2KFNpzbTV9oj6ck5l3iSAgD/DoeusPZQ6J4CPyOKhwx4CQ9fkNye7FfoqepBm51SiY66HbSuXW20LEfU6tqS8xj5YJ9zll1Ho6q1bCeBrkqCvZ+ZAKRjFYlzX0N/IjNucnncubWeoJW9KwXbN/lOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710469259; c=relaxed/simple; bh=fFwQIlb443EC36sVLwuFb4dzf0Dss+9EewZgyVbxvSY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=l8U3K2u4+Ll57/kirI+OyoHepAd7GBvQfahIB3ff8C5muhk+/SI1HouOQ5MDyHaURi5Yt6xg37Wxwc+u7V/6Mip6FV/5cFPJ83iTg7GSJ4ccWyCVZ5yyHLwOCLtucCDJrMLP29+pDw0vln2sZgYF+V7gVhZq4eHm8/sqFH+avn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TzS9hYmU; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-513d3746950so1490803e87.1; Thu, 14 Mar 2024 19:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710469256; x=1711074056; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IKd+qVzPekK4mMOT4fBjyBHRZnbYGLNCRm2s7GZrCu4=; b=TzS9hYmUkGQFR25ZLGTHKG+0jEMtZi3o1NlKV1qqHElrw8KvCF5LO9ylXcsRsEuxkw Llh6CURnLt2xX+KcvUnYpTzLsI06mEp42xRQjGULKPNU57PO8zmCgF+z3Kkc7O4luDOi AaAOcbgo0bHPqaZSGAPp6BTdA7K3vEFauDXGaholbq/niAlUL2VsdxZk9fvFKn9V6/d+ RP4b99r5PN8wGVKbUrjp6GPTlDI3xBxsSuoDfsRobf4ie+GE3ZSDqYZ+57TrgCrIJlvY /oTHD6anXeVkciSpE0ahIVfhu7wToQM5gtKtCiWcRtdKOzKVH23y52xwtn/oLrqwSr29 Lo/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710469256; x=1711074056; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IKd+qVzPekK4mMOT4fBjyBHRZnbYGLNCRm2s7GZrCu4=; b=mlauxnKeSz1JqntztqOOM2Q7GTju4BeuxFIAzqV8tR/eXg8pCjZvbNhEDKXMuhlOGu k2SRaN1yNFR/watSzSgJp1oxogd+Ijzp09wckQjfoEd3j22kyM4Rf2vxw4A0cD4z/1kJ 26a3iobgAS+b1DrZ4HuVeVRJ3m8aAvpLbLc57QKzeglvsGd0NS4tb4IbPWTgcQggn2PR jEmH8xSU33tpiQm9SKgDgfBsxbbjauuwVCYrIqTzmhSlyqgRNq2frjdlmXWTKepf/5d8 enzcY5DMZIHpDcdKNAB49l9cB0ZCVoLNxtUD7Hzowe2g9pCy6UJcxuq/eIHJwbp37OlS HKjg== X-Forwarded-Encrypted: i=1; AJvYcCWDJPgf0BqznOUeSbGCa0GgaFO4+9j9GwtTOPN1kyePJaNAMtrLqV0z0LDmQQDRakpvnMj2mBj04nValc7h7iMsX47xpwG3nesV6Ek3YfhpeajtBU3mrZDIqqE+8KC4GinPzOCZsZppUpatBS0Q X-Gm-Message-State: AOJu0YzUZQRXP0sMN+VUN2Ew7VCfeb6f3aFO65r1Rl4TnlKQWXDqWUiJ VyzeSWh3/g6jwR4EWe72Zd0sONpS2vYw0gIkRwRgWRtODKW0c/YhlNXwhfgqol89OWnygNdGU5U gLN+or4XJTXTtfL74aCzM+DFjFUQ= X-Received: by 2002:ac2:5bcd:0:b0:513:b90f:f4dd with SMTP id u13-20020ac25bcd000000b00513b90ff4ddmr1307617lfn.49.1710469255711; Thu, 14 Mar 2024 19:20:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <87cyrxm7ua.ffs@tglx> <877ci5m3c4.ffs@tglx> In-Reply-To: From: Enlin Mu Date: Fri, 15 Mar 2024 10:20:29 +0800 Message-ID: Subject: Re: [PATCH] hrtimer:Add get_hrtimer_cpu_base() To: Thomas Gleixner Cc: Enlin Mu , linux-kernel@vger.kernel.org, enlin.mu@unisoc.com, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Enlin Mu =E4=BA=8E2024=E5=B9=B43=E6=9C=8815=E6=97=A5=E5= =91=A8=E4=BA=94 10:07=E5=86=99=E9=81=93=EF=BC=9A > > Thomas Gleixner =E4=BA=8E2024=E5=B9=B43=E6=9C=8814= =E6=97=A5=E5=91=A8=E5=9B=9B 19:59=E5=86=99=E9=81=93=EF=BC=9A > > > > On Thu, Mar 14 2024 at 18:45, Enlin Mu wrote: > > > Thomas Gleixner =E4=BA=8E2024=E5=B9=B43=E6=9C=88= 14=E6=97=A5=E5=91=A8=E5=9B=9B 18:22=E5=86=99=E9=81=93=EF=BC=9A > > >> > > >> On Wed, Mar 13 2024 at 05:30, Enlin Mu wrote: > > >> > From: Enlin Mu > > >> > > > >> > On the Arm platform,arch_timer may occur irq strom, > > >> > By using the next_timer of hrtimer_cpu_base, it is > > >> > possible to quickly locate abnormal timers. > > >> > As it is an out of tree modules,the function needs > > >> > to be exproted. > > >> > > >> No. We are not exporting for out of tree code. > > > Can you explain it? > > > > Exporting functions or variables requires an in tree usecase. > > > Thands, I got it. > > If patch is following: > --- > include/linux/hrtimer.h | 1 + > kernel/time/hrtimer.c | 1 + > kernel/time/tick-internal.h | 1 - > kernel/time/timer_list.c | 1 + > 4 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h > index 2a37d2a8e808..a0eaed4a3edc 100644 > --- a/include/linux/hrtimer.h > +++ b/include/linux/hrtimer.h > @@ -278,6 +278,7 @@ static inline void hrtimer_start(struct hrtimer > *timer, ktime_t tim, > extern int hrtimer_cancel(struct hrtimer *timer); > extern int hrtimer_try_to_cancel(struct hrtimer *timer); > extern struct hrtimer_cpu_base *get_hrtimer_cpu_base(int cpu); > +DECLARE_PER_CPU(struct tick_device, tick_cpu_device); > > static inline void hrtimer_start_expires(struct hrtimer *timer, > enum hrtimer_mode mode) > diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c > index f7cf7d48b91d..49024d07c61b 100644 > --- a/kernel/time/hrtimer.c > +++ b/kernel/time/hrtimer.c > @@ -113,6 +113,7 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases= ) =3D > }, > } > }; > +EXPORT_PER_CPU_SYMBOL(hrtimer_bases); > > static const int hrtimer_clock_to_base_table[MAX_CLOCKS] =3D { > /* Make sure we catch unsupported clockids */ > diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h > index 5f2105e637bd..96df7d21506c 100644 > --- a/kernel/time/tick-internal.h > +++ b/kernel/time/tick-internal.h > @@ -18,7 +18,6 @@ struct timer_events { > # define TICK_DO_TIMER_NONE -1 > # define TICK_DO_TIMER_BOOT -2 > > -DECLARE_PER_CPU(struct tick_device, tick_cpu_device); > extern ktime_t tick_next_period; > extern int tick_do_timer_cpu __read_mostly; > > diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c > index 1c311c46da50..b6fee42e3861 100644 > --- a/kernel/time/timer_list.c > +++ b/kernel/time/timer_list.c > @@ -16,6 +16,7 @@ > #include > > #include "tick-internal.h" > +#include > > struct timer_list_iter { > int cpu; > -- > > please review and comment. > > Thanks Hi Thomas Sorry, I made a mistake Please ignore this comment