Commit Graph

51340 Commits

Author SHA1 Message Date
Warner Losh
a4aef7f9a4 We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
Warner Losh
4c16ce4d87 No need to generate vnode_if.h anymore 2004-12-29 08:44:30 +00:00
Warner Losh
7fcb3efbe0 Move WINBOND 4 port hub to its proper location in the file. It belongs
in a section of its own, not arbitrarily grouped in the hawking section
just because hawking sells it...
2004-12-29 06:21:41 +00:00
Alan Cox
956d03da83 Eliminate (now) unnecessary acquisition and release of the global page
queues lock.
2004-12-29 04:49:10 +00:00
Alan Cox
7aa2190c8e Access to the page's busy field is (now) synchronized by the containing
object's lock.  Therefore, the assertion that the page queues lock is held
can be removed from vm_page_io_start().
2004-12-29 04:18:22 +00:00
David E. O'Brien
51799eec6c Add the Winbond made Hawking UH104 4-port hub.
Add a note where to find the offical USB assigned numbers.
2004-12-29 02:09:19 +00:00
Julian Elischer
2f37e02978 Rewrite ehci_abort_xfer() to use the method hinted at in the EHCI spec.
to remove a transaction from the async schedule. The previous method didn't
work well and led to the hardware writing to free'd buffers etc, as
it didn't always know that the transaction had been aborted.

Written after consultation with David Brownell who wrote the Linux
EHCI driver.

As part of this give the sqh structure a "previous" pointer.

MFC after:	1 week
2004-12-29 01:21:18 +00:00
John Birrell
4f2a7ca189 Pass an explicit pointer to the bus structure in the 'usb' device ivar
rather than a softc pointer (with the bus structure at the start).

This is a non-functional change. It just helps when reading the code to
know that the ehci, ohci and uhci drivers share the bus structure, not the
entire softc.
2004-12-28 22:17:10 +00:00
Pawel Jakub Dawidek
7f456a7d61 Remove debug code. 2004-12-28 21:52:45 +00:00
John Baldwin
83ae089aab - Up the WITNESS_COUNT macro from 200 to 1024 to support the growing number
of lock types in the kernel.  This results in an increase of witness
  data usage from ~145k to ~280k on i386 for kernels with
  'options WITNESS'.
- Remove the unused witness malloc bucket.

Submitted by:	Michal Mertl mime at traveller dot cz (1)
2004-12-28 21:21:27 +00:00
Gleb Smirnoff
92d7d5b445 - Plug a memory leak in ng_netflow_cache_init().
- Initialize error to 0 in ng_netflow_flow_add() (a nop change).
- Update cache statistics holding workqueue mutex.

MFC after:	3 days
2004-12-28 12:11:32 +00:00
Peter Grehan
b8e106eadd Don't probe for a disk unless explicitly enabled by a tunable.
This allows boot to proceed on a real system until the issue
of calling back into certain OpenFirmware calls (e.g. finddevice)
in thread context is understood.

(this commit only affects psim users, of which I think I am the
only one...)
2004-12-28 05:07:49 +00:00
Roman Kurakin
d676cb6fad Add FR support to sppp (MFCronyx).
Silence on: net@, current@, hackers@.
No objections: joerg

Requested by: by many (mostly Cronyx) users for a long long time.
MFC after:	10 days

PR:		kern/21771, kern/66348
2004-12-28 00:07:57 +00:00
Warner Losh
ece5e04f54 nos->now typo reported by njl 2004-12-27 18:58:57 +00:00
Warner Losh
0441898817 Add note about where major numbers are now assigned 2004-12-27 18:21:39 +00:00
Warner Losh
9b01161ec3 Formatting nits 2004-12-27 18:18:38 +00:00
Pawel Jakub Dawidek
88b5b78d59 Rewrite piece of code which I committed some time ago that allows to
show file name for 'mdconfig -l -u <x>' command.
This allows to preserve API/ABI compatibility with version 0 (that's why
I changed version number back to 0) and will allow to merge this change
to RELENG_5.

MFC after:	5 days
2004-12-27 17:20:06 +00:00
Pawel Jakub Dawidek
77fc70c1ef Fix mbuf leak.
Submitted by:	Johnny Eriksson <bygg@cafax.se>
MFC after:	5 days
2004-12-27 15:53:44 +00:00
Robert Watson
6ce8940626 Attempt to slightly refine the print out from "show alllocks" -- list
the process and thread numbers/names on the same line rather than on
separate lines, and print the thread pointer not just the tid.
2004-12-27 10:47:08 +00:00
Warner Losh
b2e1ce3c5f Remove duplicate CHPRODUCTS entry.
Use tab religiously in the vendor section.
2004-12-27 06:58:05 +00:00
Nate Lawson
36bd442095 MFi386: Restore cpu_reset proxy code to enable reset from ddb on an AP. 2004-12-27 06:42:25 +00:00
Nate Lawson
593fbddfba Reduce diffs to i386. 2004-12-27 06:35:42 +00:00
Nate Lawson
4260b00a7c Restore the cpu_reset proxy code. It is needed if you want to reset the
system from an AP at runtime (i.e., calling cpu_reset from ddb).  Someday,
if we move to an NMI for stopping cpus instead, we can do away with this.

Requested by:	jhb
2004-12-27 06:15:03 +00:00
Nate Lawson
2f3f3112c8 Minor cleanup: Reduce stack usage in probe method. Outdent probe. Use
TRUE/FALSE instead of 1/0 for booleans.  Remove trailing and extra whitespace.
2004-12-27 05:42:32 +00:00
Nate Lawson
d05fa56bb3 Remove trailing whitespace. 2004-12-27 05:36:47 +00:00
Alan Cox
91f7a86064 Note that access to the page's busy count is synchronized by the containing
object's lock.
2004-12-27 05:27:59 +00:00
Alexander Kabaev
aa6f98d12f Do not vput(9) unlocked vnode and do not VREF it with the sole purpose
of vputting it back immediately.

