linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YhLu <YhLu@tyan.com>
To: Andi Kleen <ak@muc.de>, Matt Domsch <Matt_Domsch@dell.com>
Cc: linux-kernel@vger.kernel.org, discuss@x86-64.org
Subject: RE: 256 apic id for amd64
Date: Thu, 6 Jan 2005 18:53:11 -0800	[thread overview]
Message-ID: <3174569B9743D511922F00A0C9431423072912FA@TYANWEB> (raw)

static unsigned int phys_pkg_id(int index_msb)
{
        return hard_smp_processor_id() >> index_msb;
}

In arch/x86_64/kernel/genapic_cluster.c

Should be changed to 

static unsigned int phys_pkg_id(int index_msb)
{
        /* physical apicid, so we need to substract offset */
        return (hard_smp_processor_id() - boot_cpu_id) >> index_msb;
}

-----Original Message-----
From: YhLu 
Sent: Thursday, January 06, 2005 5:07 PM
To: Andi Kleen; Matt Domsch
Cc: linux-kernel@vger.kernel.org; discuss@x86-64.org
Subject: RE: 256 apic id for amd64

Andi,

I made the Opteron using apic id from 16 later in LinuxBIOS.

So leave 0-15 for ioapic.

The problem is that the kernel (caliberate_delay) doesn't like that.

If using lpj=2170880 as the command line for that, it works well.

What's the jiffies? The TSC is changing but it doesn't.

YH

Without offset:
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Memory: 1019456k/1048576k available (3011k kernel code, 0k reserved, 1310k
data, 544k init)
LYH calibrating 0 jiffies = 4294667563, now=2922366256
LYH calibrating 1 jiffies = 4294667568, now=2934372713
LYH calibrating 3 jiffies = 4294667600, now=3003581909
4341.76 BogoMIPS (lpj=2170880)
Mount-cache hash table entries: 256 (order: 0, 4096 bytes)
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 0 -> Node 0
CPU: Physical Processor ID: 0

With apic id offset:
Console: colour dummy device 80x25
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Memory: 1019456k/1048576k available (3011k kernel code, 0k reserved, 1310k
data, 544k init)
LYH calibrating 0 jiffies = 4294667296, now=1383947209
LYH calibrating 1 jiffies = 4294667296, now=1395952717


Please refer the print in init/main.c

void __devinit calibrate_delay(void)
{
        unsigned long ticks, loopbit;
        int lps_precision = LPS_PREC;
 +       unsigned long now;
 +
 +       rdtscl(now);
 +
 +        printk("LYH calibrating 0 jiffies = %lu, now=%lu\r\n", jiffies,
now);


        if (preset_lpj) {
                loops_per_jiffy = preset_lpj;
                printk("Calibrating delay loop (skipped)... "
                        "%lu.%02lu BogoMIPS preset\n",
                        loops_per_jiffy/(500000/HZ),
                        (loops_per_jiffy/(5000/HZ)) % 100);
        } else {
                loops_per_jiffy = (1<<12);

 +               rdtscl(now);
 +               printk("LYH calibrating 1 jiffies = %lu, now=%lu\r\n",
jiffies, now);
                printk(KERN_DEBUG "Calibrating delay loop... ");
                while ((loops_per_jiffy <<= 1) != 0) {
                        /* wait for "start of" clock tick */
                        ticks = jiffies;
                        while (ticks == jiffies)
                                /* nothing */;
                        /* Go .. */
                        ticks = jiffies;
                        __delay(loops_per_jiffy);
                        ticks = jiffies - ticks;
                        if (ticks)
                                break;
                }

                /*
                 * Do a binary approximation to get loops_per_jiffy set to
                 * equal one clock (up to lps_precision bits)
                 */
  +              rdtscl(now);
  +              printk("LYH calibrating 2 jiffies = %lu, now=%lu\r\n",
jiffies, now);

                loops_per_jiffy >>= 1;
                loopbit = loops_per_jiffy;
                while (lps_precision-- && (loopbit >>= 1)) {
                        loops_per_jiffy |= loopbit;
                        ticks = jiffies;
                       while (ticks == jiffies)
                                /* nothing */;
                        ticks = jiffies;
                        __delay(loops_per_jiffy);
                        if (jiffies != ticks)   /* longer than 1 tick */
                                loops_per_jiffy &= ~loopbit;
                }

  +              rdtscl(now);
  +              printk("LYH calibrating 3 jiffies = %lu, now=%lu\r\n",
jiffies, now);

                /* Round the value and print it */
                printk("%lu.%02lu BogoMIPS (lpj=%lu)\n",
                        loops_per_jiffy/(500000/HZ),
                        (loops_per_jiffy/(5000/HZ)) % 100,
                        loops_per_jiffy);
        }

}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

             reply	other threads:[~2005-01-07  2:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07  2:53 YhLu [this message]
2005-01-07 12:24 ` 256 apic id for amd64 Andi Kleen
2005-01-08  1:30   ` James Cleverdon
  -- strict thread matches above, loose matches on Subject: below --
2005-01-11 19:11 YhLu
2005-01-11 19:04 YhLu
2005-01-10 20:48 YhLu
2005-01-10 20:46 YhLu
2005-01-11  5:36 ` Andi Kleen
2005-01-10 20:37 YhLu
2005-01-10 20:09 YhLu
2005-01-10 20:18 ` Andi Kleen
2005-01-10 19:41 YhLu
2005-01-10 19:43 ` Andi Kleen
2005-01-11  0:42 ` James Cleverdon
2005-01-11  3:28   ` Siddha, Suresh B
2005-01-11  4:42     ` Andi Kleen
2005-01-10 18:48 YhLu
2005-01-10 18:45 ` Andi Kleen
2005-01-10 18:44 Andi Kleen
2005-01-11  4:04 ` Siddha, Suresh B
2005-01-11  4:39   ` Andi Kleen
2005-01-11 17:50   ` Andi Kleen
2005-01-08  2:53 YhLu
2005-01-09 23:56 ` James Cleverdon
2005-01-08  2:37 Mikael Pettersson
2005-01-08 15:46 ` Andi Kleen
2005-01-08  1:50 YhLu
2005-01-08  0:50 YhLu
2005-01-08  0:42 ` Andi Kleen
2005-01-08  0:28 YhLu
2005-01-08  0:26 ` James Cleverdon
2005-01-08  0:34   ` Andi Kleen
2005-01-08  0:04 YhLu
2005-01-08  0:12 ` James Cleverdon
2005-01-07 21:44 YhLu
2005-01-07 22:18 ` Andi Kleen
2005-01-07 21:14 YhLu
2005-01-07 21:12 ` Andi Kleen
2005-01-07 19:43 YhLu
2005-01-07 19:40 ` Andi Kleen
2005-01-07 18:27 YhLu
2005-01-07 19:29 ` Andi Kleen
2005-01-07 18:19 YhLu
2005-01-07 19:29 ` Andi Kleen
2005-01-07  1:06 YhLu
2005-01-07 12:44 ` Andi Kleen
2004-12-30 23:19 YhLu
2004-12-30 23:16 YhLu
2004-12-29  4:43 YhLu
2004-12-30 18:45 ` Andi Kleen
2004-12-30 22:56   ` Matt Domsch
2004-12-30 23:26     ` Andi Kleen

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=3174569B9743D511922F00A0C9431423072912FA@TYANWEB \
    --to=yhlu@tyan.com \
    --cc=Matt_Domsch@dell.com \
    --cc=ak@muc.de \
    --cc=discuss@x86-64.org \
    --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).