Commit Graph

1884 Commits

Author SHA1 Message Date
Mateusz Guzik
5596f836e7 zfs: disable periodic arc updates
They are only there to provide less innacurate statistics for debuggers.
However, this is quite heavy-weight and instead it would be better to
teach debuggers how to obtain the necessary information.
2020-11-14 19:23:07 +00:00
Jung-uk Kim
fbde34778b MFV: r367652
Merge ACPICA 20201113.
2020-11-13 22:45:26 +00:00
Mateusz Guzik
4426311a3c zfs: combine zio caches if possible
This deduplicates 2 sets of caches using the same sizes.

Memory savings fluctuate a lot, one sample result is buildworld on zfs
saving ~180MB RAM in reduced page count associated with zio caches.
2020-11-10 14:23:46 +00:00
Mateusz Guzik
41ce62251c zfs: g/c unused data_alloc_arena 2020-11-10 14:21:23 +00:00
Mariusz Zaborski
36d6566e59 Check if the ZVOL has been written before calling zil_async_to_sync.
The ZIL will be opened on the first write, not earlier.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mariusz Zaborski <oshogbo@vexillium.org>
OpenZFS Pull Request: https://github.com/openzfs/zfs/pull/11152
PR:		250934
2020-11-08 14:08:00 +00:00
Mateusz Guzik
ff19fd6242 zfs: remove 2 assertions that teardown lock is not held
They are not very useful and hard to implement with rms.

This has a side effect of simplying the code.
2020-11-07 16:58:38 +00:00
Mark Johnston
acb5785aae Add firmware modules for qat(4), take two
My script to convert git commits to svn patch does not handle binary
files correctly, and r367387 committed a set of empty files as a result.

MFC with:	r367387
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-06 16:12:06 +00:00
Mark Johnston
f078c492a9 Add firmware modules for qat(4)
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-05 16:00:30 +00:00
Mateusz Guzik
aebc96831f zfs: lz4: add optional kmem_alloc support
lz4 port from illumos to Linux added a 16KB per-CPU cache to accommodate for
the missing 16KB malloc. FreeBSD supports this size, making the extra cache
harmful as it can't share buckets.
2020-11-05 03:25:23 +00:00
Mateusz Guzik
926ad187fd zfs: use rms lock for teardown handling
This deserializes otherwise non-contending operations.

The previous scheme of using 17 locks hashed by curthread runs into
conflicts very quickly.
2020-11-04 21:22:41 +00:00
Mateusz Guzik
4008dd4581 zfs: macroify teardown handling 2020-11-04 21:19:54 +00:00
Mateusz Guzik
ae5642a670 zfs: rename teardown inactive macros to mimick rrm convention 2020-11-04 21:19:25 +00:00
Mateusz Guzik
4a0b7fd502 zfs: add branch prediction to ZFS_ENTER and ZFS_VERIFY_ZP macros
They are expected to fail only in corner cases.
2020-11-04 21:18:51 +00:00
Mateusz Guzik
8ce21ae6ba zfs: even up assert 2020-11-04 21:18:27 +00:00
Mateusz Guzik
36639c3942 zfs: zstd: short-circuit cleaning buffers if none exist
This avoids a barrage of locking every minute.
2020-11-02 17:39:59 +00:00
Brandon Bergren
bd5e074531 Fix 32-bit build after r367229.
The use of atomic_sub_64() in zfs_zstd.c was breaking the 32-bit build on
platforms without native 64-bit atomics due to atomic_sub_64() not being
available, and no fallback being provided in _STANDALONE.

Provide a standalone stub to match atomic_add_64() using simple math.

While this is not actually atomic, it does not matter in libsa context,
since it always runs single-threaded and does not run under a scheduler.

Reviewed by: mjg (in email)
2020-10-31 21:11:34 +00:00
Mateusz Guzik
4a58b4ab28 zfs: zstd: track allocator statistics
This applies:
commit c4ede65bdf
Author: Mateusz Guzik <mjguzik@gmail.com>
Date:   Fri Oct 30 23:26:10 2020 +0100

    zstd: track allocator statistics

    Note that this only tracks sizes as requested by the caller.
    Actual allocated space will almost always be bigger (e.g., rounded up to
    the next power of 2 or page size). Additionally the allocated buffer may
    be holding other areas hostage. Nonetheless, this is a starting point
    for tracking memory usage in zstd.

from openzfs
2020-10-31 19:07:32 +00:00
Mateusz Guzik
4bfebc8d2c cache: add cache_vop_mkdir and rename cache_rename to cache_vop_rename 2020-10-30 10:46:35 +00:00
Edward Tomasz Napierala
bce7ee9d41 Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@.  It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by:	emaste, imp, gbe (manpages)
Differential Revision:	https://reviews.freebsd.org/D26980
2020-10-28 13:46:11 +00:00
Mateusz Guzik
c90590dd92 zfs: remove unused support for zfs_znode_move 2020-10-26 08:17:41 +00:00
Ryan Moeller
b19cdab345 Skip RAW kstat sysctls by default
hese kstats are often expensive to compute so we want to avoid them
unless specifically requested.