Complained by:	DEBUG_VFS_LOCKS
2004-12-27 05:17:11 +00:00
Jeff Roberson
2ebf8eb132 - Unintentionally checked in a debugging panic. Remove that. 2004-12-26 23:21:48 +00:00
Jeff Roberson
36996b3b7c - Remove a 4BSD specific hack since this will work on ULE too. 2004-12-26 22:56:51 +00:00
Jeff Roberson
598b368d6c - Fix a long standing problem where an ithread would not honor sched_pin().
- Remove the sched_add wrapper that used sched_add_internal() as a backend.
   Its only purpose was to interpret one flag and turn it into an int.  Do
   the right thing and interpret the flag in sched_add() instead.
 - Pass the flag argument to sched_add() to kseq_runq_add() so that we can
   get the SRQ_PREEMPT optimization too.
 - Add a KEF_INTERNAL flag.  If KEF_INTERNAL is set we don't adjust the SLOT
   counts, otherwise the slot counts are adjusted as soon as we enter
   sched_add() or sched_rem() rather than when the thread is actually placed
   on the run queue.  This greatly simplifies the handling of slots.
 - Remove the explicit prevention of migration for ithreads on non-x86
   platforms.  This was never shown to have any real benefit.
 - Remove the unused class argument to KSE_CAN_MIGRATE().
 - Add ktr points for thread migration events.
 - Fix a long standing bug on platforms which don't initialize the cpu
   topology.  The ksg_maxid variable was never correctly set on these
   platforms which caused the long term load balancer to never inspect
   more than the first group or processor.
 - Fix another bug which prevented the long term load balancer from working
   properly.  If stathz != hz we can't expect sched_clock() to be called
   on the exact tick count that we're anticipating.
 - Rearrange sched_switch() a bit to reduce indentation levels.
2004-12-26 22:56:08 +00:00
Robert Watson
b6dd9ef2fe Add "show alllocks" command to DDB, which dumps a list of processes
and threads currently holding sleep mutexes (and spin mutexes for
curthread).  This can be quite useful in looking for a lock condition
summary for a system, as it avoids manually iterating through threads
and processes to find all the interesting locks.

NB: "alllocks" is up there with "lockedvnods" for a bad argument for
show.

MFC after:	2 weeks
2004-12-26 22:52:24 +00:00
Alan Cox
40198b3c04 Assert that the vm object is locked on entry to vm_page_sleep_if_busy();
remove some unneeded code.
2004-12-26 21:46:44 +00:00
Roman Kurakin
47095f775f tsleep => msleep
read sys/kern/kern_synch.c, msleep ():

	KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL,
	    ("sleeping without a mutex"));

MFC after:	3 days
2004-12-26 20:47:41 +00:00
Wilko Bulte
51391ce93b LCA is 21066 and 21068. Add EV7 (bloody optimist.. :) 2004-12-26 13:23:01 +00:00
Darren Reed
4541c49f79 * Remove some code that's in a #ifndef FreeBSD that's no longer used. 2004-12-26 09:09:29 +00:00
Darren Reed
2fb1eb06a7 * The #ifdef's to cause mutex's for freebsd to be declared were meant to pick
up on USE_MUTEX being defined, but this patch
* Remove some code that's in a #ifndef FreeBSD that's no longer used.
2004-12-26 09:08:42 +00:00
Warner Losh
255bc0be62 More minor diff reduction against netbsd:
ADVANCELOGIC->AVANCELOGIC (nothing in the tree uses it, so safe to do)
sort HAGIWARA vendor entry
sort ACTIONTAR vendor entry
Minor change to SYSTEMTALKS vendor entry.
2004-12-26 07:48:46 +00:00
Jeff Roberson
6a98702001 - Run sched_userret() after thread_userret(). Before, sched_userret() would
lower the priority of the returning thread to a user priority before
   calling into thread_userret() which would call wakeup() which in turn would
   cause the returning thread to eventually context switch rather than
   completing its slice.  Allowing this thread to complete its slice first
   yields a 15% performance improvement in super-smack on my dual opteron with
   4BSD.
2004-12-26 07:30:35 +00:00
Warner Losh
37705f86ba Minor merges from NetBSD (up through 1.388):
Add $NetBSD$ in a comment at the top
Update copyright dates
Update header comment
Add some of the entries not present in FreeBSD's usbdevs file
Harmonize some descriptions with NetBSD where NetBSD's were shorter

More work needs to happen here, as there's many conflicting vendor
names.  There's also more harmonization that can happen before that
problem is tackled.

This was inspired by recent discussions, but none of the patches
posted were consulted to produce this commit.  Other, similar ones
will follow.
2004-12-26 07:14:55 +00:00
Bosko Milekic
7b8712053c Add my copyright and update Jeff's copyright on UMA source files,
as per his request.

Discussed with: Jeffrey Roberson
2004-12-26 00:35:12 +00:00
Jeff Roberson
907bdbc288 - Wrap the thread count adjustment in sched_load_add() and sched_load_rem()
so that we may place some ktr entries nearby.
 - Define other KTR_SCHED tracepoints so that we may graph the operation
   of the scheduler.
2004-12-26 00:16:24 +00:00
Jeff Roberson
81d47d3f4b - Remove earlier KTR_ULE tracepoints.
- Define new KTR_SCHED points so that we can graph the operation of the
   scheduler.
2004-12-26 00:15:33 +00:00
Jeff Roberson
85da7a569b - Define KTR points for KTR_SCHED. 2004-12-26 00:14:21 +00:00
Jeff Roberson
49407925c5 - Add KTR_SCHED to produce ktr data for sys/tools/sched/schedgraph.py. 2004-12-26 00:13:38 +00:00
Robert Watson
74d4630b71 Remove an errant blank line apparently introduced in
ip_output.c:1.194.
2004-12-25 22:59:42 +00:00
Robert Watson
42cf3289c3 In the dropafterack case of tcp_input(), it's OK to release the TCP
pcbinfo lock before calling tcp_output(), as holding just the inpcb
lock is sufficient to prevent garbage collection.
2004-12-25 22:26:13 +00:00
Robert Watson
e0bef1cb35 Revert parts of tcp_input.c:1.255 associated with the header predicted
cases for tcp_input():

While it is true that the pcbinfo lock provides a pseudo-reference to
inpcbs, both the inpcb and pcbinfo locks are required to free an
un-referenced inpcb.  As such, we can release the pcbinfo lock as
long as the inpcb remains locked with the confidence that it will not
be garbage-collected.  This leads to a less conservative locking
strategy that should reduce contention on the TCP pcbinfo lock.

