Commit Graph

30816 Commits

Author SHA1 Message Date
alfred
bc5f1abaf3 Missed this file for select SMP fixes associated with rev 1.93 of
kern/sys_generic.c
2002-03-14 04:47:08 +00:00
green
9116fd1a97 Document faultstate.lookup_still_valid more than none.
Requested by:	alfred
2002-03-14 02:10:14 +00:00
alfred
2c16fbdd2a Fixes to make select/poll mpsafe.
Problem:
  selwakeup required calling pfind which would cause lock order
  reversals with the allproc_lock and the per-process filedesc lock.
Solution:
  Instead of recording the pid of the select()'ing process into the
  selinfo structure, actually record a pointer to the thread.  To
  avoid dereferencing a bad address all the selinfo structures that
  are in use by a thread are kept in a list hung off the thread
  (protected by sellock).  When a selwakeup occurs the selinfo is
  removed from that threads list, it is also removed on the way out
  of select or poll where the thread will traverse its list removing
  all the selinfos from its own list.

Problem:
  Previously the PROC_LOCK was used to provide the mutual exclusion
  needed to ensure proper locking, this couldn't work because there
  was a single condvar used for select and poll and condvars can
  only be used with a single mutex.
Solution:
  Introduce a global mutex 'sellock' which is used to provide mutual
  exclusion when recording events to wait on as well as performing
  notification when an event occurs.

Interesting note:
  schedlock is required to manipulate the per-thread TDF_SELECT
  flag, however if given its own field it would not need schedlock,
  also because TDF_SELECT is only manipulated under sellock one
  doesn't actually use schedlock for syncronization, only to protect
  against corruption.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc
2002-03-14 01:32:30 +00:00
mckusick
670fad8a9e This corrects the first of two known deadlock conditions that
come from the presence of a snapshot file.
2002-03-14 01:21:13 +00:00
dfr
a679e26ad5 Don't restore r13 when returning to kernel mode. We may have migrated to
a different cpu since the exception_save and r13 needs to point at the
current cpu's pcpu structure.
2002-03-14 00:28:10 +00:00
green
9a5e1dcf21 Rename SI_SUB_MUTEX to SI_SUB_MTX_POOL to make the name at all accurate.
While doing this, move it earlier in the sysinit boot process so that the
VM system can use it.

After that, the system is now able to use sx locks instead of lockmgr
locks in the VM system.  To accomplish this, some of the more
questionable uses of the locks (such as testing whether they are
owned or not, as well as allowing shared+exclusive recursion) are
removed, and simpler logic throughout is used so locks should also be
easier to understand.

This has been tested on my laptop for months, and has not shown any
problems on SMP systems, either, so appears quite safe.  One more
user of lockmgr down, many more to go :)
2002-03-13 23:48:08 +00:00
rwatson
0de282ee42 DBA update: pick the right DBA for various LOMAC copyrights. 2002-03-13 22:55:20 +00:00
des
4b05a4140f Remove a bogus cast and deconstification that broke the Alpha kernel build. 2002-03-13 19:16:41 +00:00
des
3f3959c142 Back out previous commit, it was the wrong patch! 2002-03-13 19:13:41 +00:00
des
9d36319658 Remove a bogus cast that breaks the Alpha kernel build due to -Werror. 2002-03-13 19:12:31 +00:00
imp
93a919ffc1 Add 5th parameter to pci_read_device specifying the size of the object
to create.
2002-03-13 16:32:11 +00:00
nyan
dfdd4c8eb4 Use the dx register for the destination port address. A immediate port
address of outb is only 8 bits.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	3 days
2002-03-13 13:59:41 +00:00
nyan
d58e833adf MFi386: revision 1.502 2002-03-13 13:45:00 +00:00
ru
bb48189d63 Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)
2002-03-13 11:03:36 +00:00
ru
4eb95bc05a Further document "console" (nullconsole). 2002-03-13 10:55:22 +00:00
luigi
d4a3339ee0 Add a readonly sysctl variable of type string, kern.bootp_cookie,
which is initialized with whatever string a dhcp/bootp server passes
as vendor tag 134.
There is no standard tag that I know with this information, and
no vendor-defined tag that applies to FreeBSD that I could find
doing the same thing.

