public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: "Dmitriy Zavin" <dmitriyz@google.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH] x86_64/i386: Rework thermal throttling detection/handling code for Intel P4/Xeons.
Date: Tue, 19 Sep 2006 08:11:16 +0200	[thread overview]
Message-ID: <200609190811.16649.ak@suse.de> (raw)
In-Reply-To: <404ea8000609181521g4d5f2c1aq41d49b9941ea188@mail.google.com>

On Tuesday 19 September 2006 00:21, Dmitriy Zavin wrote:
> > > Each cpu can throttle at different times and have different counts, so
> >
> > The counts should be per CPU, but everything else (timestamp, enabled)
> > etc. can be just global.  You just don't want the logs flooded with events,
> > but if the rate limiting is global or local doesn't make much difference
> > That would give much simpler code and I believe
> > is sufficient for basically everybody
> 
> This will make you skip logging events for other CPUs once one has
> throttled, which is important to me. In that case, one has to rely on
> just the counts.

Ok if you want complex features like this you'll have to get rid
of some other code in your patch. 

One possibility is to keep only some state per CPU,
but do the sys configuration globally, but that's probably not 
enough.

Currently the bloat:feature ratio is imho not good enough at least.

> > Currently your patch is a bit too large for the relatively simple things
> > it tries to attempt, so such ways to simplify it and slim it down are needed.
> > If you have other ideas to make it simpler that would be appreciated too.
> 
> You are right, it was my newbie mistake. I am splitting it up into
> logical, smaller chunks that are easier to review.

It's not just smaller chunks, the end result should be simple too


> > We have a 64bit jiffies for that now on 32bit too.
> 
> The problem with using jiffies_64 is that the time_before/time_after
> macros in linux/jiffies.h always typecast to "long" which is not 64
> bits on 32bit systems. So it will get truncated, and behave as 32bits
> and won't solve the problem

Then please submit a separate patch to add time_before/after64 instead of trying
to work around that.
 
> > > > Instead of having this evinfo structure you could just directly
> > > > fill in struct mces in the caller.
> > >
> > > But the caller won't know what to fill the struct mce with since this
> > > function does the logic of figuring out the thermal event info. I
> > > can't have this function take "struct mce *" since that doesn't exist
> > > on i386. I could have it accept pointers to values as arguments, but
> > > that's messy.
> >
> > Then either define struct mce for i386 or use two different functions
> > for i386/x86-64.
> 
> I'll add a patch to pull out mcelog related stuff into mce_log.c, and
> share that between i386/x86_64. Put mcelog.c to
> arch/i386/kernel/cpu/mcheck

Please keep it in x86-64.

> , and have x86_64 just compile that in 
> directly. Does that sound like a workable solution? There's no need to 
> maintain identical code in 2 places.

It depends on how ugly that patch is. Unification is fine as long
as it improves something, but if it requires weird hacks again it's a net loss.

-Andi

  reply	other threads:[~2006-09-19  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-15  0:42 [PATCH] x86_64/i386: Rework thermal throttling detection/handling code for Intel P4/Xeons Dima Zavin
2006-09-15  6:59 ` Andi Kleen
2006-09-15 20:33   ` Dmitriy Zavin
2006-09-16  4:34     ` Andi Kleen
2006-09-18 22:21       ` Dmitriy Zavin
2006-09-19  6:11         ` Andi Kleen [this message]
2006-09-19 21:14           ` Dmitriy Zavin

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=200609190811.16649.ak@suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=dmitriyz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox