Revert svn r248625

Clang errors around printf could be trivially fixed, but the breakage in
sbin/fsdb were to significant for this type of change.

Submitter of this changeset has been notified and hopefully this can be
restored soon.


git-svn-id: svn://svn.freebsd.org/base/head@248634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix the build after addition of cylinder group cacheing (r248625)

Reported by:   Glen Barber (gjb@)
Pointy hat to: Kirk McKusick (mckusick@)


git-svn-id: svn://svn.freebsd.org/base/head@248639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
fbt_typoff_init: fix an off by one in determining required memory size

This issue would be silent most of the time, but if the requested memory
is a multiple of a page size, then accessing one element beyond the end
would lead to a kernel page fault.
Otherwise, the unlucky last type would just be inaccessible.

Reported by:	glebius
Tested by:	glebius
MFC after:	6 days


git-svn-id: svn://svn.freebsd.org/base/head@248640 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
libdwarf: anonymous types are expected to have empty type names...

or no type attributes at all.
This is according to DWARF specification.

MFC after:	13 days


git-svn-id: svn://svn.freebsd.org/base/head@248641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
fbt_getargdesc: correctly handle types for return probes

MFC after:	6 days


git-svn-id: svn://svn.freebsd.org/base/head@248642 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert r248639 to fix build failure on head/


git-svn-id: svn://svn.freebsd.org/base/head@248643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
dtrace: ensure that we can always catch a process (e.g. when -c is used)

It is not guaranteed that a program has a symbol table entry for main
and thus that it would be possible to set a breakpoint on it.

Reviewed by:	rpaulo
Discussed with:	rpaulo
MFC after:	13 days


git-svn-id: svn://svn.freebsd.org/base/head@248644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
post mountroot event after a real/final root is mounted

not every time an intermediate root (including the first devfs) is
mounted.
This is also consistent with waking up via root_mount_complete.

Reviewed by:	jhb
MFC after:	13 days


git-svn-id: svn://svn.freebsd.org/base/head@248645 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make `systat -vmstat` to use suffixes to display big floating point numbers
that are not fitting into the specified field width, same as done for ints.
In particular that allows to properly display disk tps above 100k, that are
reachable with modern SSDs.


git-svn-id: svn://svn.freebsd.org/base/head@248647 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert r247892 now that this has been fixed upstream.


git-svn-id: svn://svn.freebsd.org/base/head@248648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Extend taskqueue(9) to enable per-taskqueue callbacks.

The scope of these callbacks is primarily to support actions that affect the
taskqueue's thread environments.  They are entirely optional, and
consequently are introduced as a new API: taskqueue_set_callback().

This interface allows the caller to specify that a taskqueue requires a
callback and optional context pointer for a given callback type.

The callback types included in this commit can be used to register a
constructor and destructor for thread-local storage using osd(9).  This
allows a particular taskqueue to define that its threads require a specific
type of TLS, without the need for a specially-orchestrated task-based
mechanism for startup and shutdown in order to accomplish it.

Two callback types are supported at this point:

- TASKQUEUE_CALLBACK_TYPE_INIT, called by every thread when it starts, prior
  to processing any tasks.
- TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, called by every thread when it exits,
  after it has processed its last task but before the taskqueue is
  reclaimed.

While I'm here:

- Add two new macros, TQ_ASSERT_LOCKED and TQ_ASSERT_UNLOCKED, and use them
  in appropriate locations.
- Fix taskqueue.9 to mention taskqueue_start_threads(), which is a required
  interface for all consumers of taskqueue(9).

Reviewed by:	kib (all), eadler (taskqueue.9), brd (taskqueue.9)
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic
MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@248649 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
ZFS: Fix a panic while unmounting a busy filesystem.

This particular scenario was easily reproduced using a NFS export.  When the
first 'zfs unmount' occurred, it returned EBUSY via this path, while
vflush() had flushed references on the filesystem's root vnode, which in
turn caused its v_interlock to be destroyed.  The next time 'zfs unmount'
was called, vflush() tried to obtain this lock, which caused this panic.

Since vflush() on FreeBSD is a definitive call, there is no need to check
vfsp->vfs_count after it completes.  Simply #ifdef sun this check.

Submitted by:	avg
Reviewed by:	avg
Approved by:	ken (mentor)
MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@248653 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Be more explicit about what each bio_cmd & bio_flags value means.

Reviewed by:	ken (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@248654 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't check and warn about pmap mismatch on every call to busdma sync.
With some recent busdma refactoring, sometimes it happens that a sync
op gets called when bus_dmamap_load() never got called, which results
in a spurious warning about a map mismatch when no sync operations will
actually happen anyway.  Now the check is done only if a sync operation
is actually performed, and the result of the check is a panic, not just
a printf.

Reviewed by:	cognet (who prevented me from donning a point hat)


git-svn-id: svn://svn.freebsd.org/base/head@248655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix compiling ed w/ WITHOUT_ED_CRYPTO...  These variables aren't
used..

Submitted by:   deeptech71 at gmail dot com


git-svn-id: svn://svn.freebsd.org/base/head@248656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
drm/ttm: Fix TTM buffer object refcount

This fixes memory leaks in the radeonkms driver.

Reviewed by:	Konstantin Belousov (kib@)
Tested by:	J.R. Oldroyd <jr@opal.com>


git-svn-id: svn://svn.freebsd.org/base/head@248657 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert 248634 and 248643 (e.g., restoring 248625 and 248639).

Build verified by: Glen Barber (gjb@)


git-svn-id: svn://svn.freebsd.org/base/head@248658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix kernel build with options ZFS after r24571 (libzfs_core).

Submitted by:	Bjoern A. Zeeb <bz@FreeBSD.org>


git-svn-id: svn://svn.freebsd.org/base/head@248659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
drm/ttm: Explain why we don't need to acquire a ref in ttm_bo_vm_ctor()


git-svn-id: svn://svn.freebsd.org/base/head@248661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
drm/ttm: Fix a typo: s/pTTM]/[TTM]/


git-svn-id: svn://svn.freebsd.org/base/head@248663 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f