Discussed with: sam
2004-12-25 22:23:13 +00:00
Poul-Henning Kamp
475e8cc394 fix comment 2004-12-25 21:30:41 +00:00
Pawel Jakub Dawidek
a245a5483c - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-25 19:17:47 +00:00
David Xu
c180db2bce Make _umtx_op() as more general interface, the final parameter needn't be
timespec pointer, every parameter will be interpreted by its opcode.
2004-12-25 13:02:50 +00:00
David Xu
8b37fbabb4 1. introduce umtx_owner to get an owner of a umtx.
2. add const qualifier to umtx_timedlock and umtx_timedwait.
3. add missing blackets in umtx do_unlock_and_wait.
2004-12-25 12:49:35 +00:00
Julian Elischer
587161d920 Allow selection of a recording source on USB audio devices.
PR:		75316
Submitted by:	Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
Obtained from:	NetBSD plus changes
MFC after:	2 weeks
2004-12-25 08:55:52 +00:00
Julian Elischer
65046f8612 Allow recording on at least some USB audio devices.
PR:		75311
Submitted by:	Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
Obtained from:	NetBSD plus changes
MFC after:	2 weeks
2004-12-25 08:51:47 +00:00
Julian Elischer
2baaf9c206 Allow volume control on more channels/inputs
PR:		75276
Submitted by:	Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
Obtained from:	NetBSD  with changes
MFC after:	2 weeks
2004-12-25 08:46:03 +00:00
Julian Elischer
d28a81455e MFNetBSD:
One of a set of patches submitted by  Kazuhito HONDA
	to make the usb audio driver a lot more capable.

PR:	75274
Submitted by:	Kazuhito HONDA (kazuhito at ph dot noda dot tus dot ac dot jp)
Obtained from:	NetBSD (indirectly)
MFC after:	2 weeks
2004-12-25 06:20:49 +00:00
Scott Long
98331badc2 Darnit, through a maze of twisty passages, ipfilter needs to have PFIL_HOOKS
defined.  Revert part of the previous commit to fix this.
2004-12-25 00:48:27 +00:00
Scott Long
4a8ad3dabd Don't define PFIL_HOOKS. It's no longer required in RELENG_5 or HEAD. 2004-12-25 00:23:36 +00:00
Scott Long
0ca8ae1641 Sprinkle in some __FreeBSD_version checks so that this compiles again. Don't
define PFIL_HOOKS anymore.

Submitted by: keramida
2004-12-25 00:22:25 +00:00
Warner Losh
812fb8f294 Get rid of #ifdef for legacy system. Move that into the MD code.
Export minimal symbols to allow this to happen.
2004-12-24 23:03:17 +00:00
Warner Losh
09aafea1c6 A few style(9) changes before more extensive changes:
o u_intXX_t -> uintXX_t
o use 8 character tabs
o proper wrapping
o return (value);
2004-12-24 22:31:47 +00:00
Warner Losh
934bd5ede9 Make the other pnp messages more explicit as well... 2004-12-24 22:18:19 +00:00
Warner Losh
2e63992f34 Note when we're done probing PNP. There's been several reports over the
years of hangs that turned out to be in the PNP code.  Add an explicit end
marker so such hangs are more apparent.
2004-12-24 22:16:06 +00:00
Warner Losh
7a83aa6339 Various style(9) items before of some more extensive work:
o return (value);
o u_intXX_t -> uintXX_t
o break lines
o consistantly use 8 space tab stops
o minor grammar nits in a few printfs
2004-12-24 22:08:57 +00:00
Warner Losh
b4e9316e7b GC #if 0'd code. It can go away now... 2004-12-24 21:53:21 +00:00
Alan Cox
a51b084059 Continue the transition from synchronizing access to the page's PG_BUSY
flag and busy field with the global page queues lock to synchronizing their
access with the containing object's lock.  Specifically, acquire the
containing object's lock before reading the page's PG_BUSY flag and busy
field in vm_fault().

Reviewed by: tegge@
2004-12-24 19:31:54 +00:00
Scott Long
c628825b30 Identify USIIIi processors.
Submitted by: Gavin Atkinson
PR: 75468
2004-12-24 16:21:46 +00:00
Max Laier
b9c5f41258 Enable sk(4) for ATLQ.
Thoroughly tested by:	Ender <ender NO tog SPAM net>
MFC after:		4 weeks
2004-12-24 14:13:38 +00:00
Søren Schmidt
5bcdf70082 Loosen the probe a bit.
Try to get out of probing as early as possible on (hopefully) vacant
channels.
2004-12-24 13:38:25 +00:00
Søren Schmidt
0f9c0db3d0 Update the Promise support for combo (SATA+PATA) controllers. 2004-12-24 13:36:04 +00:00
David Xu
3dd213f160 Add umtxq_lock/unlock around umtx_signal, fix debug kernel compiling,
let umtx_lock returns EINTR when it returns ERESTART, this lets
userland have chance to back off mtx lock code when needed.
2004-12-24 11:59:20 +00:00
David Xu
a08c214a72 1. Fix race condition between umtx lock and unlock, heavy testing
on SMP can explore the bug.
2. Let umtx_wake returns number of threads have been woken.
2004-12-24 11:30:55 +00:00
Darren Reed
77bb8ca4a3 Enable fine grained locking within IPFilter, using mtx(9) and sx(9) allowing
the the "needs giant" flag to be removed from the driver.
2004-12-24 09:14:26 +00:00
Roman Kurakin
ff08c098f2 Fix creation on "dlciX" hook in ng_sample.
Approved by:	julian
MFC after:	3 days
2004-12-23 22:03:32 +00:00
Paul Saab
72af302481 Turn NFS directio off until the stability issues are resolved. 2004-12-23 21:30:30 +00:00
Pawel Jakub Dawidek
538ff5ee7a Update disk->d_genid field when increasing sc->sc_genid. 2004-12-23 21:15:15 +00:00
John Baldwin
8c938cc290 - Give the timer, thermal, and error LVT entries an interrupt vector even
though these aren't used yet.
- Add missing function prototypes for some static functions.
- Allow lvt_mode() to handle an LVT entry with a delivery mode of fixed.
- Consolidate code duplicated in lapic_init() and lapic_setup() to program
  the spurious vector register of a local APIC in a static lapic_enable()
  function.
- Dump the timer, thermal, error, and performance counter LVT entries
  during lapic_dump().
- Program LVT pins (currently only LINT0 and LINT1) after the local
  APIC has been software enabled via lapic_enable() since otherwise the
  LVT programming will not be able to unmask LVT sources.
