[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190409020247.GA7008@ranerica-svr.sc.intel.com>
Date: Mon, 8 Apr 2019 19:02:47 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...e.de>,
Ashok Raj <ashok.raj@...el.com>,
Andi Kleen <andi.kleen@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org,
Ricardo Neri <ricardo.neri@...el.com>,
"H. Peter Anvin" <hpa@...or.com>, Tony Luck <tony.luck@...el.com>,
Clemens Ladisch <clemens@...isch.de>,
Arnd Bergmann <arnd@...db.de>,
Philippe Ombredanne <pombredanne@...b.com>,
Kate Stewart <kstewart@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Mimi Zohar <zohar@...ux.ibm.com>,
Jan Kiszka <jan.kiszka@...mens.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Nayna Jain <nayna@...ux.ibm.com>
Subject: Re: [RFC PATCH v2 12/14] x86/watchdog/hardlockup/hpet: Determine if
HPET timer caused NMI
On Tue, Mar 26, 2019 at 09:55:35PM +0100, Thomas Gleixner wrote:
> On Wed, 27 Feb 2019, Ricardo Neri wrote:
> > @@ -62,7 +67,18 @@ static inline void set_comparator(struct hpet_hld_data *hdata,
> > static void kick_timer(struct hpet_hld_data *hdata, bool force)
> > {
> > bool kick_needed = force || !(hdata->flags & HPET_DEV_PERI_CAP);
> > - unsigned long new_compare, count;
> > + unsigned long tsc_curr, tsc_delta, new_compare, count;
> > +
> > + /* Start obtaining the current TSC and HPET counts. */
> > + tsc_curr = rdtsc();
> > +
> > + if (kick_needed)
> > + count = get_count();
>
> Can you please keep the TSC code in one block and the HPET block in the
> next one? Having this inbetween is really bad to follow.
>
> It really does not matter whether you read the HPET counter before or after
> the calculation. This is a crystal ball estimation anyway so a few cyles
> more or less are completely irrelevant.
Sure! I will implement this change.
Thanks and BR,
Ricardo
>
> > + tsc_delta = (unsigned long)watchdog_thresh * (unsigned long)tsc_khz
> > + * 1000L;
> > + hdata->tsc_next = tsc_curr + tsc_delta;
> > + hdata->tsc_next_error = tsc_delta >> 6;
>
> Thanks,
>
> tglx
Powered by blists - more mailing lists