Commit Graph

70726 Commits

Author SHA1 Message Date
jhb
9fbc6e93de Fix Giant leakage in several error cases in __semctl(). 2002-02-27 19:12:14 +00:00
jhb
9b6ed8b080 Add a comment about an unlocked access to p_ucred that will go away in
the near future.
2002-02-27 19:10:50 +00:00
jhb
522b437ab4 Use td_ucred and thus remove now unneeded proc lock acquire and release. 2002-02-27 19:09:30 +00:00
sobomax
3fcf72b6ba Use some black make(1) magic to make pkg_install build even without
Makefile.inc in parent directory (e.g. when checked out from cvs as a module).

MFC after:	2 weeks
2002-02-27 19:03:15 +00:00
alfred
3970e888bc kill __P. 2002-02-27 18:51:53 +00:00
alfred
fc10081bae add assertions in the places where giant is required to catch when
the pipe is locked and shouldn't be.

initialize pipe->pipe_mtxp to NULL when creating pipes in order not
to trip the above assertions.

swap pipe lock with giant around calls to pipe_destroy_write_buffer()

pipe_destroy_write_buffer issue noticed by: jhb
2002-02-27 18:49:58 +00:00
obrien
590885c10f Add lukemftpd to the mix. 2002-02-27 18:37:21 +00:00
obrien
a94b4230be Build LukeM's ftpd. 2002-02-27 18:35:26 +00:00
jhb
3706cd3509 Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
jhb
ec01b5bdbc Temporarily lock Giant while we update td_ucred. The proc lock doesn't
fully protect p_ucred yet so Giant is needed until all the p_ucred
locking is done.  This is the original reason td_ucred was not used
immediately after its addition.  Unfortunately, not using td_ucred is
not enough to avoid problems.  Since p_ucred could be stale, we could
actually be dereferencing a stale pointer to dink with the refcount, so
we really need Giant to avoid foot-shooting.  This allows td_ucred to
be safely used as well.
2002-02-27 18:30:01 +00:00
obrien
ce9dcc8784 Put the last added source file in proper order.
(and dcc the committer a dictionary)
2002-02-27 18:29:11 +00:00
silby
230f96f3ce Fix a horribly suboptimal algorithm in the vm_daemon.
In order to determine what to page out, the vm_daemon checks
reference bits on all pages belonging to all processes.  Unfortunately,
the algorithm used reacted badly with shared pages; each shared page
would be checked once per process sharing it; this caused an O(N^2)
growth of tlb invalidations.  The algorithm has been changed so that
each page will be checked only 16 times.

Prior to this change, a fork/sleepbomb of 1300 processes could cause
the vm_daemon to take over 60 seconds to complete, effectively
freezing the system for that time period.  With this change
in place, the vm_daemon completes in less than a second.  Any system
with hundreds of processes sharing pages should benefit from this change.

Note that the vm_daemon is only run when the system is under extreme
memory pressure.  It is likely that many people with loaded systems saw
no symptoms of this problem until they reached the point where swapping
began.

Special thanks go to dillon, peter, and Chuck Cranor, who helped me
get up to speed with vm internals.

PR:		33542, 20393
Reviewed by:	dillon
MFC after:	1 week
2002-02-27 18:03:02 +00:00
gioria
62c8af563f Adding Boot-loader translation 2002-02-27 17:57:49 +00:00
dwmalone
9540738a74 1) Remove -Wall from Makefile.
2) WARNs fixes (rename option to lookup_option to avoid shadowing, rename
   argv to argv1 to avoid shadowing, const stuff, prototypes, __unused).