2004-12-23 20:42:53 +00:00
John Baldwin
4cddb026bb Some small style fixes. 2004-12-23 20:35:51 +00:00
John Baldwin
e367f46738 Add some constants for the local APIC timer. 2004-12-23 20:35:07 +00:00
John Baldwin
21bc8faa44 Add a simple 'intrcnt_add' function that other MD code can use to add a
single named counter to the interrupt counts without having to fake up an
entire interrupt source.
2004-12-23 20:34:18 +00:00
Alan Cox
1f70d62298 Modify pmap_enter_quick() so that it expects the page queues to be locked
on entry and it assumes the responsibility for releasing the page queues
lock if it must sleep.

Remove a bogus comment from pmap_enter_quick().

Using the first change, modify vm_map_pmap_enter() so that the page queues
lock is acquired and released once, rather than each time that a page
is mapped.
2004-12-23 20:16:11 +00:00
John Baldwin
dfa7bc486b - Add a function to set the Task Priority Register (TPR) of the local APIC.
Currently this is only used to initiailize the TPR to 0 during initial
  setup.
- Reallocate vectors for the local APIC timer, error, and thermal LVT
  entries.  The timer entry is allocated from the top of the I/O interrupt
  range reducing the number of vectors available for hardware interrupts
  to 191.  Linux happens to use the same exact vector for its timer
  interrupt as well.  If the timer vector shared the same priority queue
  as the IPI handlers, then the frequency that the timer vector will
  eventually be firing at can interact badly with the IPIs resulting in
  the queue filling and the dreaded IPI stuck panics, hence it being located
  at the top of the previous priority queue instead.
- Fixup various minor nits in comments.
2004-12-23 19:47:59 +00:00
Roman Kurakin
880904c323 Fix counting length of leadin for hook name (sizeof () => strlen ()).
Approved by:    julian
MFC after:      3 days
2004-12-23 18:39:13 +00:00
Gleb Smirnoff
8e853a2c74 Move systm.h up, since it is required by mbuf.h.
Requested by:	ru
2004-12-23 13:09:37 +00:00
Gleb Smirnoff
77a58296d8 - sort includes
- remove duplicate include sys/sysctl.h
2004-12-23 10:48:10 +00:00
Warner Losh
2969a6a9d6 Add recognition of O2Micro 711M1.
Submitted by: Gordon Bergling
2004-12-23 05:28:36 +00:00
Robert Watson
0fddf92d72 Assert the sem lock in sem_ref() and sem_rel(), as it is required to
safely manipulate the reference count.
2004-12-23 02:22:47 +00:00
Robert Watson
452d9f5b1c Attempt to consistently use () around return values in calls to
return() in newer code (sysctl, ISN, timewait).
2004-12-23 01:34:26 +00:00
Robert Watson
06da46b241 Remove an XXXRW comment relating to whether or not the TCP timers are
MPSAFE: they are now believed to be.

Correct a typo in a second comment.

MFC after:	2 weeks
2004-12-23 01:27:13 +00:00
Robert Watson
db0aae38b6 Remove the now unused tcp_canceltimers() function. tcpcb timers are
now stopped as part of tcp_discardcb().

MFC after:	2 weeks
2004-12-23 01:25:59 +00:00
Robert Watson
950ab1e470 Remove an annotation of a minor race relating to the update of
multiple MIB entries using sysctl in short order, which might
result in unexpected values for tcp_maxidle being generated by
tcp_slowtimo.  In practice, this will not happen, or at least,
doesn't require an explicit comment.

MFC after:	2 weeks
2004-12-23 01:21:54 +00:00
Robert Watson
38e6a58c77 Remove temporary debugging printf that was used to detect the presence
of a race that had previously caused a panic in order to determine if
the fix was for the right problem.  It was.

MFC after:	2 weeks
2004-12-23 01:19:27 +00:00
Robert Watson
1ef121cf6b In sonewconn(), the s/if/while/ change to wait for room at the tail of
the accept queue is a feature, not a bug/issue, so remove the XXXRW
from the comment.
2004-12-23 01:16:21 +00:00
Robert Watson
ba65391172 Remove an XXXRW indicating atomic operations might be used as a
substitute for a global mutex protecting the socket count and
generation number.

The observation that soreceive_rcvoob() can't return an mbuf
chain is a property, not a bug, so remove the XXXRW.

In sorflush, s/existing/previous/ for code when describing prior
behavior.

For SO_LINGER socket option retrieval, remove an XXXRW about why
we hold the mutex: this is correct and not dubious.

MFC after:	2 weeks
2004-12-23 01:07:12 +00:00
Robert Watson
81b5dbecd4 In soalloc(), simplify the mac_init_socket() handling to remove
unnecessary use of a global variable and simplify the return case.
While here, use ()'s around return values.

In sodealloc(), remove a comment about why we bump the gencnt and
decrement the socket count separately.  It doesn't add
substantially to the reading, and clutters the function.

MFC after:	2 weeks
2004-12-23 00:59:43 +00:00
Pawel Jakub Dawidek
9a9f504132 - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Add version change history.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-22 23:09:32 +00:00
Alan Cox
7abe2ac214 Add send buffer locking to uipc_send(). Without this locking a race can
occur between a reader and a writer that results in a panic upon close,
e.g.,
	"panic: sbflush_locked: cc 4 || mb 0xffffff0052afa400 || mbcnt 0"

