| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
nor uprintf() is believed to perform tsleep() or msleep() as written,
as ttycheckoutq() is called with '0' as its sleep argument.
Remove recently added WITNESS warnings for sleep as the comment was
incorrect. This should silence a warning from the nfs_timer() code.
Discussed with: bde
Notes:
svn path=/head/; revision=150370
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as they both interact with the tty code (!MPSAFE) and may sleep if the
tty buffer is full (per comment).
Modify all consumers of uprintf() and tprintf() to hold Giant around
calls into these functions. In most cases, this means adding an
acquisition of Giant immediately around the function. In some cases
(nfs_timer()), it means acquiring Giant higher up in the callout.
With these changes, UFS no longer panics on SMP when either blocks are
exhausted or inodes are exhausted under load due to races in the tty
code when running without Giant.
NB: Some reduction in calls to uprintf() in the svr4 code is probably
desirable.
NB: In the case of nfs_timer(), calling uprintf() while holding a mutex,
or even in a callout at all, is a bad idea, and will generate warnings
and potential upset. This needs to be fixed, but was a problem before
this change.
NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having
non-MPSAFE tty code.
MFC after: 1 week
Notes:
svn path=/head/; revision=150335
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
before prefixes.
Use cases:
printf("%05d", -42); --> "00-42" (should be "-0042")
printf("%#05x", 12); --> "000xc" (should be "0x00c")
Submitted by: Oliver Fromme
PR: kern/85520
MFC After: 1 week
Notes:
svn path=/head/; revision=149784
|
|
|
|
|
|
|
|
|
|
|
| |
remaining % arguments because the varargs are now out of sync and
there is a risk that we might for instance dereference an integer
in a %s argument.
Sponsored by: Napatech.com
Notes:
svn path=/head/; revision=149756
|
|
|
|
|
|
|
| |
MFC after: 3 days
Notes:
svn path=/head/; revision=147064
|
|
|
|
| |
Notes:
svn path=/head/; revision=144706
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
session in tprintf(). SESSRELE() needs to properly dispose of the
sessions mutex.
Add sessrele() which does the proper cleanup and have SESSRELE() call it.
Use SESSRELE also in pgdelete().
Found by: Coverity (ID:526)
Notes:
svn path=/head/; revision=143740
|
|
|
|
|
|
|
| |
o Check kdb_active instead of db_active and do so unconditionally.
Notes:
svn path=/head/; revision=131931
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add copyiniov() which copies a struct iovec array in from userland into
a malloc'ed struct iovec. Caller frees.
Change uiofromiov() to malloc the uio (caller frees) and name it
copyinuio() which is more appropriate.
Add cloneuio() which returns a malloc'ed copy. Caller frees.
Use them throughout.
Notes:
svn path=/head/; revision=131897
|
|
|
|
|
|
|
|
|
|
| |
output to permanently (not ephemerally) go to the console. It is also
sent to any other console specified by TIOCCONS as normal.
While I'm here, document the kern.log_console_output sysctl.
Notes:
svn path=/head/; revision=130700
|
|
|
|
|
|
|
|
|
| |
per letter dated July 22, 1999.
Approved by: core
Notes:
svn path=/head/; revision=127911
|
|
|
|
|
|
|
|
| |
Submitted by: Bruno Ducrot <ducrot AT poupinou.org>
Reviewed by: bde
Notes:
svn path=/head/; revision=125985
|
|
|
|
| |
Notes:
svn path=/head/; revision=123215
|
|
|
|
| |
Notes:
svn path=/head/; revision=117879
|
|
|
|
|
|
|
|
|
| |
it more than doubles the text size of this file.
GCC has wisely ignored us on this previously
Notes:
svn path=/head/; revision=117878
|
|
|
|
|
|
|
|
|
| |
console, even if there is a TIOCCONS console tty. We were already
doing this after a panic, but it's also useful when entering DDB
for some other reason too.
Notes:
svn path=/head/; revision=116664
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TIOCCONS console (e.g. xconsole) via a timeout routine instead of
calling into the tty code directly from printf(). This fixes a
number of cases where calling printf() at the wrong time (such as
with locks held) would cause a panic if xconsole is running.
The TIOCCONS message buffer is 8k in size by default, but this can
be changed with the kern.consmsgbuf_size sysctl. By default, messages
are checked for 5 times per second. The timer runs and the buffer
memory remains allocated only at times when a TIOCCONS console is
active.
Discussed on: freebsd-arch
Notes:
svn path=/head/; revision=116663
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with a new implementation that has a mostly reentrant "addchar"
routine, supports multiple message buffers in the kernel, and hides
the implementation details from callers.
The new code uses a kind of sequence number to represend the current
read and write positions in the buffer. This approach (suggested
mainly by bde) permits the read and write pointers to be maintained
separately, which reduces the number of atomic operations that are
required. The "mostly reentrant" above refers to the way that while
it is now always safe to have any number of concurrent writers,
readers could see the message buffer after a writer has advanced
the pointers but before it has witten the new character.
Discussed on: freebsd-arch
Notes:
svn path=/head/; revision=116660
|
|
|
|
| |
Notes:
svn path=/head/; revision=116182
|
|
|
|
|
|
|
|
|
| |
Remove break after goto
Found by: FlexeLint
Notes:
svn path=/head/; revision=115538
|
|
|
|
|
|
|
|
|
| |
the process and session. Instead, cache a true reference to the session
when we do the hold and release our reference on that session. This avoids
the need for the proc lock when dropping the reference.
Notes:
svn path=/head/; revision=113634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
time a character is written. Use this at boot time to reject the
existing buffer contents if they are corrupt. This fixes a problem
seen on some hardware (especially laptops) where the message buffer
gets partially corrupted during a short power cycle or reset, but
the msgbuf structure is left intact so it gets reused, resulting
in random junk and control characters appearing in dmesg and
/var/log/messages.
PR: kern/28497
Notes:
svn path=/head/; revision=112732
|
|
|
|
|
|
|
|
| |
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
Notes:
svn path=/head/; revision=112367
|
|
|
|
|
|
|
| |
Approved by: trb
Notes:
svn path=/head/; revision=111119
|
|
|
|
|
|
|
| |
argument for the kernel-special %r format.
Notes:
svn path=/head/; revision=110316
|
|
|
|
|
|
|
| |
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
Notes:
svn path=/head/; revision=109623
|
|
|
|
|
|
|
|
|
|
|
|
| |
so it's value is not sign extended when assigned to the uintmax_t variable
used internally by printf. For example, if bit 31 is set in the cpuid
feature word, then %b would print out the initial value as a 16 character
hexadecimal value. Now it only prints out an 8 character value.
Reviewed by: bde
Notes:
svn path=/head/; revision=108890
|
|
|
|
| |
Notes:
svn path=/head/; revision=108678
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
signed, since they describe a ring buffer and signed arithmetic is
performed on them. This avoids some evilish casts.
Since this changes all but two members of this structure, style(9)
those remaining ones, too.
Requested by: bde
Reviewed by: bde (earlier version)
Notes:
svn path=/head/; revision=106917
|
|
|
|
| |
Notes:
svn path=/head/; revision=106855
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Make DDB use %y instead of %z.
- Teach GCC about %y.
- Implement support for the C99 %z format modifier.
Approved by: re@
Reviewed by: peter
Tested on: i386, sparc64
Notes:
svn path=/head/; revision=105954
|
|
|
|
|
|
|
|
| |
Reviewed by: bde
Tested on: i386 in ddb
Notes:
svn path=/head/; revision=104924
|
|
|
|
|
|
|
|
|
| |
Spotte by: FlexeLint
Reviewed by: rwatson
Notes:
svn path=/head/; revision=104114
|
|
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=101693
|
|
|
|
|
|
|
|
| |
Obtained from: NetBSD
Reviewed by: jake, rwatson, bosko
Notes:
svn path=/head/; revision=99459
|
|
|
|
|
|
|
| |
Change struct knote's kn_hook from caddr_t to void *.
Notes:
svn path=/head/; revision=98998
|
|
|
|
| |
Notes:
svn path=/head/; revision=97751
|
|
|
|
| |
Notes:
svn path=/head/; revision=97750
|
|
|
|
|
|
|
|
|
| |
duplication. Also add support for 'n' specifier.
Reviewed by: bde
Notes:
svn path=/head/; revision=97749
|
|
|
|
|
|
|
|
| |
Approved by: phk
MFC after: 2 weeks
Notes:
svn path=/head/; revision=95713
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
general cleanup of the API. The entire API now consists of two functions
similar to the pre-KSE API. The suser() function takes a thread pointer
as its only argument. The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0. The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.
Discussed on: smp@
Notes:
svn path=/head/; revision=93593
|
|
|
|
| |
Notes:
svn path=/head/; revision=92723
|
|
|
|
| |
Notes:
svn path=/head/; revision=92069
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New locks are:
- pgrpsess_lock which locks the whole pgrps and sessions,
- pg_mtx which protects the pgrp members, and
- s_mtx which protects the session members.
Please refer to sys/proc.h for the coverage of these locks.
Changes on the pgrp/session interface:
- pgfind() needs the pgrpsess_lock held.
- The caller of enterpgrp() is responsible to allocate a new pgrp and
session.
- Call enterthispgrp() in order to enter an existing pgrp.
- pgsignal() requires a pgrp lock held.
Reviewed by: jhb, alfred
Tested on: cvsup.jp.FreeBSD.org
(which is a quad-CPU machine running -current)
Notes:
svn path=/head/; revision=91140
|
|
|
|
|
|
|
| |
Obtained from: ~bde/sys.dif.gz
Notes:
svn path=/head/; revision=90490
|
|
|
|
|
|
|
|
|
| |
beneath it.
Reviewed by: rwatson
Notes:
svn path=/head/; revision=89414
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the administrator to restrict access to the kernel message buffer.
It defaults to '1', which permits access, but if set to '0', requires
that the process making the sysctl() have appropriate privilege.
o Note that for this to be effective, access to this data via system
logs derived from /dev/klog must also be limited.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Notes:
svn path=/head/; revision=87150
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as being valid. Previously only the magic number and the virtual
address were checked, but it makes little sense to require that
the virtual address is the same (the message buffer is located at
the end of physical memory), and checks on the msg_bufx and msg_bufr
indices were missing.
Submitted by: Bodo Rueskamp <br@clabsms.de>
Tripped over during a kernel debugging tutorial given by: grog
Reviewed by: grog, dwmalone
MFC after: 1 week
Notes:
svn path=/head/; revision=86238
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
Notes:
svn path=/head/; revision=83366
|
|
|
|
|
|
|
|
| |
independent and rename the corresponding sysctls from machdep.msgbuf and
machdep.msgbuf_clear (i386 only) to kern.msgbuf and kern.msgbuf_clear.
Notes:
svn path=/head/; revision=79153
|