Skip to contentSkip to conversation

must fix lists

RFC In review Nick Piggin 9 participants 19 messages Oct 21, 2003 – Nov 4, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 must fix lists

The following people have their names in Documentation/must-fix.txt. Lots of others in should-fix.txt in 2.6.0-test8-mm1. Please review your entries. Also, please add any other substantial changes you need before 2.6. Thanks.

Al Viro
Alan
Albert Cahalan
Andi
Badari Pulavarty
brodo
Dave M
Dipankar
hch
hollisb
Ingo
James B
Jens
lmb
Mike Anderson
Patrick Mansfield
rmk
Rusty
Trond

(Maybe missed a couple)

 linux-2.6-npiggin/Documentation/must-fix.txt   |   44 -------------------------
 linux-2.6-npiggin/Documentation/should-fix.txt |   20 -----------
 2 files changed, 64 deletions(-)
Documentation/must-fix.txt renamed from Documentation/must-fix.txt~mustfix +0 -44
diff -puN Documentation/must-fix.txt~mustfix Documentation/must-fix.txt
@@ -13,17 +13,9 @@ o TTY locking is broken.
 
   o somebody will have to document the tty driver and ldisc API
 
-o Lack of test cases and/or stress tests is a problem.  Contributions and
-  suggestions are sought.
-
-o Lots of drivers are using cli/sti and are broken.
-
 drivers/tty
 ~~~~~~~~~~~
 
-o viro: we need to fix refcounting for tty_driver (oopsable race, must fix
-  anyway, hopefully about a week until it's merged) then we can do
-  tty/misc/upper levels of sound.
 
 drivers/block/
 ~~~~~~~~~~~~~~
@@ -33,16 +25,6 @@ o ideraid hasn't been ported to 2.5 at a
   We need to understand whether the proposed BIO split code will suffice
   for this.
 
-o CD burning.  There are still a few quirks to solve wrt SG_IO and ide-cd.
-
-  Jens: The basic hang has been solved (double fault in ide-cd), there still
-  seems to be some cases that don't work too well.  Don't really have a
-  handle on those :/
-
-o lmb: Last time I looked at the multipath code (2.5.50 or so) it also
-  looked pretty broken; I plan to port forward the changes we did on 2.4
-  before KS.
-
 drivers/input/
 ~~~~~~~~~~~~~~
 
@@ -55,20 +37,6 @@ o viro: parport is nearly as bad as that
   IMO parport is more of "figure out what API changes are needed for its
   users, get them done ASAP, then fix generic layer at leisure"
 
-o (Albert Cahalan) Lots of people (check Google) get this message from the
-  kernel:
-
-  psmouse.c: Lost synchronization, throwing 2 bytes away.
-
-  (the number of bytes will be 1, 2, or 3)
-
-  At work, I get it when there is heavy NFS traffic.  The mouse goes crazy,
-  jumping around and doing random cut-and-paste all over everything.  This
-  is with a decently fast and modern PC.
-
-o There seem to be too many reports of keyboards and mice failing or acting
-  strangely.
-
 
 drivers/misc/
 ~~~~~~~~~~~~~
@@ -84,14 +52,6 @@ o viro: actually, misc.c has a good chan
 drivers/net/
 ~~~~~~~~~~~~
 
-o rmk: network drivers.  ARM people like to add tonnes of #ifdefs into
-  these to customise them to their hardware platform (eg, chip access
-  methods, addresses, etc.) I cope with this by not integrating them into my
-  tree.  The result is that many ARM platforms can't be built from even my
-  tree without extra patches.  This isn't sane, and has bred a culture of
-  network drivers not being submitted.  I don't see this changing for 2.6
-  though.
-
 drivers/net/irda/
 ~~~~~~~~~~~~~~~~~
 
@@ -348,7 +308,3 @@ o A couple of hundred real looking bugzi
 o viro: cdev rework.  Main group is pretty stable and I hope to feed it to
   Linus RSN.  That's cdev-cidr and ->i_cdev/->i_cindex stuff
 
-o Athlon prefetch oopses sometimes.  It is currently disabled, and needs to
-  be fixed.
-
-
Documentation/should-fix.txt renamed from Documentation/should-fix.txt~mustfix +0 -20
diff -puN Documentation/should-fix.txt~mustfix Documentation/should-fix.txt
@@ -10,12 +10,6 @@ PRI3:	Not very important
 drivers/block/
 ~~~~~~~~~~~~~~
 
-o Framework for selecting IO schedulers.  This is the main one really. 
-  Once this is in place we can drop in new schedulers any old time, no risk.
-  Nick Piggin has code for this.
-
-  PRI1
-
 o viro: paride drivers need a big cleanup
 
   PRI2
@@ -145,13 +139,6 @@ o (Trond:) Yes: I'm still working on an 
 
    PRI2 (?)
 
-o (Chuck Lever <[email protected]>): NFS O_DIRECT support must be
-  completed.  The best approach is to fall back to something like the 2.4 NFS
-  O_DIRECT support, which issues RPCs synchronously and uses the RPC
-  completion mechanism to wait for I/O completion.
-
-  PRI2
-
 o viro: cleaning up options-parsers in filesystems.  (patch exists, needs
   porting).
 
@@ -200,9 +187,6 @@ o klibc merge?
 mm/
 ~~~
 
-o objrmap: concerns over page reclaim performance at high sharing levels,
-  and interoperation with nonlinear mappings is hairy.
-
 o oxymoron's async write-error-handling patch
 
   PRI1
@@ -514,10 +498,6 @@ o NMI watchdog seems to tick too fast
 
   PRI2
 
-o not very well tested. probably more bugs lurking.
-
-  PRI1
-
 o need to coredump 64bit vsyscall code with dwarf2
 
   PRI2

_

#1 lore raw

On 2003-10-21T15:46:27,
Nick Piggin <[email protected]> said:

The multipath module will be (outcome of KS) implemented as a device-mapper personality, which Sistina / Joe are developing. So, luckily, I'm sort of out of the loop of the "must fix" list, but I'll hopefully have some of the issues on my "will fix" list anyway ;-)

