We're only returning a 32-bit counter.
o In decr_intr(), manually perform LICM, so that we don't test
a loop invariant condition inside a loop.
o Include <machine/smp.h>
volatile so that the compiler won't perform CSE. For SMP,
this may result in us accessing the wrong PCPU and as such
results in a bogus curthread value.
Note that getting curthread is not quite MP-safe in the sense
that it requires two instructions that aren't performed
atomically. The first instruction gets the address of the PCPU
structure and the second instruction dereferences that pointer
to get curthread. If a thread is switched-out in between these
instructions and switched-in on a different CPU, we still get
the wrong curthread.
cap on memory usage, then shared LOOKUP operations could start free'ing
dirhash structures. Without these fixes, concurrent free's on the same
directory could result in one of the threads blocked on a lock in a dirhash
structure free'd by the other thread.
- Replace the lockmgr lock in the dirhash structure with an sx lock.
- Use a reference count managed with ufsdirhash_hold()/drop() to determine
when to free the dirhash structures. The directory i-node holds a
reference while the dirhash is attached to an i-node. Code that wishes
to lock the dirhash while holding a shared vnode lock must first
acquire a private reference to the dirhash while holding the vnode
interlock before acquiring the dirhash sx lock. After acquiring the sx
lock, it drops the private reference after checking to see if the
dirhash is still used by the directory i-node.
non-LOOKUP operations.
- Relax a VOP assertion for a DELETE lookup. rename() uses WANTPARENT
instead of LOCKPARENT when looking up the source pathname. ufs_rename()
uses a relookup() to lock the parent directory when it decides to finally
remove the source path. Thus, it is ok for a DELETE with WANTPARENT set
instead of LOCKPARENT to use a shared vnode lock rather than an exclusive
vnode lock.
Reported by: kris (2)
Reviewed by: jeff
upgrades the vnode lock if it is share locked was dropping the interlock
before actually checking VI_DOOMED. Fix this by do the vdropl() after the
check and relying on it to drop the vnode interlock.
Reported by: pho
Reviewed by: kib
MFC after: 1 week
Unlike tty_rel_gone() and tty_rel_sess(), the tty_rel_pgrp() routine
does not unlock the TTY. I once had the idea to make the code call
tty_rel_pgrp() and tty_rel_sess(), picking up the TTY lock once. This
turned out a little harder than I expected, so this is how it works now.
It's a lot easier if we just let tty_rel_pgrp() unlock the TTY, because
the other routines do this anyway.
wait until the current suspension is lifted instead of silently returning
success immediately. The consequences of calling vfs_write() resume when
not owning the suspension are not well-defined at best.
Add the vfs_susp_clean() mount method to be called from
vfs_write_resume(). Set it to process_deferred_inactive() for ffs, and
stop calling it manually.
Add the thread flag TDP_IGNSUSP that allows to bypass the suspension
point in the vn_start_write. It is intended for use by VFS in the
situations where the suspender want to do some i/o requiring calls to
vn_start_write(), and this i/o cannot be done later.
Reviewed by: tegge
In collaboration with: pho
MFC after: 1 month
Show the b_dep value for the buffer in the show buffer command.
Add a comand to dump the dirty/clean buffer list for vnode.
Reviewed by: tegge
Tested and used by: pho
MFC after: 1 month
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.
Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.
Reviewed by: tegge
In collaboration with: pho
MFC after: 1 month
inode having number ino. In r170991, the ip was marked IN_MODIFIED, that
is not quite correct.
Mark only the right inode modified by checking inode number.
Reviewed by: tegge
In collaboration with: pho
MFC after: 1 month
the command set (only so long as the module is present):
o add db_command_register and db_command_unregister to add and remove
commands, respectively
o replace linker sets with SYSINIT's (and SYSUINIT's) that register
commands
o expose 3 list heads: db_cmd_table, db_show_table, and db_show_all_table
for registering top-level commands, show operands, and show all operands,
respectively
While here also:
o sort command lists
o add DB_ALIAS, DB_SHOW_ALIAS, and DB_SHOW_ALL_ALIAS to add aliases
for existing commands
o add "show all trace" as an alias for "show alltrace"
o add "show all locks" as an alias for "show alllocks"
Submitted by: Guillaume Ballet <gballet@gmail.com> (original version)
Reviewed by: jhb
MFC after: 1 month
- Retire IVARs for passing IRQs around. Instead, ppbus and ppc now allow
child devices to access the interrupt by via a rid 0 IRQ resource
using bus_alloc_resource_any().
- ppc creates its own interrupt event to manage the interrupt handlers of
child devices. ppc does not allow child devices to use filters. It
could allow this if needed, but none of the current drivers use them
and it adds a good bit of complication. It uses
intr_event_execute_handlers() to fire the child device interrupt handlers
from its threaded interrupt handler.
- Remove the ppbus_dummy_intr() hack. Now the ppc device always has an
interrupt handler registered and we no longer bounce all the way up to
nexus to manage adding/removing ppbus child interrupt handlers. Instead,
the child handlers are added and removed to the private interrupt event
in the ppc device.
all the non-filter handlers attached to an interrupt event. This can be
used by device drivers which multiplex their interrupt onto the interrupt
handlers for child devices.
It seems we only depend on COMPAT_43 to implement the send() and recv()
routines. We can easily implement them using sendto() and recvfrom(),
just like we do inside our very own C library.
I wasn't able to really test it, apart from simple compilation testing.
I've heard rumours that COMPAT_SVR4 is broken inside execve() anyway.
It's still worth to fix this, because I suspect we'll get rid of
COMPAT_43 somewhere in the future...
Reviewed by: rdivacky
Discussed with: jhb
On the i386 architecture, the processor only saves the current value
of `%esp' on stack if a privilege switch is necessary when entering
the interrupt handler. Thus, `frame->tf_esp' is only valid for
an entry from user mode. For interrupts taken in kernel mode, we
need to determine the top-of-stack for the interrupted kernel
procedure by adding the appropriate offset to the current frame
pointer.
Reported by: kris, Fabien Thomas
Tested by: Fabien Thomas <fabien.thomas at netasq dot com>
someone else might change it, so after we re-acquire the lock on it,
we need to check it is still valid. People have been panicing in this
function due to soem edge cases which I have hopefully removed.
Reviewed by: keramida @
Obtained from: 1 week
common PowerPC code when all we want to achieve is to enable
external interrupts. We can set PSL_RI at any time before we
allow interrupts and/or exceptions, so move it to the AIM
specific initialization and do it when we also set PSL_ME
(machine check enable).
configuring the L2 cache on the BSP. Nor the L3 cache. We
merely print the settings.
Save the L2 and L3 cache configuration in global values so
that we know how to configure the cache on APs.
ABI change on ILP32 platforms and relating to events. However
it's harmless on little-endian ILP32 platforms in the sense
that it doesn't cause breakages. Old ILP32 thread libraries
write a 32-bit th_p and new thread libraries write a 64-bit
th_p. But due to the fact that we have an unused 32-bit data
field right after th_p and that field is always initialized to
zero, little-endian ILP32 machines effectively have a valid
64-bit th_p by accident. Likewise for new thread libraries and
old libthread_db: little endian ILP32 is unaffected.
At this time we don't support big-endian threaded applications
in GDB, so the breakage for the ILP32 case goes unnoticed.
rt_check() in its original form proved to be sufficient and
rt_check_fib() can go away (as can its evil twin in_rt_check()).
I believe this does NOT address the crashes people have been seeing
in rt_check.
MFC after: 1 week
items of the nmount() iovec. This will allow us to move
away from gathering up all the NFS mount options as a single
"struct nfs_args" to be passed down through nmount().
This will make adding new NFS mount options much easier.
Many, many thanks to Doug Rabson, who took my initial patches and
cleaned them up.
Reviewed by: dfr
MFC after: 3 months
the same way it has been implemented for IPv4.
Reviewed by: bms (skimmed)
Tested by: Nick Hilliard (nick netability.ie) (with more changes)
MFC after: 2 months
Because of using more clear and same time more functional codec parser
new driver is able to handle more codecs, use them better then before and
without most of previous quirks. All of tested codecs itself manage playback,
record, input mixing and monitoring quite fine. In all of investigated
trouble cases problem was found or in nonstandard codec usage or incorrect
codec configuration made by BIOS. Most of that cases could be fixed using
device hints, some of which are already included to the driver.
New driver supports multiple codecs per HDA bus, multiple audio function
groups per codec and multiple logical sound devices per audio function group.
So don't worry when you get several PCM devices instead of one, it is normal.
It is usual situation with powerful codecs to provide, for example, 3 PCM
devices: one for 7.1 playback and main recording, one for headset and one
for digital SPDIF I/O.
New driver implements Universal Audio Architecture (UAA) much better then
previous one. Most information about recommended codec usage now taken from
the codec configuration registers initialized by BIOS. User may alter that
configuration using device hints to reconfigure logical audio devices to
his needs in a very broad range up to the limits of the codec functionality.
New driver supports digital PCM playback and AC3 pass-through. I am not sure
about completeness of this implementation, but I have several success stories
including my own. Vchans subsystem does not support AC3 pass-through so it
had to be disabled for that devices at this moment.
New driver is ready for multichannel playback, but until our OSS is unable
to use this it will just duplicate same stereo stream into all channel
pairs.
New driver supports suspend/resume. I am unable to really test this part
myself, but I have got several success stories.
Driver has very informative verbose boot messages. So if you have any
questions or problems - enable and read them first.
Discussed on: freebsd-multimedia@
Tested by: many
we ran into in the past where places hidden by TCP_SIGNATURE were
missed.
It is possible to turn it on now that FAST_IPSEC (now know as IPSEC)
is enabled for LINT and the default and only IPsec implementation.