3) Remove "register"s.
2002-02-27 17:57:00 +00:00
tmm
50b0eac362 Add gem and hme. 2002-02-27 17:46:04 +00:00
tmm
118f786ab3 Add a driver for the Sun GEM (Gigabit) and ERI (100 Mb/s) PCI ethernet
adaptors, ported from NetBSD.
2002-02-27 17:41:06 +00:00
gioria
edbabb0e3e Motherboard and processor translation 2002-02-27 17:38:17 +00:00
tmm
70f0ff084e Add a driver for the Sun HME PCI/SBus ethernet adaptor, which is onboard
in most machines of the Sun Ultra series. This is a port of the NetBSD
driver which I enhanced to make use of the gather functionality and the
configurable RX buffer offset to avoid copying all received/sent packet
(instead, packets will be directly DMAd from mbuf chains and into mbuf
clusters now).
2002-02-27 17:35:48 +00:00
alfred
3a862cdbbd Fix a NULL deref panic in pipe_write, we can't blindly lock
pipe->pipe_peer->pipe_mtxp because it may be NULL, so lock the
passed in pipe's mutex instead.
2002-02-27 17:23:16 +00:00
tmm
3ed05b7b89 Add the following functions/macros to support byte order conversions and
device drivers for bus system with other endinesses than the CPU (using
interfaces compatible to NetBSD):

- bwap16() and bswap32(). These have optimized implementations on some
  architectures; for those that don't, there exist generic implementations.
- macros to convert from a certain byte order to host byte order and vice
  versa, using a naming scheme like le16toh(), htole16().
  These are implemented using the bswap functions.
- stream bus space access functions, which do not perform a byte order
  conversion (while the normal access functions would if the bus endianess
  differs from the CPU endianess).

htons(), htonl(), ntohs() and ntohl() are implemented using the new
functions above for kernel usage. None of the above interfaces is currently
exported to user land.

Make use of the new functions in a few places where local implementations
of the same functionality existed.

Reviewed by:	mike, bde
Tested on alpha by:	mike
2002-02-27 17:16:18 +00:00
robert
e9d577adb2 Use the updated getcredhostname() function. 2002-02-27 16:55:30 +00:00
robert
b8e607ed84 Use the updated getcredhostname() function. 2002-02-27 16:47:27 +00:00
robert
a441b857b6 Make getcredhostname() take a buffer and the buffer's size
as arguments.  The correct hostname is copied into the buffer
while having the prison's lock acquired in a jailed process'
case.

Reviewed by:	jhb, rwatson
2002-02-27 16:43:20 +00:00
dwmalone
3de45f43ac 1) Don't use -Wall in Makefile.
2) Don't compile vendor ID.
3) WARNS=4 fixes (constness, make a global local to avoid shadowing, unused
   parameters, rename local to avoid shadowing, remove junk after #endif)
4) remove some "register"s.
2002-02-27 15:49:07 +00:00
robert
27b6691da3 - Use the new getcredhostname function in xenix_utsname(),
ibcs2_getipdomainname(), and ibcs2_utssys().

Reviewed by:	phk
2002-02-27 15:23:01 +00:00
dwmalone
316f120601 1) Move FreeBSD ID below vendor ID and don't compile vendor ID.
2) Cast some numbers we know to be positive to size_t before we MIN them
   with the result of a sizeof.
3) Compare result of inet_addr to INADDR_NONE, not -1.
2002-02-27 15:22:12 +00:00
robert
9df3ba1f33 - Use the new getcredhostname function in the SVR4 uname system call.
- Remove spurious empty line.

Reviewed by:	phk
2002-02-27 15:12:56 +00:00
robert
99ec5ad86f Use the getcredhostname function to fill the hostname into
the linux_newuname_args structure.  This should fix the case
of jailed linux processes not using the jail's hostname.

PR:		35336
Reviewed by:	phk
2002-02-27 15:06:33 +00:00
robert
1adc111a4d Add a function which returns the correct hostname for a given
credential.