Sincerely,
Lars Marowsky-Brée <[email protected]>

Signature · 3 lines
High Availability & Clustering	      \ ever tried. ever failed. no matter.
SUSE Labs			      | try again. fail again. fail better.
Research & Development, SUSE LINUX AG \ 	-- Samuel Beckett
#2 lore raw
Quoted 8 lines · Lars Marowsky-Bree

On 2003-10-21T15:46:27,
Nick Piggin <[email protected]> said:

The multipath module will be (outcome of KS) implemented as a device-mapper personality, which Sistina / Joe are developing. So, luckily, I'm sort of out of the loop of the "must fix" list, but I'll hopefully have some of the issues on my "will fix" list anyway ;-)

OK so that means it can go in any time really, right? So it can be removed from the list. Thanks.

#3 lore raw
In reply to Nick Piggin

On Tue, 21 Oct 2003 15:46:27 +1000 Nick Piggin <[email protected]> wrote:

| The following people have their names in Documentation/must-fix.txt. Lots
| of others in should-fix.txt in 2.6.0-test8-mm1. Please review your entries.
| Also, please add any other substantial changes you need before 2.6. Thanks.

In the should-fix.txt file:

o viro: cleaning up options-parsers in filesystems. (patch exists, needs porting).

The parser lib functions are merged and approx. 15 filesystems have been converted to use it, so this could be changed to:

o viro: convert more filesystems to use lib/parser.c for parsing options (still PRI2 I suppose)

--
~Randy

#4 lore raw
In reply to Nick Piggin

Documentation/must-fix.txt o viro: parport is nearly as bad as that · line 67

Quoted 10 lines · Nick Piggin
Documentation/must-fix.txt renamed from Documentation/must-fix.txt~mustfix +0 -10
-o (Albert Cahalan) Lots of people (check Google) get this message from the
-  kernel:
-
-  psmouse.c: Lost synchronization, throwing 2 bytes away.
-
-  (the number of bytes will be 1, 2, or 3)
-
-  At work, I get it when there is heavy NFS traffic.  The mouse goes crazy,
-  jumping around and doing random cut-and-paste all over everything.  This
-  is with a decently fast and modern PC.

I'm pretty sure this problem is NOT fixed and is NOT related to the problems with support for some oddball touchpad thing.

The system in question would also lose time when under heavy load. Note that HZ is now 1000 HZ. If interrupts are kept off for too long or an SMI grabs the CPU...

Another infuriating symptom is that, when Linux detects that the TSC doesn't match jiffies, the TSC usage is turned off. There goes the only GOOD time source, tossed aside in favor of a bad one. Fix for that: if jiffies fall behind the TSC, trust the TSC -- you've lost some clock ticks.

#5 lore raw
Quoted 4 lines · Albert Cahalan

The system in question would also lose time when under heavy load. Note that HZ is now 1000 HZ. If interrupts are kept off for too long or an SMI grabs the CPU...

With a lot of laptops this is a huge problem. Its one of the reasons Red Hat went back to 100Hz in the RH 2.4 tree. With many laptops your clock becomes junk at 1Khz. It will be interesting to see if the ACPI timers help but that wont solve things for older laptops.

BTW another one for the list might be the SiS IRQ routing fixes from 2.4 if not merged otherwise newer sis and some older intel wont work properly.

#6 lore raw
In reply to Nick Piggin
Quoted 1 line · Nick Piggin

The following people have their names in Documentation/must-fix.txt. Lots

Someone also needs to go fix all the 2.4 security holes still in 2.6 last time I checked - things like the execve holes and execve versus proc races.

#7 lore raw
Quoted 10 lines · Alan Cox
Quoted 2 lines · Nick Piggin

The following people have their names in Documentation/must-fix.txt. Lots

Someone also needs to go fix all the 2.4 security holes still in 2.6 last time I checked - things like the execve holes and execve versus proc races.

I put your name down for that entry Alan. I don't know who else is aware of all the problems.

OK, a new patch. Includes everyone's suggestions. If anyone wants to be removed from the CC list please email me privately.

 linux-2.6-npiggin/Documentation/must-fix.txt   |   37 ++++---------------------
 linux-2.6-npiggin/Documentation/should-fix.txt |   23 ---------------
 2 files changed, 7 insertions(+), 53 deletions(-)
Documentation/must-fix.txt renamed from Documentation/must-fix.txt~mustfix +6 -31
diff -puN Documentation/must-fix.txt~mustfix Documentation/must-fix.txt
@@ -13,17 +13,9 @@ o TTY locking is broken.
 
   o somebody will have to document the tty driver and ldisc API
 
