Commit Graph

44813 Commits

Author SHA1 Message Date
John Baldwin
b71aa5f5e9 Set PCPU_GET(curpcb) for the BSP to thread0's pcb. Otherwise, the boot CPU
doesn't have a pcb until after it's first context switch.  This can cause
secondary panics if a page fault happens during bootup.
2004-02-02 23:22:24 +00:00
Andre Oppermann
b74d89bbbb Add sysctl net.inet.icmp.reply_src to specify the interface name
used for the ICMP reply source in reponse to packets which are not
directly addressed to us.  By default continue with with normal
source selection.

Reviewed by:	bms
2004-02-02 22:53:16 +00:00
Andre Oppermann
1488eac8ec More verbose description of the source ip address selection for ICMP replies.
Reviewed by:	bms
2004-02-02 22:17:09 +00:00
John Baldwin
9c9c52a3ed - Assert that witness_cold is not true in enroll().
- Only check witness_watch once in enroll().

Reported by:	ru (2)
2004-02-02 22:15:17 +00:00
Brooks Davis
ccb82468ac More macro cleanup. Use the system roundup2() macro instead of making
our own ROUNDUP() macro.

Suggested by:	bde
2004-02-02 21:55:34 +00:00
Paul Saab
65fd52fc8b Reserve 187 (twa) for the new 3ware ATA RAID controller. 2004-02-02 20:00:56 +00:00
Poul-Henning Kamp
0ed4f6a180 Allow a GEOM class to unload if it has no geoms or a method function to
get rid of them.

Prodded by:	pjd
2004-02-02 19:49:41 +00:00
Pawel Jakub Dawidek
3410b19324 Fix many issues related to mount/unmount:
1. Root from inside a jail was able to unmount any file system
   (except /).
2. Unprivileged root was able to unmount file systems mounted by
   privileged root (execpt /).
3. User from inside a jail was able to mount file system when
   sysctl vfs.usermount was set to 1.
