From: kernel test robot <lkp@intel.com>
To: Haofeng Li <920484857@qq.com>, John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Stephen Boyd <sboyd@kernel.org>, Haofeng Li <13266079573@163.com>
Subject: Re: [PATCH] timekeeping: Move debug sleep time accounting outside spinlock
Date: Wed, 10 Sep 2025 11:12:37 +0800 [thread overview]
Message-ID: <202509101047.oTfSjXyE-lkp@intel.com> (raw)
In-Reply-To: <tencent_6FBD7FB2B5EDA57B1481766C52482D033008@qq.com>
Hi Haofeng,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/timers/core]
[also build test WARNING on linus/master v6.17-rc5 next-20250909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Haofeng-Li/timekeeping-Move-debug-sleep-time-accounting-outside-spinlock/20250909-183705
base: tip/timers/core
patch link: https://lore.kernel.org/r/tencent_6FBD7FB2B5EDA57B1481766C52482D033008%40qq.com
patch subject: [PATCH] timekeeping: Move debug sleep time accounting outside spinlock
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20250910/202509101047.oTfSjXyE-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250910/202509101047.oTfSjXyE-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509101047.oTfSjXyE-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/time/timekeeping.c: In function 'timekeeping_resume':
>> kernel/time/timekeeping.c:1986:55: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1986 | tk_debug_account_sleep_time(&ts_delta);
| ^
vim +/if +1986 kernel/time/timekeeping.c
1929
1930 /**
1931 * timekeeping_resume - Resumes the generic timekeeping subsystem.
1932 */
1933 void timekeeping_resume(void)
1934 {
1935 struct timekeeper *tks = &tk_core.shadow_timekeeper;
1936 struct clocksource *clock = tks->tkr_mono.clock;
1937 struct timespec64 ts_new, ts_delta;
1938 bool inject_sleeptime = false;
1939 u64 cycle_now, nsec;
1940 unsigned long flags;
1941
1942 read_persistent_clock64(&ts_new);
1943
1944 clockevents_resume();
1945 clocksource_resume();
1946
1947 raw_spin_lock_irqsave(&tk_core.lock, flags);
1948
1949 /*
1950 * After system resumes, we need to calculate the suspended time and
1951 * compensate it for the OS time. There are 3 sources that could be
1952 * used: Nonstop clocksource during suspend, persistent clock and rtc
1953 * device.
1954 *
1955 * One specific platform may have 1 or 2 or all of them, and the
1956 * preference will be:
1957 * suspend-nonstop clocksource -> persistent clock -> rtc
1958 * The less preferred source will only be tried if there is no better
1959 * usable source. The rtc part is handled separately in rtc core code.
1960 */
1961 cycle_now = tk_clock_read(&tks->tkr_mono);
1962 nsec = clocksource_stop_suspend_timing(clock, cycle_now);
1963 if (nsec > 0) {
1964 ts_delta = ns_to_timespec64(nsec);
1965 inject_sleeptime = true;
1966 } else if (timespec64_compare(&ts_new, &timekeeping_suspend_time) > 0) {
1967 ts_delta = timespec64_sub(ts_new, timekeeping_suspend_time);
1968 inject_sleeptime = true;
1969 }
1970
1971 if (inject_sleeptime) {
1972 suspend_timing_needed = false;
1973 __timekeeping_inject_sleeptime(tks, &ts_delta);
1974 }
1975
1976 /* Re-base the last cycle value */
1977 tks->tkr_mono.cycle_last = cycle_now;
1978 tks->tkr_raw.cycle_last = cycle_now;
1979
1980 tks->ntp_error = 0;
1981 timekeeping_suspended = 0;
1982 timekeeping_update_from_shadow(&tk_core, TK_CLOCK_WAS_SET);
1983 raw_spin_unlock_irqrestore(&tk_core.lock, flags);
1984
1985 if (inject_sleeptime && timespec64_valid_strict(&ts_delta))
> 1986 tk_debug_account_sleep_time(&ts_delta);
1987
1988 /* Resume the clockevent device(s) and hrtimers */
1989 tick_resume();
1990 /* Notify timerfd as resume is equivalent to clock_was_set() */
1991 timerfd_resume();
1992 }
1993
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-09-10 3:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 10:23 [PATCH] timekeeping: Move debug sleep time accounting outside spinlock Haofeng Li
2025-09-09 11:42 ` Thomas Gleixner
2025-09-09 11:46 ` Thomas Gleixner
2025-09-12 10:33 ` [PATCH WITHDRAWN] " Haofeng Li
2025-09-10 3:12 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202509101047.oTfSjXyE-lkp@intel.com \
--to=lkp@intel.com \
--cc=13266079573@163.com \
--cc=920484857@qq.com \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.