-o Lack of test cases and/or stress tests is a problem.  Contributions and
-  suggestions are sought.
-
-o Lots of drivers are using cli/sti and are broken.
-
 drivers/tty
 ~~~~~~~~~~~
 
-o viro: we need to fix refcounting for tty_driver (oopsable race, must fix
-  anyway, hopefully about a week until it's merged) then we can do
-  tty/misc/upper levels of sound.
 
 drivers/block/
 ~~~~~~~~~~~~~~
@@ -33,16 +25,6 @@ o ideraid hasn't been ported to 2.5 at a
   We need to understand whether the proposed BIO split code will suffice
   for this.
 
-o CD burning.  There are still a few quirks to solve wrt SG_IO and ide-cd.
-
-  Jens: The basic hang has been solved (double fault in ide-cd), there still
-  seems to be some cases that don't work too well.  Don't really have a
-  handle on those :/
-
-o lmb: Last time I looked at the multipath code (2.5.50 or so) it also
-  looked pretty broken; I plan to port forward the changes we did on 2.4
-  before KS.
-
 drivers/input/
 ~~~~~~~~~~~~~~
 
@@ -84,14 +66,6 @@ o viro: actually, misc.c has a good chan
 drivers/net/
 ~~~~~~~~~~~~
 
-o rmk: network drivers.  ARM people like to add tonnes of #ifdefs into
-  these to customise them to their hardware platform (eg, chip access
-  methods, addresses, etc.) I cope with this by not integrating them into my
-  tree.  The result is that many ARM platforms can't be built from even my
-  tree without extra patches.  This isn't sane, and has bred a culture of
-  network drivers not being submitted.  I don't see this changing for 2.6
-  though.
-
 drivers/net/irda/
 ~~~~~~~~~~~~~~~~~
 
@@ -333,11 +307,16 @@ o rmk: need to complete ALSA-ification o
 global
 ~~~~~~
 
+o alan, Albert Cahalan: 1000 HZ timer increases the need for a stable time
+  source. Many laptops, SMI can lose ticks. ACPI timers? TSC?
+
 o 64-bit dev_t.  Seems almost ready, but it's not really known how much
   work is still to do.  Patches exist in -mm but with the recent rise of the
   neo-viro I'm not sure where things are at.
 
-o Lots of 2.4 fixes including some security are not in 2.5
+o alan: Forward port 2.4 fixes
+  - Security fixes including execve holes, execve vs proc races
+  - SiS IRQ routing for newer SiS and older Intel
 
 o There are about 60 or 70 security related checks that need doing
   (copy_user etc) from Stanford tools.  (badari is looking into this, and
@@ -348,7 +327,3 @@ o A couple of hundred real looking bugzi
 o viro: cdev rework.  Main group is pretty stable and I hope to feed it to
   Linus RSN.  That's cdev-cidr and ->i_cdev/->i_cindex stuff
 
-o Athlon prefetch oopses sometimes.  It is currently disabled, and needs to
-  be fixed.
-
-
Documentation/should-fix.txt renamed from Documentation/should-fix.txt~mustfix +1 -22
diff -puN Documentation/should-fix.txt~mustfix Documentation/should-fix.txt
@@ -10,12 +10,6 @@ PRI3:	Not very important
 drivers/block/
 ~~~~~~~~~~~~~~
 
-o Framework for selecting IO schedulers.  This is the main one really. 
-  Once this is in place we can drop in new schedulers any old time, no risk.
-  Nick Piggin has code for this.
-
-  PRI1
-
 o viro: paride drivers need a big cleanup
 
   PRI2
@@ -145,15 +139,7 @@ o (Trond:) Yes: I'm still working on an 
 
    PRI2 (?)
 
-o (Chuck Lever <[email protected]>): NFS O_DIRECT support must be
-  completed.  The best approach is to fall back to something like the 2.4 NFS
-  O_DIRECT support, which issues RPCs synchronously and uses the RPC
-  completion mechanism to wait for I/O completion.
-
-  PRI2
-
-o viro: cleaning up options-parsers in filesystems.  (patch exists, needs
-  porting).
+o viro: convert more filesystems to use lib/parser.c for options.
 
   PRI2
 
@@ -200,9 +186,6 @@ o klibc merge?
 mm/
 ~~~
 
-o objrmap: concerns over page reclaim performance at high sharing levels,
-  and interoperation with nonlinear mappings is hairy.
-
 o oxymoron's async write-error-handling patch
 
   PRI1
@@ -514,10 +497,6 @@ o NMI watchdog seems to tick too fast
 
   PRI2
 
-o not very well tested. probably more bugs lurking.
-
-  PRI1
-
 o need to coredump 64bit vsyscall code with dwarf2
 
   PRI2

_

#8 lore raw

Documentation/must-fix.txt o rmk: need to complete ALSA-ification o · line 311

Quoted 2 lines · Nick Piggin
Documentation/must-fix.txt renamed from Documentation/must-fix.txt~mustfix +2 -0
+o alan, Albert Cahalan: 1000 HZ timer increases the need for a stable time
+  source. Many laptops, SMI can lose ticks. ACPI timers? TSC?

Oh, I have an example for you.

Consider the Intel Plumas chipset. There are some predictable time windows during which the RTC will return garbage. The BIOS "fix" leads to SMI/SMM stuff stealing large chunks of CPU time. On a logic analyser, somebody at work observed chunks of time as large as 4 ms. That's 3 to 5 clock ticks. Maybe that isn't worst-case even.

To avoid this disaster, Linux must _never_ touch the RTC registers. The HPET can be used instead. The TSC is of course also reliable, but Linux stops using it as soon as a problem hits!

The ignore-the-TSC code really should be doing just the opposite. Ticks are likely to be lost. I've never seen an unstable TSC. :-)

Quoted 3 lines

o 64-bit dev_t. Seems almost ready, but it's not really known how much work is still to do. Patches exist in -mm but with the recent rise of the neo-viro I'm not sure where things are at.

Hey, 32-bit dev_t is in already. That's it. Done.

#9 lore raw
In reply to Nick Piggin

Documentation/must-fix.txt o TTY locking is broken. · line 26

Quoted 6 lines · Nick Piggin

drivers/tty
~~~~~~~~~~~

Documentation/must-fix.txt renamed from Documentation/must-fix.txt~mustfix +0 -3
-o viro: we need to fix refcounting for tty_driver (oopsable race, must fix
-  anyway, hopefully about a week until it's merged) then we can do
-  tty/misc/upper levels of sound.

Still not completely fixed.

Quoted 3 lines

o 64-bit dev_t. Seems almost ready, but it's not really known how much work is still to do. Patches exist in -mm but with the recent rise of the neo-viro I'm not sure where things are at.

32-bit dev_t is done, 64-bit means extra work on nfsd/raid/etc. for those who are really interested. Not a mustfix for 2.6.0.

Quoted 2 lines

o viro: cdev rework. Main group is pretty stable and I hope to feed it to Linus RSN. That's cdev-cidr and ->i_cdev/->i_cindex stuff

Mostly done.

Quoted 1 line

o viro: paride drivers need a big cleanup

Partially done, but ATAPI drivers will need serious work. There are real bugs, BTW - it's not just that code is ugly as hell.

#10 lore raw
In reply to Alan Cox
Quoted 6 lines · * Alan Cox ([email protected]) wrote:
Quoted 1 line · Nick Piggin

The following people have their names in Documentation/must-fix.txt. Lots

Someone also needs to go fix all the 2.4 security holes still in 2.6 last time I checked - things like the execve holes and execve versus proc races.

I thought these had been fixed, but I'd be happy to take a look.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#11 lore raw
Quoted 5 lines · Chris Wright
Quoted 3 lines

Someone also needs to go fix all the 2.4 security holes still in 2.6 last time I checked - things like the execve holes and execve versus proc races.

I thought these had been fixed, but I'd be happy to take a look.

I got mail from a guy at intel implying the unshare_files stuff wasnt in 2.6 yet

#12 lore raw

RFC PATCH 1/1 must fix lists

OK, I have incorporated comments. If everyone could try to keep your entries on the list up to date it would be nice. It might give you a bit more bargaining power to get things in.

I'll continue to try to keep things together until people get sick of it, but its not easy working out exactly where people are up to with most things.

Everyone has to work extra hard to clear this list for 2.6.0, but that doesn't look realistic. Hopefully it can be done before 2.7 branches. I guess the security fixes audit is the most important thing for 2.6.0.

 l-2.6-npiggin/Documentation/must-fix.txt   |   49 +++++++----------------------
 l-2.6-npiggin/Documentation/should-fix.txt |   26 +--------------
 2 files changed, 16 insertions(+), 59 deletions(-)
Documentation/must-fix.txt renamed from Documentation/must-fix.txt~mustfix +13 -36
diff -puN Documentation/must-fix.txt~mustfix Documentation/must-fix.txt
@@ -13,17 +13,11 @@ o TTY locking is broken.
 
   o somebody will have to document the tty driver and ldisc API
 
-o Lack of test cases and/or stress tests is a problem.  Contributions and
-  suggestions are sought.
-
-o Lots of drivers are using cli/sti and are broken.
-
 drivers/tty
 ~~~~~~~~~~~
 
-o viro: we need to fix refcounting for tty_driver (oopsable race, must fix
-  anyway, hopefully about a week until it's merged) then we can do
-  tty/misc/upper levels of sound.
+o viro: tty_driver refcounting, tty/misc/upper levels of sound still not
+  completely fixed.
 
 drivers/block/
 ~~~~~~~~~~~~~~
@@ -33,16 +27,6 @@ o ideraid hasn't been ported to 2.5 at a
   We need to understand whether the proposed BIO split code will suffice
   for this.
 
-o CD burning.  There are still a few quirks to solve wrt SG_IO and ide-cd.
-
-  Jens: The basic hang has been solved (double fault in ide-cd), there still
-  seems to be some cases that don't work too well.  Don't really have a
-  handle on those :/
-
-o lmb: Last time I looked at the multipath code (2.5.50 or so) it also
-  looked pretty broken; I plan to port forward the changes we did on 2.4
-  before KS.
-
 drivers/input/
 ~~~~~~~~~~~~~~
 
@@ -84,14 +68,6 @@ o viro: actually, misc.c has a good chan
 drivers/net/
 ~~~~~~~~~~~~
 
-o rmk: network drivers.  ARM people like to add tonnes of #ifdefs into
-  these to customise them to their hardware platform (eg, chip access
-  methods, addresses, etc.) I cope with this by not integrating them into my
-  tree.  The result is that many ARM platforms can't be built from even my
-  tree without extra patches.  This isn't sane, and has bred a culture of
-  network drivers not being submitted.  I don't see this changing for 2.6
-  though.
-
 drivers/net/irda/
 ~~~~~~~~~~~~~~~~~
 
@@ -176,6 +152,8 @@ o rmk: I have a pending todo: I need to 
 
 o James B: USB hot-removal crash: "It's a known scsi refcounting issue."
 
+o James B: refcounting issues in SCSI and in the block layer.
+
 fs/
 ~~~
 
@@ -333,11 +311,15 @@ o rmk: need to complete ALSA-ification o
 global
 ~~~~~~
 
-o 64-bit dev_t.  Seems almost ready, but it's not really known how much
-  work is still to do.  Patches exist in -mm but with the recent rise of the
-  neo-viro I'm not sure where things are at.
+o alan, Albert Cahalan: 1000 HZ timer increases the need for a stable time
+  source. Many laptops, SMI can lose ticks. ACPI timers? TSC?
+
+o viro: 64-bit dev_t (not a mustfix for 2.6.0). 32-bit dev_t is done, 64-bit
+  means extra work on nfsd/raid/etc.
 
-o Lots of 2.4 fixes including some security are not in 2.5
+o alan: Forward port 2.4 fixes
+  - Security fixes including execve holes, execve vs proc races
+  - SiS IRQ routing for newer SiS and older Intel
 
 o There are about 60 or 70 security related checks that need doing
   (copy_user etc) from Stanford tools.  (badari is looking into this, and
@@ -345,10 +327,5 @@ o There are about 60 or 70 security rela
 
 o A couple of hundred real looking bugzilla bugs
 
-o viro: cdev rework.  Main group is pretty stable and I hope to feed it to
-  Linus RSN.  That's cdev-cidr and ->i_cdev/->i_cindex stuff
-
-o Athlon prefetch oopses sometimes.  It is currently disabled, and needs to
-  be fixed.
-
+o viro: cdev rework. Mostly done.
 
Documentation/should-fix.txt renamed from Documentation/should-fix.txt~mustfix +3 -23
diff -puN Documentation/should-fix.txt~mustfix Documentation/should-fix.txt
@@ -10,13 +10,8 @@ PRI3:	Not very important
 drivers/block/
 ~~~~~~~~~~~~~~
 
-o Framework for selecting IO schedulers.  This is the main one really. 
-  Once this is in place we can drop in new schedulers any old time, no risk.
-  Nick Piggin has code for this.
-
-  PRI1
-
-o viro: paride drivers need a big cleanup
+o viro: paride drivers need a big cleanup. Partially done, but ATAPI drivers
+  need serious work and bug fixing.
 
   PRI2
 
@@ -145,15 +140,7 @@ o (Trond:) Yes: I'm still working on an 
 
    PRI2 (?)
 
-o (Chuck Lever <[email protected]>): NFS O_DIRECT support must be
-  completed.  The best approach is to fall back to something like the 2.4 NFS
-  O_DIRECT support, which issues RPCs synchronously and uses the RPC
-  completion mechanism to wait for I/O completion.
-
-  PRI2
-
-o viro: cleaning up options-parsers in filesystems.  (patch exists, needs
-  porting).
+o viro: convert more filesystems to use lib/parser.c for options.
 
   PRI2
 
@@ -200,9 +187,6 @@ o klibc merge?
 mm/
 ~~~
 
-o objrmap: concerns over page reclaim performance at high sharing levels,
-  and interoperation with nonlinear mappings is hairy.
-
 o oxymoron's async write-error-handling patch
 
   PRI1
@@ -514,10 +498,6 @@ o NMI watchdog seems to tick too fast
 
   PRI2
 
-o not very well tested. probably more bugs lurking.
-
-  PRI1
-
 o need to coredump 64bit vsyscall code with dwarf2
 
   PRI2

_

#13 lore raw

ACPI PM-Timer [Was: Re: [RFC][PATCH] must fix lists]

Review

Quoted 2 lines · Nick Piggin
(quoted diff) +2 -0
+o alan, Albert Cahalan: 1000 HZ timer increases the need for a stable time
+  source. Many laptops, SMI can lose ticks. ACPI timers? TSC?

A few months ago, I proposed to make the ACPI "Powermanagement" timer, a reliable timing source with ~3.6MHz resolution, available as a timer_opts for arch/i386/kernel/timers/timer.c. [1]

The major difficulty with this ACPI PM-Timer is that the I/O-port it is located at is unknown during time_init.[2] So, it becomes necessary to use a different timing source in the beginning, and switch to the ACPI PM-Timer later.

Here are two different methods to replace one timing source with another. First, the simple (and buggy) one -- the timing is broken until the next timer "tick" == the next call to mark_offset().

arch/i386/kernel/timers/timer.c +9 -1
diff -ruN linux-original/arch/i386/kernel/timers/timer.c linux/arch/i386/kernel/timers/timer.c
@@ -35,12 +35,20 @@
 __setup("clock=", clock_setup);
 
 
+/* Switch to other timesource. */
+int replace_timer_opts(struct timer_opts *replacement)
+{
+	replacement->mark_offset();
+	cur_timer = replacement;
+	return 0;
+}
+
 /* The chosen timesource has been found to be bad.
  * Fall back to a known good timesource (the PIT)
  */
 void clock_fallback(void)
 {
-	cur_timer = &timer_pit;
+	replace_timer_opts(&timer_pit);
 }
 
 /* iterates through the list of timers, returning the first 
include/asm-i386/timer.h +1 -0
diff -ruN linux-original/include/asm-i386/timer.h linux/include/asm-i386/timer.h
@@ -22,6 +22,7 @@
 
 extern struct timer_opts* select_timer(void);
 extern void clock_fallback(void);
+extern int replace_timer_opts(struct timer_opts *replacement);
 
 /* Modifiers for buggy PIT handling */
 

||| END OF PATCH |||

A different, more sensible approach is this:

arch/i386/kernel/timers/timer.c +75 -1

94 lines not on this page · raw message

include/asm-i386/timer.h +1 -0
diff -ruN linux-original/include/asm-i386/timer.h linux/include/asm-i386/timer.h
@@ -22,6 +22,7 @@
 
 extern struct timer_opts* select_timer(void);
 extern void clock_fallback(void);
+extern int replace_timer_opts(struct timer_opts *replacement);
 
 /* Modifiers for buggy PIT handling */
 

||| END OF PATCH |||

And, last but not least, here's the actual timer code:

arch/i386/Kconfig +12 -0
diff -ruN linux-original/arch/i386/Kconfig linux/arch/i386/Kconfig
@@ -510,6 +510,18 @@
 	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ
 	default y
 
+config X86_PM_TIMER
+	bool "Use Power Management Timer (PMTMR) as primary timing source"
+	depends on ACPI_BUS
+	help
+	  The Power Management Timer (PMTMR) is available on all 
+	  ACPI-capable systems. it provides a reliable timing source 
+	  which does not get affected by powermanagement features 
+	  (e.g. aggressive idling, throttling or frequency scaling), 
+	  unlike the commonly used Time Stamp Counter (TSC) timing source.
+	  If you see messages like 'Losing too many ticks!' in the kernel
+	  logs, you may want to say "Y" here.
+
 config X86_MCE
 	bool "Machine Check Exception"
 	---help---
arch/i386/kernel/timers/Makefile +1 -0
diff -ruN linux-original/arch/i386/kernel/timers/Makefile linux/arch/i386/kernel/timers/Makefile
@@ -6,3 +6,4 @@
 
 obj-$(CONFIG_X86_CYCLONE_TIMER)	+= timer_cyclone.o
 obj-$(CONFIG_HPET_TIMER)	+= timer_hpet.o
+obj-$(CONFIG_X86_PM_TIMER)	+= timer_pm.o
arch/i386/kernel/timers/timer_pm.c +168 -0

168 lines not on this page · raw message

||| END OF PATCH |||

These patches have been tested on two i386 systems with 2.6.0-test9.

John? Albert?

Dominik

[1] http://marc.theaimsgroup.com/?l=linux-kernel&m=105860269801212&w=2
[2] For details, see the comment in the third patch, below "detection of the I/O Port".

#14 lore raw

Re: ACPI PM-Timer [Was: Re: [RFC][PATCH] must fix lists]

Quoted 8 lines · Dominik Brodowski

Review

Quoted 2 lines · Nick Piggin
(quoted diff) +2 -0
+o alan, Albert Cahalan: 1000 HZ timer increases the need for a stable time
+  source. Many laptops, SMI can lose ticks. ACPI timers? TSC?

A few months ago, I proposed to make the ACPI "Powermanagement" timer, a reliable timing source with ~3.6MHz resolution, available as a timer_opts for arch/i386/kernel/timers/timer.c. [1]

Quoted 8 lines

The major difficulty with this ACPI PM-Timer is that the I/O-port it is located at is unknown during time_init.[2] So, it becomes necessary to use a different timing source in the beginning, and switch to the ACPI PM-Timer later.

Here are two different methods to replace one timing source with another. First, the simple (and buggy) one -- the timing is broken until the next timer "tick" == the next call to mark_offset().

Thanks for working on this, Dominik!

My only comment is that rather then replacing the time source midstream, could we not do as the HPET time source does and use the late_time_init callback? That avoids the nasty time source switching code.

thanks
-john

#15 lore raw

Re: ACPI PM-Timer [Was: Re: [RFC][PATCH] must fix lists]

Quoted 18 lines · john stultz
Quoted 8 lines · Dominik Brodowski

Review

Quoted 2 lines · Nick Piggin
(quoted diff) +2 -0
+o alan, Albert Cahalan: 1000 HZ timer increases the need for a stable time
+  source. Many laptops, SMI can lose ticks. ACPI timers? TSC?

A few months ago, I proposed to make the ACPI "Powermanagement" timer, a reliable timing source with ~3.6MHz resolution, available as a timer_opts for arch/i386/kernel/timers/timer.c. [1]

Quoted 8 lines

The major difficulty with this ACPI PM-Timer is that the I/O-port it is located at is unknown during time_init.[2] So, it becomes necessary to use a different timing source in the beginning, and switch to the ACPI PM-Timer later.

Here are two different methods to replace one timing source with another. First, the simple (and buggy) one -- the timing is broken until the next timer "tick" == the next call to mark_offset().

Quoted 5 lines

Thanks for working on this, Dominik!

My only comment is that rather then replacing the time source midstream, could we not do as the HPET time source does and use the late_time_init callback? That avoids the nasty time source switching code.

Because "late_time_init" is way too early. It might be usable for the (unimplemented) detection method c) -- parsing the ACPI FADT ourselves -- described in the timer_pm.c code.
However, the currently used method uses struct acpi_fadt which is filled in drivers/acpi/bus.c:acpi_bus_init(), which is called from a subsys_initcall.

Dominik

#16 lore raw

Re: ACPI PM-Timer [Was: Re: [RFC][PATCH] must fix lists]

Quoted 11 lines · Dominik Brodowski
Quoted 3 lines · john stultz

My only comment is that rather then replacing the time source midstream, could we not do as the HPET time source does and use the late_time_init callback? That avoids the nasty time source switching code.

Because "late_time_init" is way too early. It might be usable for the (unimplemented) detection method c) -- parsing the ACPI FADT ourselves -- described in the timer_pm.c code.
However, the currently used method uses struct acpi_fadt which is filled in drivers/acpi/bus.c:acpi_bus_init(), which is called from a subsys_initcall.

Ah, OK. Well, I'd prefer the manual ACPI parsing personally, but having tried and failed to implement it once myself, I'd more prefer not to do it myself. ;)

Let me get your patches up and running and I'll see if I have any reasonable feedback.

Thanks again!
-john

#17 lore raw

ACPI PM-Timer rev.2 [Was: Re: ACPI PM-Timer [Was: Re: [RFC][PATCH] must fix lists]]

Quoted 3 lines · john stultz

Ah, OK. Well, I'd prefer the manual ACPI parsing personally, but having tried and failed to implement it once myself, I'd more prefer not to do it myself. ;)

Here it is, and it is soooo much nicer than my previous implementation. It lacks the "lost-ticks compensation" and math cleanup John is working on, but otherwise:

 arch/i386/Kconfig                  |   18 ++++
 arch/i386/kernel/acpi/boot.c       |   31 ++++++++
 arch/i386/kernel/timers/Makefile   |    1
 arch/i386/kernel/timers/timer.c    |    3
 arch/i386/kernel/timers/timer_pm.c |  139 +++++++++++++++++++++++++++++++++++++
 include/asm-i386/timer.h           |    3
 6 files changed, 195 insertions(+)

Dominik

arch/i386/Kconfig +18 -0
diff -ruN linux-original/arch/i386/Kconfig linux/arch/i386/Kconfig
@@ -411,6 +411,24 @@
 config HPET_EMULATE_RTC
 	def_bool HPET_TIMER && RTC=y
 
+config X86_PM_TIMER
+	bool "Power Management Timer Support"
+	depends on (!X86_VISWS && !X86_VISWS) && EXPERIMENTAL
+	default n
+	help
+	  The Power Management Timer is available on all ACPI-capable,
+	  in most cases even if ACPI is unusable or blacklisted.
+
+	  This timing source is not affected by powermanagement features
+	  like aggressive processor idling, throttling, frequency and/or
+	  voltage scaling, unlike the commonly used Time Stamp Counter 
+	  (TSC) timing source.
+
+	  So, if you see messages like 'Losing too many ticks!' in the 
+	  kernel logs, and/or you are using a this on a notebook which
+	  does not yet have an HPET (see above), you should say "Y" 
+	  here. Otherwise, say "N".
+
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
arch/i386/kernel/acpi/boot.c +31 -0
diff -ruN linux-original/arch/i386/kernel/acpi/boot.c linux/arch/i386/kernel/acpi/boot.c
@@ -319,6 +319,33 @@
 }
 #endif
 
