Commit Graph

61949 Commits

Author SHA1 Message Date
Jeff Roberson
eddb4efacd - Don't let SCHED_TICK_TOTAL() return less than hz. This can cause integer
divide faults in roundup() later if it is able to return 0.  For some
   reason this bug only shows up on my laptop and not my testboxes.
2007-01-06 12:33:43 +00:00
Jeff Roberson
1e516cf534 - Fix the sched_priority() invalid priority bugs. Use roundup() instead
of max() when computing the divisor in SCHED_TICK_PRI().  This prevents
   cases where rounding down would allow the quotient to exceed
   SCHED_PRI_RANGE.
 - Garbage collect some unused flags and fields.
 - Replace TDF_HOLD with sched_pin_td()/sched_unpin_td() since it simply
   duplicated this functionality.
 - Re-enable the rebalancer by default and fix the sysctl so it can be
   modified.
2007-01-06 08:44:13 +00:00
Takanori Watanabe
230a9294b5 Restore agp aperture size after resume, in case it is modified after boot. 2007-01-06 08:31:31 +00:00
Matt Jacob
38da14963f Fix compile error. 2007-01-06 05:38:18 +00:00
Kip Macy
fe1903bcff fix declaration / definition mismatch with ieee80211_chan2ieee 2007-01-06 02:56:41 +00:00
Jeff Roberson
9330bbbb61 - Don't IPI unless we're going to interrupt something exiting in the kernel.
otherwise we can afford the latency.  This makes a significant performance
   improvement.
2007-01-06 02:34:23 +00:00
Jeff Roberson
155b6ca12b - Fix a comparison in sched_choose() that caused cpus to be constantly
marked idle, thus breaking cpu load balancing.
 - Change sched_interact_update() to fix cases where the stored history
   has expanded significantly rather than handling them in the callers.  This
   fixes a case where sched_priority() could compute a bad value.
 - Add a sysctl to disable the global load balancer for experimentation.
2007-01-05 23:45:38 +00:00
Matt Jacob
d4c8377f6c RELENG_6 compilation 2007-01-05 23:01:54 +00:00
Matt Jacob
5ccae6a508 error print cleanup && turn off ints if RISC is paused 2007-01-05 23:01:35 +00:00
Matt Jacob
450ca4603d Check the return from registering FC4 types with the fabric name
server.

Don't complain about a hard loop id of 0xffff- we get this in
point-to-point topologies with the 2300 and 2K Login firmware.

Up the timeout on register FC4 types commands.
2007-01-05 22:59:26 +00:00
Jung-uk Kim
afadbf66cb - Clean up Aperture Access Global Enable (APEN) bit access.
- Rename confusing AGP_INTEL_I845_MCHCFG to AGP_INTEL_I845_AGPM.
- Move E7205 and E7505 from i8x5 to i8x0 family.  It probably worked
because the actual offset is the same.

In fact, all three families have the bit at the exact same place.  Only
differences are name and width of the registers, i.e., NBXCFG (0x50, dword),
RDCR (0x51, byte), AGPM (0x51, byte), MCHCFG (0x50, word) depending on
the family of the chipsets.
2007-01-05 22:55:19 +00:00
Matt Jacob
a2baed9764 (commented out) multipath fault injection code.
Some code to make diffs with RELENG_6 easier.
2007-01-05 22:49:05 +00:00
Jung-uk Kim
ea9b97d2bd Fix style(9). 2007-01-05 20:06:40 +00:00
John Baldwin
9ae328fc8f - Close a race between enumerating UNIX domain socket pcb structures via
sysctl and socket teardown by adding a reference count to the UNIX domain
  pcb object and fixing the sysctl that enumerates unpcbs to grab a
  reference on each unpcb while it builds the list to copy out to userland.
- Close a race between UNIX domain pcb garbage collection (unp_gc()) and
  file descriptor teardown (fdrop()) by adding a new garbage collection
  flag FWAIT.  unp_gc() sets FWAIT while it walks the message buffers
  in a UNIX domain socket looking for nested file descriptor references
  and clears the flag when it is finished.  fdrop() checks to see if the
  flag is set on a file descriptor whose refcount just dropped to 0 and
  waits for unp_gc() to clear the flag before completely destroying the
  file descriptor.

MFC after:	1 week
Reviewed by:	rwatson
Submitted by:	ups
Hopefully makes the panics go away:	mx1
2007-01-05 19:59:46 +00:00
John Baldwin
663b416f16 - Add a new function uma_zone_exhausted() to see if a zone is full.
- Add a printf in swp_pager_meta_build() to warn if the swapzone becomes
  exhausted so that there's at least a warning before a box that runs out
  of swapzone space before running out of swap space deadlocks.

MFC after:	1 week
Reviwed by:	alc
2007-01-05 19:09:01 +00:00
Matt Jacob
05b2985d8e Another (minor) CAM_NEW_TRAN backport thingie, plus a slightly
closer to __FreeBSD_version comparison for this.
2007-01-05 17:51:33 +00:00
Takanori Watanabe
9043d2778b Make agp_intel capable to work after resume from S3 state. 2007-01-05 14:46:18 +00:00
Craig Rodrigues
dda4f444de Simplify code in union_hashins() and union_hashget() functions. These
functions now more closely resemble similar functions in nullfs.
This also eliminates some errors.