The intended use is to pass information to userland for run-time
configuration of a diskless client without having to run a bootp/dhcp
client for the third time (after the one in pxeboot/etherboot, and
the one in the kernel bootp), also because these clients generally
screwup the interface configuration, which is not exactly what you
want when you have your disks nfs-mounted.

Manpage update to follow soon.

MFC-after: 3 days
2002-03-13 09:23:11 +00:00
jake
87daf4df50 Fix ifdef LOCORE protection. 2002-03-13 06:04:36 +00:00
jake
31419a58a4 Add a DEBUGGER_ON_POWERFAIL option. This makes the power button on ultra 10s
work like an NMI button.
2002-03-13 05:58:45 +00:00
jake
b767cbaa7a Fix braino. 2002-03-13 05:54:00 +00:00
imp
9da090c4c4 Cleanup the recent cardbus cleanups. This fixes some of the panics
that I introduced with -v.  However, other problems still remain (including
the loss of interrupts).
2002-03-13 05:38:19 +00:00
jake
97430a03ac Add support for starting and stopping cpus with ipis.
Stop the other cpus when shutting down or entering the debugger.

Submitted by:	tmm
2002-03-13 04:59:01 +00:00
jake
89751e20c2 Use intr_disable/intr_restore instead of doing it manually.
Submitted by:	tmm
2002-03-13 04:43:45 +00:00
jake
2b8f2f82cf Add support for driving the clocks on secondary cpus.
Submitted by:	tmm
2002-03-13 04:38:33 +00:00
jake
ddffcffd5c Fix a bug where the wrong number of windows were copied for a failed fill
on return to user mode.  We may not have frame pointers setup for more
than 1 on return from exec.
2002-03-13 04:02:27 +00:00
jake
bfa19e6a1a White space. 2002-03-13 03:55:28 +00:00
jake
df6db29bae Make IPI_WAIT use a bit mask of the cpus that a pmap is active on and only
wait for those cpus, instead of all of them by using a count.  Oops.
Make the pointer to the mask that the primary cpu spins on volatile, so
gcc doesn't optimize out an important load.  Oops again.
Activate tlb shootdown ipi synchronization now that it works.  We have
all involved cpus wait until all the others are done.  This may not be
necessary, it is mostly for sanity.
Make the trigger level interrupt ipi handler work.

Submitted by:	tmm
2002-03-13 03:43:00 +00:00
jake
6ee80641df Add an ATOMIC_CLEAR_INT macro.
Submitted by:	tmm
2002-03-13 03:28:47 +00:00
jake
3e90296a6b Use the deo hosted toolchain by default. 2002-03-13 03:23:17 +00:00
jake
75eda3b107 LABELOFFSET is 128 for sparc64.
Submitted by:	tmm
Forgotten by:	obrien
2002-03-13 03:17:29 +00:00
archie
4ff8306186 Add realloc() and reallocf(), and make free(NULL, ...) acceptable.
Reviewed by:	alfred
2002-03-13 01:42:33 +00:00
dfr
c9a75e90ac Only i386 has wbinvd(). 2002-03-12 09:45:17 +00:00
jeff
e6d26e8880 This patch adds the "LOCKSHARED" option to namei which causes it to only acquire shared locks on leafs.
The stat() and open() calls have been changed to make use of this new functionality.  Using shared locks in
these cases is sufficient and can significantly reduce their latency if IO is pending to these vnodes.  Also,
this reduces the number of exclusive locks that are floating around in the system, which helps reduce the
number of deadlocks that occur.

A new kernel option "LOOKUP_SHARED" has been added.  It defaults to off so this patch can be turned on for
testing, and should eventually go away once it is proven to be stable.  I have personally been running this
patch for over a year now, so it is believed to be fully stable.