Reviewed by:	phk
2002-02-27 14:58:32 +00:00
ru
3fbc1dd14e Preprocess with pic(1). 2002-02-27 14:57:54 +00:00
dwmalone
e743c5b66c Add missing "#include <string.h>" for memcmp, noticed by gcc3. 2002-02-27 14:56:58 +00:00
gioria
2cadadf393 Build fix.
Remember to hit me 42000 times with a stick and to repeat "I sould not commit before a zero warning build"
2002-02-27 14:48:18 +00:00
gioria
3785e08c6e MFen + Typos Fix 2002-02-27 14:44:35 +00:00
ru
ab0f432b2d Fixed a few typos. 2002-02-27 14:43:55 +00:00
dwmalone
af004a8a8f 1) Move FreeBSD tag to after vendor ID, #if 0 vendor ID.
2) Add missing include of stdlib.h for exit(), spotted by gcc3.
2002-02-27 14:40:09 +00:00
dwmalone
921c81b2d4 1) Remove blank line between include of sys/cdefs.h and __FBSDID
2) compare return value of inet_addr to INADDR_NONE rather than -1.
2002-02-27 14:32:43 +00:00
gioria
4a97e7fa66 Initial effort for the translation of the -CURRENT relnotes. Actually
just the kernel section is translated, a lot of features are added in
5.0.

So help is appreciate :-)
2002-02-27 14:26:07 +00:00
cjc
822f4e8381 Change the wording of the inline comments from the previous commit.
Objection from:	ru
2002-02-27 13:52:06 +00:00
alfred
d56a374cac MPsafe fixes:
use SYSINIT to initialize pipe_zone.
use PIPE_LOCK to protect kevent ops.
2002-02-27 11:27:48 +00:00
tanimura
002f46389d Return ESRCH if the target process is not inferior to the curproc.
Spotted by:	HIROSHI OOTA <oota@LSi.nec.co.jp>
2002-02-27 10:38:14 +00:00
alfred
d282438683 Don't hardcode /sys when making tags, instead use ${.CURDIR}/.. this
fixes a problem where one tries to make tags when the source isn't in
/sys.

Submitted by: Jihui Yang <yangjihui@yahoo.com>
2002-02-27 10:07:15 +00:00
peter
fd5a3329ee Re-fix a pointer/integer warning. 2002-02-27 09:58:06 +00:00
peter
f2dee2e96f Back out all the pmap related stuff I've touched over the last few days.
There is some unresolved badness that has been eluding me, particularly
affecting uniprocessor kernels.  Turning off PG_G helped (which is a bad
sign) but didn't solve it entirely.  Userland programs still crashed.
2002-02-27 09:51:33 +00:00
julian
fddda3307d Fix warnings that have become fatal
1/ conditionalise (#if 0) function that is not used.
 Unused code left in place for netBSD compatibility.
2/ Recode loop to convince gcc that it does initialise a variable
 (use do-while instead of for() so gcc knows that we always go through
 at least once.  Feel free to check my logic.
2002-02-27 09:16:00 +00:00
julian
3df0f76145 turn on the ethertype filter module 2002-02-27 08:54:13 +00:00
gj
42dd7b1157 Remove a redundant decalaration of call_desc[] since it's now a
fatal error.
2002-02-27 08:33:08 +00:00
alfred
98b979a712 First rev at making pipe(2) pipe's MPsafe.
Both ends of the pipe share a pool_mutex, this makes allocation
and deadlock avoidance easy.

Remove some un-needed FILE_LOCK ops while I'm here.

There are some issues wrt to select and the f{s,g}etown code that
we'll have to deal with, I think we may also need to move the calls
to vfs_timestamp outside of the sections covered by PIPE_LOCK.
2002-02-27 07:35:59 +00:00
jake
0f3fdcbf9d Minimal testing has shown that a 4 page tsb is a nice sweet spot for current
work loads.  It tapers off after that as gcc's working set generally just fits.

compiling bin/csh:

TSB_PAGES = 2
	213.33 real        77.59 user       110.01 sys
TSB_PAGES = 4
	116.43 real        75.78 user        19.16 sys
TSB_PAGES = 8
	119.27 real        76.38 user        18.12 sys

Testing by:	tmm
2002-02-27 06:18:02 +00:00
jake
e4a45ab17b Parameterize the number of pages to allocate for the per-cpu area on
PCPU_PAGES.
2002-02-27 06:08:13 +00:00
jake
c584d5961c Make cpu_identify take the value of the ver register and cpuid as arguments
so we can print nice things about non-current cpus.
2002-02-27 06:05:50 +00:00