Luigi Rizzo [Sat, 17 Apr 2004 15:09:36 +0000 (15:09 +0000)]
misc cleanup in sysctl_ifmalist():
+ remove a partly incorrect comment that i introduced in the last commit;
+ deal with the correct part of the above comment by cleaning up the
updates of 'info' -- rti_addrs needd not to be updated,
rti_info[RTAX_IFP] can be set once outside the loop.
While at it, correct a few misspelling of NULL as 0, but there are
way too many in this file, and i did not want to clutter the
important part of this commit.
Paul Saab [Fri, 16 Apr 2004 23:00:01 +0000 (23:00 +0000)]
Add support for the HP Modular Smart Array 20 & 500 storage arrays.
Logical volumes on these devices show up as LUNs behind another
controller (also known as proxy controller). In order to issue
firmware commands for a volume on a proxy controller, they must be
targeted at the address of the proxy controller it is attached to,
not the Host/PCI controller.
A proxy controller is defined as a device listed in the INQUIRY
PHYSICAL LUNS command who's L2 and L3 SCSI addresses are zero. The
corresponding address returned defines which "bus" the controller
lives on and we use this to create a virtual CAM bus.
A logical volume's addresses first byte defines the logical drive
number. The second byte defines the bus that it is attached to
which corresponds to the BUS of the proxy controller's found or the
Host/PCI controller.
Change event notification to be handled in its own kernel thread.
This is needed since some events may require the driver to sleep
on some operations and this cannot be done during interrupt context.
With this change, it is now possible to create and destroy logical
volumes from FreeBSD, but it requires a native application to
construct the proper firmware commands which is not publicly
available.
Special thanks to John Cagle @ HP for providing remote access to
all the hardware and beating on the storage engineers at HP to
answer my questions.
John Baldwin [Fri, 16 Apr 2004 20:25:40 +0000 (20:25 +0000)]
- Enable (unmask) interrupt sources earlier in the ithread loop.
Specifically, we used to enable the source after locking sched_lock
and just before we had already decided to do a context switch.
This meant that an ithread could never process more than one interrupt
per context switch. Enabling earlier in the loop before sched_lock is
acquired allows an ithread to handle multiple interrupts per context
switch if interrupts fire very rapidly. For the case of heavy interrupt
load this can reduce the number of context switches (and thus overhead)
as well as reduce interrupt latency.
- Now that we can handle multiple interrupts per context switch, add simple
interrupt storm protection to threaded interrupts. If X number of
consecutive interrupts are triggered before the itherad voluntarily
yields to another thread, then the interrupt thread will sleep with the
associated interrupt source disabled (masked) for 1/10th of a second.
The default value of X is 500, but it can be tweaked via the tunable/
sysctl hw.intr_storm_threshold. If an interrupt storm is detected, then
a message is output to the kernel console on the first occurrence per
interrupt thread. Interrupt storm protection can be disabled completely
by setting this value to 0. There is no scientific reasoning for the
1/10th of a second or 500 interrupts values, so they may require tweaking
at some point in the future.
Tested by: rwatson (an earlier version w/o the storm protection)
Tested by: mux (reportedly made a machine with two PCI interrupts
storming usable rather than hard locked)
Reviewed by: imp
John Baldwin [Fri, 16 Apr 2004 19:46:30 +0000 (19:46 +0000)]
Revert part of the "BIOS brain damage" from rev 1.10. It seems that
different BIOSs use the same exact settings to mean two very different and
incompatible things for the SCI. Thus, if the SCI is remapped to a PCI
interrupt, we now trust the trigger/polarity that the MADT provides by
default. However, the SCI can be forced to level/lo as 1.10 did by setting
the tunable "hw.acpi.force_sci_lo" to a non-zero value from the loader.
Thus, if rev 1.10 caused an interrupt storm, it should nwo fix your
machine. If rev 1.10 fixed an interrupt storm on your machine, you
probably need to set the aforementioned tunable in /boot/loader.conf to
prevent the interrupt storm.
The more general problem of getting the SCI's trigger/polarity programmed
"correctly" (for some value of correctly meaning several workarounds for
broken BIOSs and inconsistent "implementations" of the ACPI standard) is
going to require more work, but this band-aid should improve the current
situation somewhat.
Hiroki Sato [Fri, 16 Apr 2004 18:38:04 +0000 (18:38 +0000)]
New release note:
acpi_toshiba(4) video switching support,
getvfsent(3) removed,
sx driver added,
pci(4) bus resource and power management updated,
per-interface polling(4) support,
ata(4) early support for Promise SX4/SX4000,
dump(8) and restore(8) -P option,
make(1) .warning directive,
ACPI-CA 20040402 import, and
CVS 1.11.15 import.
Mark Murray [Fri, 16 Apr 2004 17:10:54 +0000 (17:10 +0000)]
Attempts to make this device Giant-free were ill-conceived as
uiomove(9) is not properly locked. So, return to NEEDGIANT
mode. Later, when uiomove is finely locked, I'll revisit.
While I'm here, provide some temporary debugging output to
help catch blocking startups.
Disable the new wake GPE behavior. With it enabled, my laptop won't stay
suspended after the second try. Intel is working on a fix to properly
differentiate the non-standard wake/runtime GPEs from wake-only GPEs.
Robert Watson [Fri, 16 Apr 2004 14:35:11 +0000 (14:35 +0000)]
At some point during the history of m_getcl(), MAC support began to
unconditionally initialize the mbuf header even if cluster allocation
failed, which could result in a NULL pointer dereference in low-memory
conditions.
PR: kern/65548
Submitted by: Stephan Uphoff <ups@tree.com>
Tim Kientzle [Fri, 16 Apr 2004 01:20:58 +0000 (01:20 +0000)]
Only enable the ACL restore logic on FreeBSD versions >= 5.0.
Earlier versions of FreeBSD don't support ACLs.
Note that the ACL support code in archive_entry is standalone code and
unaffected by this. (In particular, it should be possible to
manipulate archives containing ACLs even if the ACLs cannot be
restored on the current system.)
Bill Paul [Fri, 16 Apr 2004 00:04:28 +0000 (00:04 +0000)]
- Use memory barrier with atomic operations in ntoskrnl_lock_dpc() and
ntoskrnl_unlocl_dpc().
- hal_raise_irql(), hal_lower_irql() and hal_irql() didn't work right
on SMP (priority inheritance makes things... interesting). For now,
use only two states: DISPATCH_LEVEL (PI_REALTIME) and PASSIVE_LEVEL
(everything else). Tested on a dual PIII box.
- Use ndis_thsuspend() in ndis_sleep() instead of tsleep(). (I added
ndis_thsuspend() and ndis_thresume() to replace kthread_suspend()
and kthread_resume(); the former will preserve a thread's priority
when it wakes up, the latter will not.)
- Change use of tsleep() in ndis_stop_thread() to prevent priority
change on wakeup.
Tim Kientzle [Thu, 15 Apr 2004 22:37:54 +0000 (22:37 +0000)]
As suggested by Julian Elischer, use a self-sizing hash
table for the hardlink cache. This dramatically improves
performance when archiving millions of hardlinked files.
While I'm here, clean up some style bugs (per Bruce Evans)
and clarify some comments.
Luigi Rizzo [Thu, 15 Apr 2004 20:31:10 +0000 (20:31 +0000)]
Remove improper use of if_addrhead in device drivers to check
if the link-level address has been initialized already.
The majority of modern drivers never does this and works fine, which
makes me think that the check is totally unnecessary and a residue
of cut&paste from other drivers.
This change is done to simplify locking because now almost none of the
drivers uses this field. The exceptions are "ct" "ctau" and "cx"
where i am not sure if i can remove that part.
Brooks Davis [Thu, 15 Apr 2004 18:23:14 +0000 (18:23 +0000)]
Remove bogus checks on the value of ${entropy_file} and hardcode out
entropy source to /entropy. We have to assume there is no rc.conf at
this stage of the boot process.
Brooks Davis [Thu, 15 Apr 2004 17:52:53 +0000 (17:52 +0000)]
Band-aid diskless booting by running a new preseedrandom script before
initdiskless. The output of several commands and if available the
contents of /entropy are feed into /dev/random to kickstart the PRNG.
/etc/rc.d/initrandom is left alone to maintain the previous behavior as
much as possiable.
Peter Wemm [Thu, 15 Apr 2004 01:41:05 +0000 (01:41 +0000)]
Change WriteTemplate to take const char * args.
The Name_Root() call seems to be defunct, remove it because it was
causing compile problems. The real magic seems to be in the Parse_Info()
callback (which was also updated for const char * args).
Peter Wemm [Wed, 14 Apr 2004 23:26:26 +0000 (23:26 +0000)]
Turn on the amd64-specific bignum code in openssl. This is actually
a variant of the C code but with some scattered asm and things laid out
more optimally for the platform. This means that we need to the asm
directory to the search path for the amd64 case so that make can find
the source.
Peter Edwards [Wed, 14 Apr 2004 23:23:55 +0000 (23:23 +0000)]
Let the NFS client notice a file's size changing as a modification.
This avoids presenting invalid data to the client's applications
when the file is modified, and then extended within the window of
the resolution of the modifcation timestamp.
Scott Long [Wed, 14 Apr 2004 19:11:29 +0000 (19:11 +0000)]
Remove the 'timeout' argument from aac_wait_command() as it isn't used and
never will be. Update the XXX comment for this function to accurately reflect
why things are the way they are.
Warner Losh [Wed, 14 Apr 2004 17:52:08 +0000 (17:52 +0000)]
Now that the dust has settled on the resource issues, turn on the
power parts of my patches and see what breaks. Don't (yet) throw
the chatty messages behind a if (bootverbose).