Reviewed by:	jake, obrien
Approved by:	jake
2002-03-12 04:00:11 +00:00
peter
e65affeb45 Fix some -Wunused warnings by "using" a macro argument 2002-03-12 00:19:14 +00:00
peter
ff3e7533a6 Fix a warning (make ucontext_t *ucp a const) 2002-03-12 00:18:20 +00:00
peter
3e0ebce93d Stop concatenating __func__ with strings 2002-03-12 00:17:45 +00:00
peter
49ade32a5c Deal with a structure member rename in a recent acpica import 2002-03-12 00:15:57 +00:00
peter
bce3d7f621 Do not concatenate __func__ with strings, because it is not a string.
Later gcc's blow up on this.
2002-03-12 00:15:06 +00:00
peter
4bd977bea6 Do not do string concatenation with __func__ (which is not a string) 2002-03-12 00:12:59 +00:00
peter
e19329dfa6 Recent acpica imports have changed the lengths from UINT32 to ACPI_SIZE,
which is 64 bit on ia64.  Fix it.
2002-03-12 00:10:40 +00:00
brooks
593f3e9668 Add support for 3Com Airconnect PCI cards.
MFC after:	3 days
2002-03-11 23:29:59 +00:00
phk
3e53a43775 First commit of the GEOM subsystem to make it easier for people to
test and play with this.

This is not yet production quality and should be run only on dedicated
test boxes.

For people who want to develop transformations for GEOM there exist a
set of shims to run geom in userland (ask phk@freebsd.org).

Reports of all kinds to: phk@freebsd.org
Please include in report:
        dmesg
        sysctl debug.geomdot
        sysctl debug.geomconf

Known significant limitations:
        no kernel dump facility.
        ioctls severely restricted.

Sponsored by:   DARPA, NAI Labs
2002-03-11 21:42:35 +00:00
sos
2bbd43c8f1 Add new support for locking an ATA channel and use that throughout
the ATA/ATAPI driver. This solves the concurrency problem with
the new GEOM code, and also cuts a good deal of the patch size
in the upcoming MFC.
2002-03-11 21:04:32 +00:00
jhb
fb6b9eab60 Fix a misspelling of mine: s/optomization/optimization/.
Noticed by:	bmilekic
2002-03-11 19:58:53 +00:00
jhb
88fca29c1b Grrr, turn preemption back off on the alpha again. It is still not stable.
Noticed by:	wilko, mjacob, jhb, peter, and others
2002-03-11 19:35:10 +00:00
iedowse
cf446bea56 Fix a bug in ufsdirhash_adjfree() that caused it to incorrectly
update the free-space statistics in some cases. The problem affected
directory blocks when the free space dropped below the size of the
maximum allowed entry size. When this happened, the free-space
summary information could claim that there are no further blocks
that can fit a maximum-size entry, even if there are.

The effect of this bug is that the directory may be enlarged even
though there is space within the directory for the new entry. This
wastes disk space and has a negative impact on performance.

Fix it by correctly computing the dh_firstfree array index, adding
a helper macro for clarity. Put an extra sanity check into
ufsdirhash_checkblock() to detect the situation in future.

Found by:	dwmalone
Reviewed by:	dwmalone
MFC after:	1 week
2002-03-11 19:13:22 +00:00
imp
a5126a967f On FreeBSD make usb_proc_t the same as d_thred_t always. 2002-03-11 16:38:53 +00:00
phk
2098322771 I missed one VOP_CLOSE in the previous commit.
Pointed out by:	bde
2002-03-11 16:27:04 +00:00
joe
4e03c97b1d Be more specific about when block major numbers disappeared from
the cdev switch.
2002-03-11 16:22:15 +00:00
phk
c68bd5ed71 As a XXX bandaid open the mounted device READ/WRITE even if we only mount
read-only.

The trouble here is that we don't reopen the device in read/write mode
when we remount in read/write mode resulting in a filesystem sending
write requests to a device which was only opened read/only.

I'm not quite sure how such a reopen would best be done and defer
the problem to more agile hackers.
2002-03-11 13:53:00 +00:00
phk
19d3c15d79 Remove use of the bogus ioctl DIOCGPART.
It was used to initialize an unused variable, because ext2fs was
copy&pasted from UFS rather than copy,paste&cleaned from UFS.

Suggested by:	bde
2002-03-11 10:11:00 +00:00