Submitted by:	daichi, Masanori OZAWA <ozawa ongs co jp>
2007-01-05 14:06:42 +00:00
Paolo Pisati
3d2fff0d3d Prevent adding a rule with a nat action in case IPFIREWALL_NAT was not defined.
Reviewed: luigi
2007-01-05 12:15:31 +00:00
Bernd Walter
03d0aa10bc Hints are handled differently on -current
Don't include hints.at91rm9200 for now
2007-01-05 10:30:51 +00:00
Jeff Roberson
8ab80cf009 - ftick was initialized to -1 for init and any of it's children. Fix this by
setting ftick = ltick = ticks in schedinit().
 - Update the priority when we are pulled off of the run queue and when we
   are inserted onto the run queue so that it more accurately reflects our
   present status.  This is important for efficient priority propagation
   functioning.
 - Move the frequency test into sched_pctcpu_update() so we don't repeat it
   each time we'd like to call it.
 - Put some temporary work-around code in sched_priority() in case the tick
   mechanism produces a bad priority.  Eventually this should revert to an
   assert again.
2007-01-05 08:50:38 +00:00
Craig Rodrigues
9170c87faa Eliminate obsolete comment, now that getushort() is implemented in
terms of functions in <sys/endian.h>.
2007-01-05 05:28:57 +00:00
Bernd Walter
dde6da66c5 MFp4: Use the next possible value for hz instead of defaulting to 128
Update tick value after modifying hz.
2007-01-05 02:52:06 +00:00
Bernd Walter
69b40f4db3 MFp4: Add missing atomic functions
Based on a patch by: des
2007-01-05 02:50:27 +00:00
Craig Rodrigues
98155f1f51 Eliminate ASSERT_VOP_ELOCKED panics when doing mkdir or symlink when
sysctl vfs.lookup_shared=1.

Submitted by:	daichi, Masanori OZAWA <ozawa ongs co jp>
2007-01-05 02:25:44 +00:00
Bernd Walter
ecfa9e8ded MFp4: add BWCT kernel configuration 2007-01-05 02:08:35 +00:00
Bernd Walter
2e54a4ac40 MFp4: Make at91_rtc optional to allow other RTC choices 2007-01-05 02:06:53 +00:00
Bernd Walter
5991458e2e MFp4: add basic driver for RTL8305SC switch in PHY emulation 2007-01-05 01:46:26 +00:00
Bernd Walter
05a3e0db5c MFp4: Read access require PDC to be setup first otherwise we might get
overrun errors.
	Write access however need cmd first, so keep the existing order
	for them.
2007-01-05 01:18:32 +00:00
Bernd Walter
f291c40a40 MFp4: BWCT boards are using an 16MHz xtal 2007-01-05 01:14:14 +00:00
Bernd Walter
bd55b92b0e MFp4: Add VLAN_MTU support 2007-01-05 01:07:59 +00:00
Bernd Walter
3bb40db608 MFp4: fix a race in transmit buffer handling 2007-01-05 01:01:14 +00:00
John Baldwin
4ed23cf283 - Use a regular mutex rather than a spin mutex. This driver doesn't need
a spin mutex since it doesn't have an INTR_FAST interrupt handler.
  Beyond that the driver is still under Giant anyway.
- Remove unneeded locking during attach across operations that can't be
  called with locks held (such as bus_dma_tag_create()).

MFC after:		1 week
Not objected to by:	scottl
2007-01-04 20:28:17 +00:00
Ariff Abdullah
048b52987d Fix headphone/speaker automute for Toshiba Satellite Pro U200.
Reported/Tested by:	keramida
2007-01-04 18:13:04 +00:00
Søren Schmidt
22fe2182e7 Add support for the Marvell 6101/6145 PATA chips used on many new Intel boards.
HW donated by:	Sentex
2007-01-04 16:09:11 +00:00
Jeff Roberson
3f872f85d2 - Only allow the tdq_idx to increase by one each tick rather than up to
the most recently chosen index.  This significantly improves nice
   behavior.  This allows a lower priority thread to run some multiple of
   times before the higher priority thread makes it to the front of
   the queue.  A nice +20 cpu hog now only gets ~5% of the cpu when running
   with a nice 0 cpu hog and about 1.5% with a nice -20 hog.  A nice
   difference of 1 makes a 4% difference in cpu usage between two hogs.
 - Track a seperate insert and removal index.  When the removal index is
   empty it is updated to point at the current insert index.
 - Don't remove and re-add a thread to the runq when it is being adjusted
   down in priority.
 - Pull some conditional code out of sched_tick().  It's looking a bit
   large now.
