#
2bbada90 |
| 26-Feb-2009 |
Ed Schouten <ed@FreeBSD.org> |
Remove redundant assignment of `p'.
`p' is already initialized with `td->td_proc'. Because td is always curthread, it is safe to initialize it without any locks.
Found by: LLVM's scan-build
|
#
4592c621 |
| 03-Feb-2009 |
Warner Losh <imp@FreeBSD.org> |
Use NULL in preference to 0 for pointers.
|
Revision tags: release/7.1.0_cvs, release/7.1.0 |
|
#
3a4d0c86 |
| 21-Dec-2008 |
Ed Schouten <ed@FreeBSD.org> |
Revert r185891.
In r185891 I removed the newlines from messages written to /dev/console, because it made startup messages from rc-scripts harder to read. This, unfortunately, causes the kernel messa
Revert r185891.
In r185891 I removed the newlines from messages written to /dev/console, because it made startup messages from rc-scripts harder to read. This, unfortunately, causes the kernel message that is printed after a non-terminated log message to be concatenated.
This could be fixed, but on short term it's better to just revert the change.
Reported by: Jaakko Heinonen <jh saunalahti fi>
show more ...
|
#
d16ebcd4 |
| 10-Dec-2008 |
Ed Schouten <ed@FreeBSD.org> |
Remove added newlines from logged messages written to /dev/console.
The /dev/console device node logs all strings that are written to it. When the string does not contain a trailing newline, it appe
Remove added newlines from logged messages written to /dev/console.
The /dev/console device node logs all strings that are written to it. When the string does not contain a trailing newline, it appends one. I can imagine this was useful a long time ago, but with our current rc-scripts, it generates a whole bunch of messages that look like:
| Configuring syscons: | blanktime | .
By not appending the newlines, the output of `dmesg -a' is now (almost?) exactly the same as what the user will see on the console device (syscons, uart).
show more ...
|
#
e57c2b13 |
| 04-Dec-2008 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
integrate from head@185615
|
Revision tags: release/6.4.0_cvs, release/6.4.0 |
|
#
e1088cdc |
| 18-Nov-2008 |
Xin LI <delphij@FreeBSD.org> |
Obey signedness flag in %z case.
MFC after: 2 months
|
#
bc093719 |
| 20-Aug-2008 |
Ed Schouten <ed@FreeBSD.org> |
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers.
If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
show more ...
|
Revision tags: release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
486a9414 |
| 08-Mar-2007 |
Julian Elischer <julian@FreeBSD.org> |
Instead of doing comparisons using the pcpu area to see if a thread is an idle thread, just see if it has the IDLETD flag set. That flag will probably move to the pflags word as it's permenent and ne
Instead of doing comparisons using the pcpu area to see if a thread is an idle thread, just see if it has the IDLETD flag set. That flag will probably move to the pflags word as it's permenent and never chenges for the life of the system so it doesn't need locking.
show more ...
|
Revision tags: release/6.2.0_cvs, release/6.2.0 |
|
#
d4fbc81d |
| 30-Nov-2006 |
John Birrell <jb@FreeBSD.org> |
Flushing the buffer is conditional on actually using the buffer. Oops.
|
#
e0b65125 |
| 30-Nov-2006 |
John Birrell <jb@FreeBSD.org> |
Turn console printf buffering into a kernel option and only on by default for sun4v where it is absolutely required.
This change moves the buffer from struct pcpu to the stack to avoid using the cri
Turn console printf buffering into a kernel option and only on by default for sun4v where it is absolutely required.
This change moves the buffer from struct pcpu to the stack to avoid using the critical section which created a LOR in a couple of cases due to interaction with the tty code and kqueue. The LOR can't be fixed with the critical section and the pcpu buffer can't be used without the critical section.
Putting the buffer on the stack was my initial solution, but it was pointed out that the stress on the stack might cause problems depending on the call path. We don't have a way of creating tests for those possible cases, so it's best to leave this as an option for the time being. In time we may get enough data to enable this option more generally.
show more ...
|
#
acd3428b |
| 06-Nov-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
show more ...
|
#
3d068827 |
| 01-Nov-2006 |
John Birrell <jb@FreeBSD.org> |
Add a cnputs() function to write a string to the console with a lock to prevent interspersed strings written from different CPUs at the same time.
To avoid putting a buffer on the stack or having to
Add a cnputs() function to write a string to the console with a lock to prevent interspersed strings written from different CPUs at the same time.
To avoid putting a buffer on the stack or having to malloc one, space is incorporated in the per-cpu structure. The buffer size if 128 bytes; chosen because it's the next power of 2 size up from 80 characters.
String writes to the console are buffered up the end of the line or until the buffer fills. Then the buffer is flushed to all console devices.
Existing low level console output via cnputc() is unaffected by this change. ithread calls to log() are also unaffected to avoid blocking those threads.
A minor change to the behaviour in a panic situation is that console output will still be buffered, but won't be written to a tty as before. This should prevent interspersed panic output as a number of CPUs panic before we end up single threaded running ddb.
Reviewed by: scottl, jhb MFC after: 2 weeks
show more ...
|
#
5702e096 |
| 17-Sep-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Declare security and security.bsd sysctl hierarchies in sysctl.h along with other commonly used sysctl name spaces, rather than declaring them all over the place.
MFC after: 1 month Sponsored by: nC
Declare security and security.bsd sysctl hierarchies in sysctl.h along with other commonly used sysctl name spaces, rather than declaring them all over the place.
MFC after: 1 month Sponsored by: nCircle Network Security, Inc.
show more ...
|
#
19e9205a |
| 12-Jul-2006 |
John Baldwin <jhb@FreeBSD.org> |
Simplify the pager support in DDB. Allowing different db commands to install custom pager functions didn't actually happen in practice (they all just used the simple pager and passed in a local quit
Simplify the pager support in DDB. Allowing different db commands to install custom pager functions didn't actually happen in practice (they all just used the simple pager and passed in a local quit pointer). So, just hardcode the simple pager as the only pager and make it set a global db_pager_quit flag that db commands can check when the user hits 'q' (or a suitable variant) at the pager prompt. Also, now that it's easy to do so, enable paging by default for all ddb commands. Any command that wishes to honor the quit flag can do so by checking db_pager_quit. Note that the pager can also be effectively disabled by setting $lines to 0.
Other fixes: - 'show idt' on i386 and pc98 now actually checks the quit flag and terminates early. - 'show intr' now actually checks the quit flag and terminates early.
show more ...
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
0d84d9eb |
| 09-Mar-2006 |
Jung-uk Kim <jkim@FreeBSD.org> |
Implement printf 'X' conversion for both libstand and kernel.
|
#
6ec6fb9b |
| 25-Feb-2006 |
Scott Long <scottl@FreeBSD.org> |
Always print a newline char at the end of the line.
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
329c75a7 |
| 26-Sep-2005 |
Robert Watson <rwatson@FreeBSD.org> |
Acquire Giant in uprintf() and tprintf() rather than asserting it. In the vast majority of cases, these functions are called without mutexes held, meaning that in all but two cases, there will be no
Acquire Giant in uprintf() and tprintf() rather than asserting it. In the vast majority of cases, these functions are called without mutexes held, meaning that in all but two cases, there will be no ordering issues with doing this, and it will eliminate the need for changes in the caller. In two cases, mutexes are held, so Giant must be acquired before those mutexes such that uprintf() and tprintf() recurse Giant rather than generating a lock order reversal.
Suggested by: bde
show more ...
|
#
5580b0b1 |
| 20-Sep-2005 |
Robert Watson <rwatson@FreeBSD.org> |
Correct an incorrect comment from the dawn of time: neither tprintf() nor uprintf() is believed to perform tsleep() or msleep() as written, as ttycheckoutq() is called with '0' as its sleep argument.
Correct an incorrect comment from the dawn of time: neither tprintf() 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
show more ...
|
#
84d2b7df |
| 19-Sep-2005 |
Robert Watson <rwatson@FreeBSD.org> |
Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(), as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment).
Modify all consumer
Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(), 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
show more ...
|
#
5248ef8a |
| 04-Sep-2005 |
Xin LI <delphij@FreeBSD.org> |
When padding with zero, do pad after prefixes rather than padding before prefixes.
Use cases: printf("%05d", -42); --> "00-42" (should be "-0042") printf("%#05x", 12); --> "000xc" (sho
When padding with zero, do pad after prefixes rather than padding 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
show more ...
|
#
1e7d2c47 |
| 03-Sep-2005 |
Poul-Henning Kamp <phk@FreeBSD.org> |
If we ignore an unknown % sequence, we must stop interpreting the remaining % arguments because the varargs are now out of sync and there is a risk that we might for instance dereference an integer i
If we ignore an unknown % sequence, we must stop interpreting the 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
show more ...
|
#
4a30c508 |
| 07-Jun-2005 |
Doug White <dwhite@FreeBSD.org> |
Make "show msgbuf" use the pager instead of blasting the whole thing out.
MFC after: 3 days
|
Revision tags: release/5.4.0_cvs, release/5.4.0 |
|
#
30a1695b |
| 06-Apr-2005 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Constify hexdump() harder.
|
#
572b4402 |
| 17-Mar-2005 |
Poul-Henning Kamp <phk@FreeBSD.org> |
In stange circumstances we may end up being the last reference to a session in tprintf(). SESSRELE() needs to properly dispose of the sessions mutex.
Add sessrele() which does the proper cleanup a
In stange circumstances we may end up being the last reference to a 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)
show more ...
|
Revision tags: release/4.11.0_cvs, release/4.11.0, release/5.3.0_cvs, release/5.3.0 |
|
#
82ebaee7 |
| 10-Jul-2004 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Update for the KDB framework: o Check kdb_active instead of db_active and do so unconditionally.
|