+/* detect the location of the ACPI PM Timer
+#ifdef CONFIG_X86_PM_TIMER
+extern u32 pmtmr_ioport;
+
+static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
+{
+	struct fadt_descriptor_rev2 *fadt;
+
+	fadt = __va(phys);
+
+	if (fadt->revision >= FADT2_REVISION_ID) {
+		/* FADT rev. 2 */
+		if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO)
+			return 0;
+
+		pmtmr_ioport = fadt->xpm_tmr_blk.address;
+	} else {
+		/* FADT rev. 1 */
+		pmtmr_ioport = fadt->V1_pm_tmr_blk;
+	}
+	if (pmtmr_ioport)
+		printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport);
+	return 0;
+}
+#endif
+
+
 unsigned long __init
 acpi_find_rsdp (void)
 {
@@ -512,5 +539,9 @@
 	acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
 #endif
 
+#ifdef CONFIG_X86_PM_TIMER
+	acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
+#endif
+
 	return 0;
 }
arch/i386/kernel/timers/Makefile +1 -0
diff -ruN linux-original/arch/i386/kernel/timers/Makefile linux/arch/i386/kernel/timers/Makefile
@@ -6,3 +6,4 @@
 
 obj-$(CONFIG_X86_CYCLONE_TIMER)	+= timer_cyclone.o
 obj-$(CONFIG_HPET_TIMER)	+= timer_hpet.o
