linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Ravikiran G Thirumalai <kiran@in.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] Make prof_counter use per-cpu areas patch 1/4 -- x86 arch
Date: Thu, 16 Jan 2003 12:18:37 -0800	[thread overview]
Message-ID: <20030116121837.19846346.akpm@digeo.com> (raw)
In-Reply-To: <20030116120608.GD13013@in.ibm.com>

Ravikiran G Thirumalai <kiran@in.ibm.com> wrote:
>
> Even cpu_possible does not seem to be setup this early.  Seems like 
> reinitialisation of prof_counter/prof_multiplier et al is redundant.
> Here's a newer patch which removes this initialisation at smp_boot_cpus.
> Works fine for me (tested same on a 4 way with difft profiling multipliers..
> LOC interrupts seem to fire at the right intervals).

Things still look a bit fishy to me.

In apic.c:

	int prof_multiplier[NR_CPUS] = { 1, };
	int prof_old_multiplier[NR_CPUS] = { 1, };
	DEFINE_PER_CPU(int, prof_counter) = 1;

This means that all the prof_counter values are set to 1, but the multiplier
arrays have 1 in the zeroeth entry, and zero in the remaining entries.

The zero multipliers remain in place until someone runs
setup_profiling_timer().

One approach would be to initialise all members:

	int prof_multiplier[NR_CPUS] = { [ 0 ... NR_CPUS-1 ] = 1 };

But I think it would be better to put the multipliers into per-cpu memory as
well.  Something like:

struct profiling_info {
	int multiplier;
	int old_multiplier;
	int counter;
};

DEFINE_PER_CPU(struct profiling_info, profiling_info) = {1, 1, 1};

Perhaps?

Also bits and pieces of the profiling code seem to be randomly splattered all
over the place.  Consolidating it all into the one .c file would be nice.



      reply	other threads:[~2003-01-16 20:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-13 12:28 [patch] Make prof_counter use per-cpu areas patch 1/4 -- x86 arch Ravikiran G Thirumalai
2003-01-13 12:33 ` [patch] Make prof_counter use per-cpu areas patch 2/4 -- ppc arch Ravikiran G Thirumalai
2003-01-14  2:21   ` Paul Mackerras
2003-01-13 12:36 ` [patch] Make prof_counter use per-cpu areas patch 3/4 -- x86_64 arch Ravikiran G Thirumalai
     [not found]   ` <20030113152110.GA19931@wotan.suse.de>
2003-01-16 12:17     ` Ravikiran G Thirumalai
2003-01-13 12:38 ` [patch] Make prof_counter use per-cpu areas patch 4/4 -- sparc arch Ravikiran G Thirumalai
2003-01-13 16:49   ` Pete Zaitcev
2003-01-14 11:46     ` David S. Miller
2003-01-13 20:10 ` [patch] Make prof_counter use per-cpu areas patch 1/4 -- x86 arch Andrew Morton
2003-01-16 12:06   ` Ravikiran G Thirumalai
2003-01-16 20:18     ` Andrew Morton [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=20030116121837.19846346.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=kiran@in.ibm.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;
as well as URLs for NNTP newsgroup(s).