The following kstats are affected by this change:

kstat.zfs.${pool}.multihost
kstat.zfs.${pool}.misc.state
kstat.zfs.${pool}.txgs
kstat.zfs.misc.fletcher_4_bench
kstat.zfs.misc.vdev_raidz_bench
kstat.zfs.misc.dbufs
kstat.zfs.misc.dbgmsg

PR:		249258
Reported by:	mjg
Reviewed by:	mjg, allanjude
Obtained from:	https://github.com/openzfs/zfs/pull/11099
Sponsored by:	iXsystems, Inc.
2020-10-24 16:25:52 +00:00
Mateusz Guzik
25fb30bd9a vfs: drop spurious cache_purge on rmdir
The removed directory gets cache_purged which is sufficient to remove any entries
related to the parent.

Note only tmpfs, ufs and zfs are patched.
2020-10-23 15:50:49 +00:00
Mateusz Guzik
ab21ed17ed vfs: drop the de facto curthread argument from VOP_INACTIVE 2020-10-20 07:19:03 +00:00
Mateusz Guzik
8ecd87a3e7 vfs: drop spurious cred argument from VOP_VPTOCNP 2020-10-20 07:18:27 +00:00
Matt Macy
180f822596 Update OpenZFS to 2.0.0-rc3-gfc5966
- fix panic due to tqid overflow
- Improve libzfs_error_init messages
- Expose zfetch_max_idistance tunable
- Make dbufstat work on FreeBSD
- Fix EIO after resuming receive of new dataset over an existing one
2020-10-17 01:06:04 +00:00
Mateusz Guzik
e8796aca1c zfs: g/c unused vop_vector zfsctl_ops_shares_dir 2020-10-15 05:04:57 +00:00
Mateusz Guzik
b820822823 zfs: add missing fplookup vops
Some vnodes come with a hack which inherits the fplookup flag despite having vops
which don't provide the routine.

Reported by:	YAMAMOTO Shigeru <shigeru@os-hackers.jp>
2020-10-15 04:49:34 +00:00
Mateusz Guzik
c3f8f86efd FreeBSD: fix panic due to tqid overflow
The 32-bit counter eventually wraps to 0 which is a sentinel for invalid
id.

Make it 64-bit on LP64 platforms and 0-check otherwise.

Note: Linux counterpart uses id stored per queue instead of a global.
I did not check going that way is feasible with the goal being the
minimal fix doing the job.

Reported by:	YAMAMOTO Shigeru <shigeru@os-hackers.jp>
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D26759
2020-10-13 20:40:09 +00:00
Warner Losh
2fec3ae896 Add zstd support to the boot loader.
Add support to the _STANDALONE environment enough bits of the kernel
that we can compile it. We still have a small zstd_shim.c since there
were 3 items that were a bit hard to nail down and may be cleaned up
in the future. These go hand in hand with a number of commits to
sys/sys in the past weeks, should this need be MFCd.

Discussed with: mmacy (in review and on IRC/Slack)
Reviewed by: freqlabs (on openzfs repo)
Differential Revision: https://reviews.freebsd.org/D26218
2020-10-12 22:19:07 +00:00
Mateusz Guzik
a4bcd20486 zfs: use cache_rename 2020-10-10 04:18:49 +00:00
Jung-uk Kim
f15e9afb1f MFV: r366539
Merge ACPICA 20200925.
2020-10-09 05:27:02 +00:00
Ryan Moeller
3331a1d173 Explicit CTLFLAG_DYN not needed
Dynamically created OIDs automatically get this flag set.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D26561
2020-10-04 19:37:15 +00:00
Matt Macy
11322826a4 OpenZFS: don't call fpu_kern_thread on i386 2020-10-02 01:25:08 +00:00
Matt Macy
c40487d49b OpenZFS: MFV 2.0-rc3-gfc5966
- Annotate FreeBSD sysctls with CTLFLAG_MPSAFE
- Reduce stack usage of Lua
- Don't save user FPU context in kernel threads
- Add support for procfs_list
- Code cleanup in zio_crypt
- Add DB_RF_NOPREFETCH to dbuf_read()s in dnode.c
- Drop references when skipping dmu_send due to EXDEV
- Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data
- Fix legacy compat for platform IOCs
2020-10-01 23:28:21 +00:00
Cy Schubert
d9bc41a1c2 Continued ipfilter #ifdef cleanup. The r343701 log entry contains a
complete description.

MFC after:	1 week
2020-09-30 08:26:25 +00:00
Mark Johnston
752c1d14e3 ZFS: Fix a logic bug in the FreeBSD getpages VOP
This was introduced when I merged r361287 to OpenZFS and has been fixed
there already, commit 3f6bb6e43fd68e.

Reported by:	swills
Reviewed by:	allanjude, freqlabs, mmacy
2020-09-29 13:41:47 +00:00
Cy Schubert
c4390e6da6 Remove extraneous bracket.
MFC after:	3 days
2020-09-27 18:39:15 +00:00
Mateusz Guzik
a3d9bf49b5 cache: drop the force flag from purgevfs
The optional scan is wasteful, thus it is removed altogether from unmount.