Reviewed by: rwatson@
MFC after: 2 weeks
2004-12-22 20:28:46 +00:00
Poul-Henning Kamp
f62f3a1121 Include fcntl.h
Include selinfo.h (don't rely on vnode.h to do so)
Check O_NONBLOCK instead of IO_NELAY
Don't include vnode.h
2004-12-22 17:39:21 +00:00
Poul-Henning Kamp
9eaed5e66e Don't include filedesc.h
Include fcntl.h
Include selinfo.h (don't rely on vnode.h to do so)
Check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h
2004-12-22 17:38:43 +00:00
Poul-Henning Kamp
e76eee5562 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY
Include uio.h
Don't include vnode.h
Don't include filedesc.h
2004-12-22 17:37:57 +00:00
Poul-Henning Kamp
40b5a6f2c6 Include uio.h
Check O_NONBLOCK instead if IO_NDELAY
Don't include vnode.h
2004-12-22 17:37:14 +00:00
Poul-Henning Kamp
559ea98d34 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY.
Include selinfo.h instead of relying on vnode.h to do so.
Don't include vnode.h
2004-12-22 17:36:38 +00:00
Poul-Henning Kamp
4114357bf9 Include fcntl.h
check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h.
2004-12-22 17:35:52 +00:00
Poul-Henning Kamp
0b6db26c6c Include fcntl.h
check O_NONBLOCK instead of IO_NDELAY
don't include vnode.h
2004-12-22 17:34:53 +00:00
Poul-Henning Kamp
e22b0e7682 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h
2004-12-22 17:34:25 +00:00
Poul-Henning Kamp
27d7317dda Check O_NONBLOCK instead of IO_NDELAY.
Don't include <sys/vnode.h>
2004-12-22 17:32:53 +00:00
Poul-Henning Kamp
d214c67938 Fix comment. 2004-12-22 17:32:27 +00:00
Poul-Henning Kamp
7df050f9a8 Don't include vnode.h.
Check O_NONBLOCK instead of IO_NDELAY
2004-12-22 17:31:44 +00:00
Poul-Henning Kamp
ba7cd7b68a Don't include vnode.h 2004-12-22 17:31:10 +00:00
Poul-Henning Kamp
1ef0fc1d09 Include fcntl.h not vnode.h.
Include uio.h instead of relying on vnode.h to do so.
Check O_NONBLOCK not IO_NDELAY.
2004-12-22 17:30:38 +00:00
Poul-Henning Kamp
4c4a94cefe Check O_NONBLOCK not IO_NDELAY.
Don't include vnode.h
2004-12-22 17:29:37 +00:00
Poul-Henning Kamp
fe8fab266b #include fcntl.h not vnode.h. Check O_NONBLOCK not IO_NDELAY. 2004-12-22 17:29:02 +00:00
Poul-Henning Kamp
c04c3e007f #include of <sys/vnode.h> not necesary. 2004-12-22 17:28:34 +00:00
Poul-Henning Kamp
50a36c111f Be consistent about flag values passed to device drivers read/write
methods:

Read can see O_NONBLOCK and O_DIRECT.

Write can see O_NONBLOCK, O_DIRECT and O_FSYNC.

In addition O_DIRECT is shadowed as IO_DIRECT for now for backwards
compatibility.
2004-12-22 17:05:44 +00:00
Poul-Henning Kamp
10eee285f7 Shuffle numeric values of the IO_* flags to match the O_* flags from
fcntl.h.

This is in preparation for making the flags passed to device drivers be
consistently from fcntl.h for all entrypoints.

Today open, close and ioctl uses fcntl.h flags, while read and write
uses vnode.h flags.
2004-12-22 16:25:50 +00:00
Pawel Jakub Dawidek
4485f00081 Now, when force device destruction is done on shutdown, hide warning,
that device cannot be destroyed immediately, under debug=1.

Suggested by:	simon
2004-12-21 19:50:18 +00:00
Pawel Jakub Dawidek
d97d5ee931 Improve reliability and clean up code a bit.
For more details check src/sys/geom/mirror/g_mirror.c rev.1.47,1.48,1.49,1.50.
2004-12-21 19:30:59 +00:00
Alan Cox
ead42fc389 Use vtopde() instead of pmap_pde() in pmap_kextract(); vtopde() is smaller
and faster in cases, such as pmap_kextract(), where the pde is known to
exist.
2004-12-21 19:25:56 +00:00
Pawel Jakub Dawidek
f663832b75 This should not be permitted, but some GEOM classes held the topology lock
while doing g_(read|write)_data() (e.g. BSD). This can cause a deadlock
in MIRROR class. Not sure if this is safe to drop the topology lock in BSD
class, so change the code in MIRROR class to avoid this deadlock.
2004-12-21 18:42:51 +00:00
Pawel Jakub Dawidek
54bab03f04 Implement g_topology_try_lock().
No objection from:	phk
2004-12-21 18:32:46 +00:00
Ruslan Ermilov
cbbdcac72a NOFORTH -> NO_FORTH 2004-12-21 12:32:15 +00:00
Olivier Houchard
e1e6b9d3c6 - The IQ80321 has a jumper which changes the PCI device id from 4 to 8 for the
GigE controller, so handle this.
- Use the outbound window 0 if the PCI mem requested is in its range, instead
of inconditionally use the outbound window 1.
This should be enough to get FreeBSD/arm to work on the IQ80321 board as well.

Reported and tested by: Jia-Shiun Li <jiashiun at gmail dot com>
2004-12-21 11:36:09 +00:00
Ruslan Ermilov
731db6a428 NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
Ruslan Ermilov
a216173556 NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
Ruslan Ermilov
83c7ade90a NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Peter Grehan
d626a8a238 GEOMify the OFW disk driver. Code taken unashamedly from
the preload case in dev/md/md.c.
2004-12-21 02:23:35 +00:00
David E. O'Brien
f91067a36e Protect the NM expansion. 2004-12-21 02:08:14 +00:00
David E. O'Brien
939000cf95 Fix a mis-sort. 2004-12-21 02:07:38 +00:00
Poul-Henning Kamp
72e8dfe5a0 Hide/remove various printfs, now that root mounting doesn't seem to explode
on people.
2004-12-20 21:59:25 +00:00
Poul-Henning Kamp
118253ca24 fix a misleading sleep identifier. 2004-12-20 21:38:13 +00:00
Poul-Henning Kamp
e87047b437 We can only ever get to vgonechrl() from a devfs vnode, so we do not
need to reassign the vp->v_op to devfs_specops, we know that is the
value already.

Make devfs_specops private to devfs.
2004-12-20 21:34:29 +00:00
Julian Elischer
efba049184 Oops, this one isn't ready
back it out until fixed
2004-12-20 21:17:22 +00:00
Poul-Henning Kamp
2c0220129d Add a couple of KASSERTS to try to diagnose a problem reported. 2004-12-20 21:12:11 +00:00
Julian Elischer
f1e27f62c1 Add a bunch of USB definitions from NetBSD.
This is part of an ongoing cycle of commits on all the BSDs to
merge the USB vendor and device defintions..

A merge from OpenBSD is still pending.

Submitted by:	barry bouwsma (freebsd-misuser@NOSPAM.dyndns.dk)
Obtained from:	NetBSD
MFC after: 1 week
2004-12-20 20:41:55 +00:00
Julian Elischer
b3ea468624 Merge in a bunch of USB device and manufacturer definitions..
Submitted by:	barry bouwsma (freebsd-misuser@NOSPAM.dyndns.dk)
Obtained from:	Dragonfly
MFC after:	3 days
2004-12-20 20:10:57 +00:00
Nate Lawson
8c702862e4 Only use the current value if there's one IRQ. Some systems return
multiple IRQs (which is nonsense for _CRS) when the link hasn't been
programmed.  Before, this was a KASSERT.  A ServerWorks system was
seen returning IRQs of 0, 2 in response to _CRS before link setup.
Thanks to sam@ for quick testing and turnaround on this.

Tested by:	sam
2004-12-20 10:46:56 +00:00
Maxime Henrion
4ed53076ed Only try to use the 82503 serial interface for the 82557 chipsets. The
datasheet says it is only valid for such chipsets and shouldn't be used
with others.  This fixes some 82559 based cards which otherwise only
work at 10Mbit.

MFC after:	5 days
Tested by:	krion
2004-12-20 10:18:21 +00:00
Bjoern A. Zeeb
969e69711e Enable jumbo frames on Yukon variants of sk(4).
In contrast to OpenBSD we enable jumbo frame support
depending on MTU setting (like done for xmac).

Approved by:	pjd (mentor)
Obtained from:	OpenBSD if_sk.c r1.52 (YU_SMR_MFL_JUMBO flag)
Tested by:	Heinz Knocke <knockefreebsd at o2 dot pl>
MFC after:	5 days
2004-12-20 10:07:12 +00:00
Nate Lawson
54640fac34 Only report a critical battery level once until it's gone non-critical.
An improvement would be to check all batteries for critical state before
printing a message.

Reported by:	Kevin Oberman (oberman at es net)
2004-12-20 05:03:41 +00:00
Sam Leffler
67e4db771c add ancillary wlan modules and fixup comments
Requested by:	silby
2004-12-20 04:22:41 +00:00
Pawel Jakub Dawidek
dc7d54e7b3 Remove unused variables. 2004-12-19 23:55:49 +00:00
Pawel Jakub Dawidek
a2a7b44de0 - Argument 'flags' in g_mirror_destroy_consumer() function is unsed -
mark it as such.
- Before closing consumer check if it is open. It can be closed here
  when g_mirror_connect_disk() fails on g_access().
2004-12-19 23:33:59 +00:00
Pawel Jakub Dawidek
9eec299fab Some major cleanups.
Keeping consumers open when device is closed is very hard. We need to
open consumers sometimes to update metadata, etc.
Many hacks was introduced in the past to made it possible. You cannot
be sure that you can open consumer for writing always, even if you think
it should be allowed. If one of the mirror components is for example da0
and you try to open it, you can get EPERM when da0s1 is opened for reading
(because BSD class opens consumers (da0) with an extra 'e' bit set).
Waiting for the events queue to be empty may do the trick, but it makes
code much uglier (as you cannot always call g_waitidle()), it doesn't
solve all edge cases and it can introduce deadlocks if there are events
in the queue that wait for gmirror.

I removed those hacks. Now all consumers are open r1w1e1 always, even if
device is closed. Maybe it is less clean from GEOM perspective, but simpify
code a lot and make it much more reliable.
The only issue was retaste event which is sent when we close consumers
opened for writing. I ignore retaste event by not detaching consumer
immediately (so retaste event is not send to my class) and sending event
right after it to detach and destroy consumer.
2004-12-19 23:12:00 +00:00
Pawel Jakub Dawidek
c37e2f9bbf Don't quit on first failure, just skip failures. 2004-12-19 22:58:25 +00:00
Daniel Hartmeier
2726bbe221 Initialise init_addr in pf_map_addr() in the PF_POOL_ROUNDROBIN,
prevents a possible endless loop in pf_get_sport() with 'static-port'

ICMP state entries use the ICMP ID as port for the unique state key. When
checking for a usable key, construct the key in the same way. Otherwise,
a colliding key might be missed or a state insertion might be refused even
though it could be inserted. The second case triggers the endless loop,
possibly allowing a NATed LAN client to lock up the kernel.

PR:			kern/74930
Reported and tested by:	Hugo Silva, Srebrenko Sehic
MFC after:		3 days
2004-12-19 19:43:04 +00:00
Nate Lawson
6e0e5d3623 Move launching the worker thread from a SYSINIT to the first device's
attach.  This fixes the previous behavior where systems without hptmv
hardware always had a worker thread running.
2004-12-19 19:42:54 +00:00
Gleb Smirnoff
e5782a8c85 We already have ng_fec.4 manpage. And sys/modules is not a correct
place for documentation.
2004-12-19 16:06:14 +00:00
Gleb Smirnoff
d58e678f22 Assert queue mutex in ng_dequeue() and ng_queue_rw(). 2004-12-19 14:58:13 +00:00
Olivier Houchard
885dabe5f7 Update the StrongArm port to match the current code.
- Implement arm_mask_irqs and arm_unmask_irqs
- Provide the available physical address range after pmap_bootstrap allocated
things, instead or before, or bad things happen.
2004-12-18 17:58:49 +00:00
Olivier Houchard
31e3e209b1 Make sure gcc doesn't generate something such as swp r3, r4, [r3] for __swp,
as it has unpredictable results.
2004-12-18 17:43:01 +00:00
Maxim Sobolev
d579f3e4fe Add support for FC929X, which apparently is just a PCI-X version of FC929.
MFC after:	3 days
2004-12-18 16:49:54 +00:00
David Xu
839f811c6a 1. msleep returns EWOULDBLOCK not ETIMEDOUT, use EWOULDBLOCK instead.
2. Eliminate a possible lock leak in timed wait loop.
2004-12-18 13:43:16 +00:00
David Xu
50586e8b6b 1. make umtx sharable between processes, the way is two or more processes
call mmap() to create a shared space, and then initialize umtx on it,
   after that, each thread in different processes can use the umtx same
   as threads in same process.
2. introduce a new syscall _umtx_op to support timed lock and condition
   variable semantics. also, orignal umtx_lock and umtx_unlock inline
   functions now are reimplemented by using _umtx_op, the _umtx_op can
   use arbitrary id not just a thread id.
2004-12-18 12:52:44 +00:00
Max Laier
905c6b87b7 Make ip_nat compile again. Should read #if->n<-def LARGE_NAT as in ipf 4.x 2004-12-18 03:47:54 +00:00
Julian Elischer
53d4f8518a Slight change to formatting so that 'ctags' doesn't
give up on teh file half way through.. Might have been my
mistake earlier anyhow. No actual code change

MFC after:	5 days
2004-12-18 01:20:18 +00:00
Paul Saab
35ca8069a9 Add support for the 5721 which seems to be similar to the 5750/5751.
Tested by:	Vivek Khera vivek at khera dot org
2004-12-17 21:50:18 +00:00
Matthew N. Dodd
86906d256a Diff reduce wi_write_wep() relative to revision 1.168 2004-12-17 20:48:13 +00:00
Alan Cox
98fe9a0ddf Eliminate another unnecessary call to vm_page_busy(). (See revision 1.333
for a detailed explanation.)
2004-12-17 18:54:51 +00:00
Peter Wemm
d6ef0bf119 Recognize the 32-bit form of the twe binary passthrough ioctl()s so that
there is some hope for the 32-bit management utilities to run.  I've used
the cli successfully, but 3dm2 doesn't work for other reasons.  Of course,
a native binary of the 3dm2 and cli would be much better, but that doesn't
exist.
2004-12-17 17:45:29 +00:00
Alan Cox
06c98c5dcc Enable debug.mpsafevm by default on alpha. 2004-12-17 17:17:36 +00:00
Darren Reed
f42b5dbebb Move two variables that are unused if LARGE_NAT is defined inside an #ifdef
to keep them out of harms way when compiling.

PR:	72783
2004-12-17 15:59:16 +00:00
Sam Leffler
181ab45653 Fix wep operation for station mode:
o don't encapsulate on tx; the chip expect a raw frame w/o the crypto header
o clear the WEP bit in the 802.11 header on rx so the 802.11 layer doesn't
  try to strip the crypto header
o clobber the "drop unencoded frames" state bit when privacy is enabled so
  rx'd frames we pass up to the 802.11 layer are not discarded as unencrypted

This stuff will need to be redone if anyone decides to add WPA support.
2004-12-17 03:57:16 +00:00
Sam Leffler
14ae1a9deb set ic_ibss_chan when entering RUN state to match ic_bss so the channel
reported when associated to an AP is correct
2004-12-17 03:36:24 +00:00
John-Mark Gurney
86c9a45388 don't try to recurse on the bpf lock.. kqueue already locks the bpf lock
now...

Submitted by:	Ed Maste of Sandvine Inc.
MFC after:	1 week
2004-12-17 03:21:46 +00:00
Sam Leffler
407a27b151 remove power save logic from the tx path; the driver isn't ready to support
it so don't mislead folks
2004-12-17 03:05:30 +00:00
Darren Reed
8a377db272 Allow ipnat redirect rules to work for non-TCP/UDP packets.
PR:             70038
Submitted by:   fming@borderware.com
Reviewed by:    darrenr
Obtained from:  fming@borderware.com
2004-12-17 02:29:34 +00:00
Julian Elischer
5f15e3ac21 Add a missing prototype.
MFC after:	1 week
2004-12-17 00:25:56 +00:00
Julian Elischer
080bb7c1dd Allow /sys/dev/bktr to support Pinnacle PCTV Rave cards
PR:		73669
Submitted by:	arne_woerner at yahoo dot com
MFC after:	1 week
2004-12-16 23:37:41 +00:00
Julian Elischer
b7ad4d221a Add some locking for -currnet/5.x
PR:		74305
Submitted by:	Anish Mistry <amistry at am-productions dot biz>
MFC after:	1 week
2004-12-16 23:19:57 +00:00
Darren Reed
6de0f6c8b8 Using just m_pullup to get all of the interesting bits in packet into one
buffer doesn't work for ipv6 packets, so use m_defrag() here instead as an
easy drop-in replacement.

PR:	70399
2004-12-16 21:02:16 +00:00
Paul Saab
cb36cd34b8 Change the NFS sillyrename convention so that we won't run out
of sillyrenames (which were limited to 58 per pid per directory,
for no good reason). The new format of sillyrenames looks like

	.nfs.0000b31a.00d24.4
	     ^^^^^^^^ ^^^^^
	     ticks    pid

Submitted by:	Mohan Srinivasan mohans at yahoo-inc dot com
Obtained from:	Yahoo!
2004-12-16 19:28:37 +00:00
Sam Leffler
142c1941af fix typo to resolve undefined symbol
Spotted by:	Rong-En Fan <grafan at gmail.com>
2004-12-16 01:10:48 +00:00
John Baldwin
f5517dc887 Add a new flag to the atkbd(4) driver to disable testing the keyboard
port during the device probe as this can cause hangs on some machines,
specifically Compaq R3000Z series amd64 laptops.  The flag is bit 3, or
0x8.

PR:		amd64/67745
Reported by:	Neil Winterbauer newntrbr at ucla dot edu, many others
Tested by:	ade, astrodog at gmail dot com, many others
MFC after:	1 week
2004-12-15 23:00:47 +00:00
Paul Saab
a7500bceb0 First cut of NFS direct IO support.
- NFS direct IO completely bypasses the buffer and page caches.
  If a file is open for direct IO all caching is disabled.
- Direct IO for Directories will be addressed later.
- 2 new NFS directio related sysctls are added. One is a knob to
  disable NFS direct IO completely (direct IO is enabled by default).
  The other is to disallow mmaped IO on a file that has at least one
  O_DIRECT open (see the comment in nfs_vnops.c for more details).
  The default is to allow mmaps on a file that has O_DIRECT opens.

Submitted by:	Mohan Srinivasan mohans at yahoo-inc dot com
Obtained from:	Yahoo!
2004-12-15 22:20:22 +00:00
Alan Cox
85f5b24573 In the common case, pmap_enter_quick() completes without sleeping.
In such cases, the busying of the page and the unlocking of the
containing object by vm_map_pmap_enter() and vm_fault_prefault() is
unnecessary overhead.  To eliminate this overhead, this change
modifies pmap_enter_quick() so that it expects the object to be locked
on entry and it assumes the responsibility for busying the page and
unlocking the object if it must sleep.  Note: alpha, amd64, i386 and
ia64 are the only implementations optimized by this change; arm,
powerpc, and sparc64 still conservatively busy the page and unlock the
object within every pmap_enter_quick() call.

Additionally, this change is the first case where we synchronize
access to the page's PG_BUSY flag and busy field using the containing
object's lock rather than the global page queues lock.  (Modifications
to the page's PG_BUSY flag and busy field have asserted both locks for
several weeks, enabling an incremental transition.)
2004-12-15 19:55:05 +00:00
Sam Leffler
a37c415e66 fix m_append for case where additional mbufs are required 2004-12-15 19:04:07 +00:00
Ruslan Ermilov
b7b28d26c4 Fixed compilation warnings with option VGA_NO_MODE_CHANGE.
PR:		kern/71130
2004-12-15 13:49:25 +00:00
Christian Brueffer
44d086bde6 Fix typo in a comment.
MFC after:	3 days
2004-12-15 12:18:41 +00:00
Scott Long
ecefe5717e Add the PCI ID for the Adaptec 2230SLP card.
Submitted by: Ray Gilstrap
2004-12-15 07:03:21 +00:00
Suleiman Souhlal
4011d8a8c9 Use the SYSCTL_ADD_OID macro, instead of directly calling sysctl_add_oid().
Approved by:	anholt, grehan (mentor)
2004-12-15 06:22:33 +00:00
Peter Wemm
063896020b Like on the ath_rate_onoe component, make this compile on amd64. Convert
pointers to an integer via uintptr_t.

Fix an apparent bug that caused a compile failure.
ieee80211_iterate_nodes() takes ic->ic_sta as its first argument on the
onoe module.  It had just 'ic' here in the same context, which was a
mismatched argument.
2004-12-15 02:32:27 +00:00
Peter Wemm
6891c875c2 Make this amd64-clean. sizeof is long on amd64, so things that do a printf
of a sizeof, need to use %z to get the correct type on all our platforms.
Also, convert integers<->pointers via uintptr_t.

(I think Sam's instructions were for me to commit this.  If I
 misunderstood, then I apologize in advance.)
2004-12-15 02:25:21 +00:00
Peter Wemm
1556fbfc99 Add config hooks for amd64 atheros hal modules 2004-12-15 02:21:23 +00:00
Sam Leffler
0a16579959 bring in rijndael crypto code to satisfy dependency: should
break rijndael out into a separate module a la rc4 but several
other cases need to be fixed also so for now do as others do
2004-12-15 01:30:38 +00:00
Roman Kurakin
64715608d7 Bring back ability to use FR support with sppp from Cronyx. 2004-12-14 23:13:08 +00:00
Poul-Henning Kamp
a7e8286f28 white space 2004-12-14 21:35:00 +00:00
Poul-Henning Kamp
59d42685ad Implement simpler panics for VOP_{read,write} on fifos. 2004-12-14 21:30:45 +00:00
Poul-Henning Kamp
662d80dc23 Fix a deadlock I introduced this morning.
Mostly from:	tegge
2004-12-14 20:48:40 +00:00
Olivier Houchard
44dd466610 Enable interrupts once the active ones have been masked. 2004-12-14 18:57:21 +00:00
Olivier Houchard
353d54aa83 Update the sp after popping the regs.
This is a good candidate for the golden pointy hat awards.
2004-12-14 18:45:05 +00:00
Roman Kurakin
1fd90fb4a0 Kill double inclusion for <netinet/in.h> and <netinet/in_systm.h>. 2004-12-14 18:18:54 +00:00
Matthew N. Dodd
84339b16c1 Add a callout to dump card status on command queue timeouts. 2004-12-14 17:45:30 +00:00
Matthew N. Dodd
fc601c53dc Modify ida_v3_done() to treat FIFO status of -1 as FIFO empty (0).
This is what ida_v4_done() does and seems to be necessary with some
firmware versions on v3 devices.
2004-12-14 17:41:51 +00:00
Matthew N. Dodd
b75ab906bc Reformat arguments bus_dma_tag_create(). 2004-12-14 17:23:01 +00:00
Jeff Roberson
7842f65e7f - Garbage collect several unused members of struct kse and struce ksegrp.
As best as I can tell, some of these were never used.
2004-12-14 10:53:55 +00:00
Jeff Roberson
8ffb8f5558 - In kseq_choose(), don't recalculate slice values for processes with a
nice of 0.  Doing so can cause an infinite loop because they should be
   running, but a nice -20 process could prevent them from doing so.
 - Add a new flag KEF_PRIOELEV to flag a thread that has had its priority
   elevated due to priority propagation.  If a thread has had its priority
   elevated, we assume that it must go on the current queue and it must
   get a slice.
 - In sched_userret() if our priority was elevated and we shouldn't have
   a timeslice, yield here until we should.

Found/Tested by:	glebius
2004-12-14 10:34:27 +00:00
Poul-Henning Kamp
2a9e0c3216 Be a bit more assertive about vnode bypass. 2004-12-14 09:32:18 +00:00
Poul-Henning Kamp
d986dbb448 Add a new kind of reference count (fd_holdcnt) to struct filedesc
which holds on to just the data structure and the mutex.  (The
existing refcount (fd_refcnt) holds onto the open files in the
descriptor.)

The fd_holdcnt is protected by fdesc_mtx, fd_refcnt by FILEDESC_LOCK.

Add fdhold(struct proc *) which gets a hold on the filedescriptors of
the specified proc..

Add fddrop(struct filedesc *) which drops the fd_holdcnt and if zero
destroys the mutex and frees the memory.

Initialize the fd_holdcnt to one in fdinit().  Normal operations on
the filedesc structure will not change it.

In fdfree() use fddrop() to dispose of the mutex and structure.  Hold
the FILEDESC_LOCK() until we have cleaned out the contents and carefully
set the fields to null values during cleanup.

Use fdhold()/fddrop() in mountcheckdirs() and sysctl_kern_file().
2004-12-14 09:09:51 +00:00
Poul-Henning Kamp
30abaa53df Make fdesc_mtx private to kern_descrip.c now that the flock has come home. 2004-12-14 08:44:51 +00:00
Poul-Henning Kamp
12b18fdab4 Move the checkdirs() function from vfs_mount.c to kern_descrip.c and
call it mountcheckdirs().
2004-12-14 08:23:18 +00:00