+obj-$(CONFIG_X86_PM_TIMER)	+= timer_pm.o
arch/i386/kernel/timers/timer.c +3 -0
diff -ruN linux-original/arch/i386/kernel/timers/timer.c linux/arch/i386/kernel/timers/timer.c
@@ -19,6 +19,9 @@
 #ifdef CONFIG_HPET_TIMER
 	&timer_hpet,
 #endif
+#ifdef CONFIG_X86_PM_TIMER
+	&timer_pmtmr,
+#endif
 	&timer_tsc,
 	&timer_pit,
 	NULL,
arch/i386/kernel/timers/timer_pm.c +139 -0

139 lines not on this page · raw message

include/asm-i386/timer.h +3 -0
diff -ruN linux-original/include/asm-i386/timer.h linux/include/asm-i386/timer.h
@@ -44,4 +44,7 @@
 extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
 #endif
 
+#ifdef CONFIG_X86_PM_TIMER
+extern struct timer_opts timer_pmtmr;
+#endif
 #endif
#18 lore raw

Re: ACPI PM-Timer rev.2 [Was: Re: ACPI PM-Timer [Was: Re: [RFC][PATCH] must fix lists]]

Quoted 8 lines · Dominik Brodowski
Quoted 3 lines · john stultz

Ah, OK. Well, I'd prefer the manual ACPI parsing personally, but having tried and failed to implement it once myself, I'd more prefer not to do it myself. ;)