4. User was able to mount file system when vfs.usermount was set to 1
   (that's ok) and unmount it even if vfs.usermount was equal to 0
   (that's not correct).

Possibility from point 1 was reported by: Dariusz Kowalski <darek@76.pl>

Only a part of this fix will be MFC'ed (if approved).

PR:		kern/60149
Reviewed by:	rwatson
Approved by:	scottl (mentor)
MFC after:	3 days
2004-02-02 19:02:05 +00:00
Pawel Jakub Dawidek
43a55a72ef Added flag MNT_USER to MNT_UPDATEMASK, it will be used for detecting
file systems mounted by unprivileged users.

Reviewed by:	rwatson
Approved by:	scottl (mentor)
MFC after:	3 days
2004-02-02 18:24:29 +00:00
Nate Lawson
322141f1e2 If the temperature is at _HOT or _CRT for 3 sequential readings, shutdown
the system.  Also, decrease the poll interval to 10 seconds from 30
seconds.  This is needed because some systems will report an invalid high
temperature for one poll cycle.  It is suspected this is due to the
embedded controller timing out.  A typical value is 138C for one cycle on a
system that is otherwise 65C.  This prevents the system from prematurely
shutting down after one invalid reading.  It will still shut down after 30
seconds of high temperature, which is the same as previous default
behavior.

Tested by:	Scott Lambert <lambert AT lambertfam.org>
2004-02-02 18:03:35 +00:00
Pawel Jakub Dawidek
cff2ddaeb2 - Use proper names in KASSERTs.
- Typos.

Approved by:	phk, scottl (mentor)
2004-02-02 17:50:09 +00:00
Poul-Henning Kamp
c740ae4b46 Add CRD_F_KEY_EXPLICIT which allows the key to be changed per
operation, just like it was possible to change the IV.

Currently supported on Hifn and software engines only.

Approved by:	sam@
2004-02-02 17:06:34 +00:00
Søren Schmidt
b8f6dec455 Move the enabling of interrupt back to where it was some time ago.
This apparently was what broke the boot with some devices (liteon).
2004-02-02 15:49:01 +00:00
MIHIRA Sanpei Yoshiro
e08f155b25 MFNetBSD: URL updates(rev.1.108) 2004-02-02 15:00:15 +00:00
Søren Schmidt
6595b49405 Fix support for the Promise TX4 on amd64.
Somehow the bridge on there shows up with another PCI id than
it does on x86, no idea why...
2004-02-02 14:05:57 +00:00
Poul-Henning Kamp
abc2e0fd56 Check error return from g_clone_bio(). (netchild@)
Rearrange code to avoid duplication (phk@)

Submitted by:	netchild@
2004-02-02 13:36:06 +00:00
Poul-Henning Kamp
3e5b686160 Check error return from g_clone_bio(). (netchild@)
Add XXX comment about why this is still not optimal. (phk@)

Submitted by:	netchild@
2004-02-02 13:08:03 +00:00
Poul-Henning Kamp
42fd931ee9 GC old unused dev_t mangling stuff. 2004-02-02 12:57:49 +00:00
Poul-Henning Kamp
793ffa8e55 Don't mingle malloc/g_event flags.
Spotted by:	pjd@
2004-02-02 10:58:07 +00:00
Jeff Roberson
fe5efaede8 - Make sure the apic is idle before sending an IPI. This is required on
non-X-APIC machines.  Previously this was only done in the
   DETECT_DEADLOCK case when really it is needed in all cases.

Reminded by:	jhb
2004-02-02 09:50:43 +00:00
Mike Silbersack
02ec600572 Remove debugging code that slipped into the previous commit.
Spotted by:	bde
2004-02-02 09:09:59 +00:00
Jeff Roberson
b209e5e3e4 - style fixes to the critical_exit() KASSERT().
Submitted by:	bde
2004-02-02 08:13:27 +00:00
Jeff Roberson
7b09539ce2 - Use a seperate startup function for the zeroidle kthread. Use this to
set P_NOLOAD prior to running the thread.
2004-02-02 07:51:03 +00:00
Peter Grehan
aa1985722c Add new Apple GEM PCI id. 2004-02-02 01:11:39 +00:00
David E. O'Brien
02c4c7b81f Remove a device that will compile fine, isn't 64-bit clean. 2004-02-02 00:54:59 +00:00
Robert Watson
91c2dc9478 Commit file missed in last pass: MAC api uses 'struct pipepair', not
'struct pipe' now.
2004-02-01 21:52:09 +00:00
Bill Paul
f0aed0dbd0 Use the OID_802_11_CONFIGURATION OID when deciding if the underlying driver
is for an 802.11 device or not. At least one driver I have does not
support the OID_802_11_NETWORK_TYPES_SUPPORTED OID.

Also, for now, don't do anything special in the ndis_suspend() method.
I originally wanted to shut down the NIC but leave the IFF_UP flag alone
since technically the interface is meant to remain up, but an interrupt
may be delivered to the ISR on suspend, and if this happens while the
NIC is halted, we will crash, since none of the miniport driver methods
will function.

This needs to be dealt with properly later, but for now this prevents
a panic, and the resume method properly re-inits the NIC.
2004-02-01 21:35:15 +00:00
Alan Cox
8600a4122a Eliminate all TLB shootdowns by pmap_pte_quick(): By temporarily pinning
the thread that calls pmap_pte_quick() and by virtue of the page queues
lock being held, we can manage PADDR1/PMAP1 as a CPU private mapping.

The most common effect of this change is to reduce the overhead of the page
daemon on multiprocessors.

In collaboration with:  tegge
2004-02-01 20:14:00 +00:00
Jeff Roberson
0392e39dff - Allow interactive tasks to use the maximum time-slice. This is not as
detrimental as I thought it would be in the case of massive process
   storms from a shell and it makes regular desktop usage noticeably
   better.
2004-02-01 10:38:13 +00:00
Mike Silbersack
beb699c7ba Rewrite sendfile's header support so that headers are now sent in the first
packet along with data, instead of in their own packet.  When serving files
of size (packetsize - headersize) or smaller, this will result in one less
packet crossing the network.  Quick testing with thttpd and http_load has
shown a noticeable performance improvement in this case (350 vs 330 fetches
per second.)

Included in this commit are two support routines, iov_to_uio, and m_uiotombuf;
these routines are used by sendfile to construct the header mbuf chain that
will be linked to the rest of the data in the socket buffer.
2004-02-01 07:56:44 +00:00
Jeff Roberson
f2f51f8ab8 - Disable ithread binding in all cases for now. This doesn't make as much
sense with sched_4bsd as it does with sched_ule.
 - Use P_NOLOAD instead of the absence of td->td_ithd to determine whether or
   not a thread should be accounted for in sched_tdcnt.
2004-02-01 06:20:18 +00:00
Jeff Roberson
aaa8bb1604 - Fix a problem where we did not drain the cache of buckets in the zone
when uma_reclaim() was called.  This was introduced when the zone
   working-set algorithm was removed in favor of using the per cpu caches
   as the working set.
2004-02-01 06:15:17 +00:00
Robert Watson
4795b82c13 Coalesce pipe allocations and frees. Previously, the pipe code
would allocate two 'struct pipe's from the pipe zone, and malloc a
mutex.

- Create a new "struct pipepair" object holding the two 'struct
  pipe' instances, struct mutex, and struct label reference.  Pipe
  structures now have a back-pointer to the pipe pair, and a
  'pipe_present' flag to indicate whether the half has been
  closed.

- Perform mutex init/destroy in zone init/destroy, avoiding
  reallocating the mutex for each pipe.  Perform most pipe structure
  setup in zone constructor.

- VM memory mappings for pageable buffers are still done outside of
  the UMA zone.

- Change MAC API to speak 'struct pipepair' instead of 'struct pipe',
  update many policies.  MAC labels are also handled outside of the
  UMA zone for now.  Label-only policy modules don't have to be
  recompiled, but if a module is recompiled, its pipe entry points
  will need to be updated.  If a module actually reached into the
  pipe structures (unlikely), that would also need to be modified.

These changes substantially simplify failure handling in the pipe
code as there are many fewer possible failure modes.

On half-close, pipes no longer free the 'struct pipe' for the closed
half until a full-close takes place.  However, VM mapped buffers
are still released on half-close.

Some code refactoring is now possible to clean up some of the back
references, etc; this patch attempts not to change the structure
of most of the pipe implementation, only allocation/free code
paths, so as to avoid introducing bugs (hopefully).

This cuts about 8%-9% off the cost of sequential pipe allocation
and free in system call tests on UP and SMP in my micro-benchmarks.
May or may not make a difference in macro-benchmarks, but doing
less work is good.

Reviewed by:	juli, tjr
Testing help:	dwhite, fenestro, scottl, et al
2004-02-01 05:56:51 +00:00
Jeff Roberson
40ece05382 - Revert rev 1.240 we no longer need a kthread for loadav(). 2004-02-01 05:37:36 +00:00
Jeff Roberson
e7f004fe23 - Use sched_load() rather than grabbing the sx lock and traversing the proc
table to discover the load.
2004-02-01 02:51:33 +00:00
Jeff Roberson
33916c360e - Add a new member to struct kseq called ksq_sysload. This is intended to
track the load for the sched_load() function.  In the SMP case this member
   is not defined because it would be redundant with the ksg_load member
   which already tracks the non ithd load.
 - For sched_load() in the UP case simply return ksq_sysload.  In the SMP
   case traverse the list of kseq groups and sum up their ksg_load fields.
2004-02-01 02:48:36 +00:00
Jeff Roberson
ca59f15272 - Keep a variable 'sched_tdcnt' that is used for the local implementation
of sched_load().  This variable tracks the number of running and runnable
   non ithd threads.  This removes the need to traverse the proc table and
   discover how many threads are runnable.
2004-02-01 02:46:47 +00:00
Jeff Roberson
b654d10049 - Add a sched API entry point that returns the system load. This load should
not include any ithreads.
 - Document the difference between sched_load() and sched_runnable() as they
   are very similar.
2004-02-01 02:44:35 +00:00
Robert Watson
fca542bcaa Move KASSERT regarding td_critnest to after the value of td is set to
curthread, to avoid warning and incorrect behavior.

Hoped not to mind:	jeff
2004-02-01 02:31:36 +00:00
Jeff Roberson
6767c6547b - Assert that td_critnest > 0 in critical_exit() to catch cases of
unbalanced uses of the critical_* api.
2004-02-01 01:24:54 +00:00
Robert Watson
26518e8d8c Fix an error in a KASSERT string: it's pipe_free_kmem(), not
pipespace(), that contains this KASSERT.
2004-01-31 23:03:22 +00:00
Takeshi Shibagaki
386a89ed83 Compiled longrun.c when defined options CPU_ENABLE_LONGRUN,
and fixed wrong comparation in cpu vendor. Longrun function
was re-enabled.
2004-01-31 20:14:44 +00:00
Warner Losh
20d6d1bd21 Add the Canon N1240U to the mix. It appears to be similar to the
1220U and supported by sane

# someone should update the man page to include all the devices that
# uscanner supports.
2004-01-31 18:12:18 +00:00
Poul-Henning Kamp
be8a62e821 Introduce the SO_BINTIME option which takes a high-resolution timestamp
at packet arrival.

For benchmarking purposes SO_BINTIME is preferable to SO_TIMEVAL
since it has higher resolution and lower overhead.  Simultaneous
use of the two options is possible and they will return consistent
timestamps.

This introduces an extra test and a function call for SO_TIMEVAL, but I have
not been able to measure that.
2004-01-31 10:40:25 +00:00
David E. O'Brien
f191a0bcf6 Bump the NFCv3/TCP defaults for rsize and wsize from 8K to 32K to match
Solaris and HP-UX.  This increases read performance for large files across NFS.

PR:		62024 & 26324
Submitted by:	Bjoern Groenvall <bg@sics.se>
2004-01-31 10:40:15 +00:00
Alan Cox
bfb7317ebf Remove unnecessary vm object reference and deallocate calls from ffs_read()
and ffs_write().  These calls trace their origins to the dead vfs_ioopt
code, first appearing in revision 1.39 of ufs_readwrite.c.

Observed by:	bde
Discussed with:	tegge
2004-01-31 05:42:58 +00:00
Søren Schmidt
367d380b54 Be more robust in the probe. We dont want to get into a loop with
reinitting when we try to identify devices. If they dont interrupt
on identify we retry once. If this fails we simply ignore that device.
2004-01-30 19:16:08 +00:00
Dag-Erling Smørgrav
e726bc0e6c Mechanical whitespace cleanup. 2004-01-30 16:26:29 +00:00
Hartmut Brandt
a1adb510b2 Use the official ng_timeout function to trigger sending. This means,
that we can get rid of of all the spl*() calls, because ng_timeout
handles the locking issues.
2004-01-30 15:34:57 +00:00
Hidetoshi Shimokawa
dbc80c7bf2 Add NEC uPD72873.
Submitted by: Christian Laursen <xi@borderworlds.dk>
2004-01-30 14:30:19 +00:00