2007-01-04 12:16:19 +00:00
Jeff Roberson
cd49bb7047 - Don't pass a pointer into runq_choose_from(). The caller can adjust the
index if it chooses to.
2007-01-04 12:10:58 +00:00
Jeff Roberson
e7d50326de ULE 2.0:
- Remove the double queue mechanism for timeshare threads.  It was slow
   due to excess cache lines in play, caused suboptimal scheduling behavior
   with niced and other non-interactive processes, complicated priority
   lending, etc.
 - Use a circular queue with a floating starting index for timeshare threads.
   Enforces fairness by moving the insertion point closer to threads with
   worse priorities over time.
 - Give interactive timeshare threads real-time user-space priorities and
   place them on the realtime/ithd queue.
 - Select non-interactive timeshare thread priorities based on their cpu
   utilization over the last 10 seconds combined with the nice value.  This
   gives us more sane priorities and behavior in a loaded system as
   compared to the old method of using the interactivity score.  The
   interactive score quickly hit a ceiling if threads were non-interactive
   and penalized new hog threads.
 - Use one slice size for all threads.  The slice is not currently
   dynamically set to adjust scheduling behavior of different threads.
 - Add some new sysctls for scheduling parameters.

Bug fixes/Clean up:
 - Fix zeroing of td_sched after initialization in sched_fork_thread() caused
   by recent ksegrp removal.
 - Fix KSE interactivity issues related to frequent forking and exiting of
   kse threads.  We simply disable the penalty for thread creation and exit
   for kse threads.
 - Cleanup the cpu estimator by using tickincr here as well.  Keep ticks and
   ltick/ftick in the same frequency.  Previously ticks were stathz and
   others were hz.
 - Lots of new and updated comments.
 - Many many others.

Tested on:	up x86/amd64, 8way amd64.
2007-01-04 08:56:25 +00:00
Jeff Roberson
3fed7d239a - Add three new functions to support circular run queues.
- runq_add_pri allows the caller to position the thread at any rqindex
   regardless of priority.
 - runq_choose_from() chooses the lowest priority thread starting from a given
   index.  The index is updated with the rqindex of the chosen thread.  This
   routine is used to pick the lowest priority relative to a given index.
 - runq_remove_idx() updates the index if the run queue that held the removed
   thread is now empty.
2007-01-04 08:39:58 +00:00
Jeff Roberson
783af89c54 - Add SRQ_BORROWING to the list of switch reasons. ULE is the only consumer
at this time.  It is used to optimize the run queue placement of threads
   who have newly elevated priorities.
2007-01-04 08:36:40 +00:00
Søren Schmidt
a4b0727299 Add new PATA only JMicron chip. 2007-01-04 07:56:12 +00:00
Paolo Pisati
61c0e134f5 Wrap ipfw nat support in a new kernel config option named
"IPFIREWALL_NAT": this way nat is turned off by default and
POLA is preserved.

Reviewed by: rwatson
2007-01-03 11:12:54 +00:00
Luigi Rizzo
d64492c407 protect against multiple inclusion (this is useful when you
start working with third party usb modules, where sometimes it
is not easy to set the inclusion order so that there are no multiple
inclusions, yet you want to compile with high WARNS levels).

I am not sure if there is a standard for having a leading and/or trailing _
in the macro name, the usb code seems to use both.

There are still several unprotected headers here so it might be useful
to do the same thing on other files as well as the need arises.

MFC After: 3 days
2007-01-03 10:50:03 +00:00
Jeff Roberson
b1c00b13d6 - Fix schedgraph output with KSE threads. Call thread_switchout() after
calling CTR() so we don't confuse a new kse thread with a real preemption.
2007-01-03 02:38:41 +00:00
Hiroki Sato
9235ff6373 The nfsm_srvpathsiz() macro in nfsrv_symlink() in nfs_serv.c should
check length of the pathname in the range 0<=n<=NFS_MAXPATHLEN,
not 0<n<=NFS_MAXPATHLEN.  This fixes a minor interoperability problem
that the FreeBSD NFS server did not allow a symlink pointing the empty
pathname.

MFC after:	1 week
2007-01-02 20:42:08 +00:00
Julian Elischer
3b62120e87 Remove a bunch of dependencies in the IP header being the first thing in the
mbuf. First moves toward being able to cope better with having layer 2 (or
other encapsulation data) before the IP header in the packet being examined.
More commits to come to round out this functionality. This commit should
have no practical effect but clears the way for what is coming.
Revirewed by: luigi, yar
MFC After: 2 weeks
2007-01-02 19:57:31 +00:00
John Baldwin
b082761327 Use the vnode interlock to close a race where pfs_vncache_alloc() could
attempt to vn_lock() a destroyed vnode resulting in a hang.

MFC after:	1 week
Submitted by:	ups
Reviewed by:	des
2007-01-02 17:27:52 +00:00
David Xu
fe1a9506fa Fix compiling. 2007-01-02 04:14:01 +00:00
Scott Long
a91d6dab2e Make sure that all of the fields in the header are clean. It was possible for
unsafe flags to leak from one command to another.
2007-01-02 04:12:34 +00:00
Christian S.J. Peron
8d8d78c23d style(9) nit. Prefer struct[space]name[space]{ to make grep searches more
in line with that we find in the rest of the tree.
2007-01-01 21:49:39 +00:00