Here it is, and it is soooo much nicer than my previous implementation. It lacks the "lost-ticks compensation" and math cleanup John is working on, but otherwise:

Finally, here are my fixes to Dominik's patch (meant to send these out last week, but got swamped). Basically it cleans up some of the math, adds lost-tick compensation and monotonic_clock, fixes up a bit of the ACPI table mapping, and moves the config option under the ACPI menu. Oh yea, and it compiles, too ;)

Works well for me, but needs more testing.

Applies on top of Dominik's ACPI PM-timer rev.2 patch.
http://www.ussg.iu.edu/hypermail/linux/kernel/0310.3/0669.html

Many thanks to Dominik for the great work and getting this started. -john

diff -Nru a/Documentation/kernel-parameters.txt
b/Documentation/kernel-parameters.txt

Documentation/kernel-parameters.txt +1 -1
@@ -214,7 +214,7 @@
 			Forces specified timesource (if avaliable) to be used
 			when calculating gettimeofday(). If specicified timesource
 			is not avalible, it defaults to PIT. 
-			Format: { pit | tsc | cyclone | ... }
+			Format: { pit | tsc | cyclone | pmtmr }
 
 	hpet=		[IA-32,HPET] option to disable HPET and use PIT.
 			Format: disable
arch/i386/Kconfig +0 -18
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
@@ -411,24 +411,6 @@
 config HPET_EMULATE_RTC
 	def_bool HPET_TIMER && RTC=y
 