Callers which always want it anyway remain unaffected.
2020-09-23 10:46:07 +00:00
D Scott Phillips
191dad8b0a vchi: rename bitset macros to avoid collision with bitset(9)
An upcoming change to include bitset(9) macros from vm_page.h
causes a macro name collision with vchi's custom bitset macros.

This change was performed mechanically by:

  sed -i .orig s/BITSET/VCHI_BITSET/g $(grep -rl BITSET sys/contrib/vchiq)

Reviewed by:	andrew
Approved by:	scottl (implicit)
MFC after:	1 week
Sponsored by:	Ampere Computing, Inc.
Differential Revision:	https://reviews.freebsd.org/D26177
2020-09-21 22:18:09 +00:00
Matt Macy
2c48331d28 MFV 2.0-rc2
- Fixes divide by zero for unusual hz
- remove cryptodev dependency
2020-09-18 23:21:24 +00:00
Ed Maste
11224884f2 ys/contrib/dev/ath: remove unintentional double semicolon
Approved by:	adrian
2020-09-18 18:35:18 +00:00
Konstantin Belousov
96474d2a3f Do not copy vp into f_data for DTYPE_VNODE files.
The pointer to vnode is already stored into f_vnode, so f_data can be
reused.  Fix all found users of f_data for DTYPE_VNODE.

Provide finit_vnode() helper to initialize file of DTYPE_VNODE type.

Reviewed by:	markj (previous version)
Discussed with:	freqlabs (openzfs chunk)
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D26346
2020-09-15 21:55:21 +00:00
Eric Joyner
cf08d707d4 ice_ddp: Fix 1.3.16.0 package
The version uploaded in the previous commit was far too small. This one
should be the right size.

MFC after:	1 day
Sponsored by:	Intel Corporation
2020-09-10 04:00:13 +00:00
Matt Macy
eac7052fde ZFS: MFV 2.0-rc1-gfd20a8
- fixes jail delegation
- fixes raw kstat unsupported complaints
- exposes dbgmsg, dbuf, and checksum benchmark stats
- restore rename -u support
2020-09-04 22:25:14 +00:00
Eric Joyner
1bd641af2b ice_ddp: Update package file to 1.3.16.0
This package is intended to be used with ice(4) version 0.26.16. That
update will happen in a forthcoming commit.

MFC after:	3 days
Sponsored by:	Intel Corporation
2020-09-04 17:37:58 +00:00
Matt Macy
ac0bf12ee5 ZFS: MFV 2.0-rc1-ga00c61 2020-08-28 18:53:45 +00:00
Toomas Soome
f6385d921b remove pragma ident lines
The #pragma ident is historical relict and not needed any more, this
pragma is actually unknown for common compilers and is only causing
trouble.
2020-08-26 07:29:17 +00:00
Matt Macy
eda14cbc26 Initial import from vendor-sys branch of openzfs 2020-08-24 23:31:26 +00:00
Conrad Meyer
43eccfe9b4 pcg-c: Add 'static' to inline function definitions
Make the inlines static to avoid kernel build failure with Clang 11 on i386.
(The issue was not observed with Clang 10, currently in tree; reproduction
depends on compiler inlining choices.)

The compiler may choose not to inline 'bare' C inlines, and in that case
expects a symbol of the same name will be available.  It does not
automatically define that symbol at use, because of traditional C linking
semantics. (In contrast, C++ does define it, and then deduplicates redundant
definitions at link).  As we do not instantiate the C99 inline ('extern
inline ...;'), the linker errors with "undefined symbol."

Reported by:	dim
Tested by:	dim
Fixes:		r364219
2020-08-15 18:46:26 +00:00
Conrad Meyer
8a0edc914f Add prng(9) API
Add prng(9) as a replacement for random(9) in the kernel.

There are two major differences from random(9) and random(3):

- General prng(9) APIs (prng32(9), etc) do not guarantee an
  implementation or particular sequence; they should not be used for
  repeatable simulations.

- However, specific named API families are also exposed (for now: PCG),
  and those are expected to be repeatable (when so-guaranteed by the named
  algorithm).

Some minor differences from random(3) and earlier random(9):

- PRNG state for the general prng(9) APIs is per-CPU; this eliminates
  contention on PRNG state in SMP workloads.  Each PCPU generator in an
  SMP system produces a unique sequence.

- Better statistical properties than the Park-Miller ("minstd") PRNG
  (longer period, uniform distribution in all bits, passes
  BigCrush/PractRand analysis).

- Faster than Park-Miller ("minstd") PRNG -- no division is required to
  step PCG-family PRNGs.

For now, random(9) becomes a thin shim around prng32().  Eventually I
would like to mechanically switch consumers over to the explicit API.

Reviewed by:	kib, markj (previous version both)
Discussed with:	markm
Differential Revision:	https://reviews.freebsd.org/D25916
2020-08-13 20:48:14 +00:00