-config X86_PM_TIMER
-	bool "Power Management Timer Support"
-	depends on (!X86_VISWS && !X86_VISWS) && EXPERIMENTAL
-	default n
-	help
-	  The Power Management Timer is available on all ACPI-capable,
-	  in most cases even if ACPI is unusable or blacklisted.
-
-	  This timing source is not affected by powermanagement features
-	  like aggressive processor idling, throttling, frequency and/or
-	  voltage scaling, unlike the commonly used Time Stamp Counter 
-	  (TSC) timing source.
-
-	  So, if you see messages like 'Losing too many ticks!' in the 
-	  kernel logs, and/or you are using a this on a notebook which
-	  does not yet have an HPET (see above), you should say "Y" 
-	  here. Otherwise, say "N".
-
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
arch/i386/kernel/acpi/boot.c +1 -1
diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
@@ -319,15 +319,19 @@
 }
 #endif
 
-/* detect the location of the ACPI PM Timer
+/* detect the location of the ACPI PM Timer */
 #ifdef CONFIG_X86_PM_TIMER
 extern u32 pmtmr_ioport;
 
 static int __init acpi_parse_fadt(unsigned long phys, unsigned long

size)
{
- struct fadt_descriptor_rev2 *fadt;
+ struct fadt_descriptor_rev2 *fadt =0;

- fadt = __va(phys);
+ fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
+ if(!fadt) {
+ printk(KERN_WARNING PREFIX "Unable to map FADT\n");
+ return 0;
+ }

if (fadt->revision >= FADT2_REVISION_ID) {
/* FADT rev. 2 */
diff -Nru a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c

arch/i386/kernel/timers/timer_pm.c +76 -17

127 lines not on this page · raw message

drivers/acpi/Kconfig +19 -0
diff -Nru a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
@@ -269,5 +269,24 @@
 	  particular, many Toshiba laptops require this for correct operation
 	  of the AC module.
 
+config X86_PM_TIMER
+	bool "Power Management Timer Support"
+	depends on X86 && ACPI
+	depends on ACPI_BOOT && EXPERIMENTAL
+	default n
+	help
+	  The Power Management Timer is available on all ACPI-capable,
+	  in most cases even if ACPI is unusable or blacklisted.
+
+	  This timing source is not affected by powermanagement features
+	  like aggressive processor idling, throttling, frequency and/or
+	  voltage scaling, unlike the commonly used Time Stamp Counter 
+	  (TSC) timing source.
+
+	  So, if you see messages like 'Losing too many ticks!' in the 
+	  kernel logs, and/or you are using a this on a notebook which
+	  does not yet have an HPET (see above), you should say "Y" 
+	  here.
+
 endmenu