Skip to content

Commit

Permalink
[type/__ssrq_zfs] Add workaround for bug 11574
Browse files Browse the repository at this point in the history
  • Loading branch information
sideeffect42 committed Mar 22, 2021
1 parent 1dd97ce commit fd43113
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
25 changes: 25 additions & 0 deletions type/__ssrq_zfs/explorer/pagesize
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh -e
#
# 2021 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#

getconf PAGESIZE 2>/dev/null ||
getconf PAGE_SIZE 2>/dev/null || {
echo 'Cannot determine pagesize.' >&2
exit 1
}
23 changes: 22 additions & 1 deletion type/__ssrq_zfs/manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera@ssrq-sds-fds.ch)
# 2020-2021 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
Expand Down Expand Up @@ -86,6 +86,27 @@ __block /etc/modprobe.d/zfs.conf:cdist-zfs-tunables \
$(sed -e 's/^/options zfs /' "${__object:?}/parameter/tunable")
EOF



# HACK: Workaround spl bug that exhausts all memory on `zfs scrub' on non-4k
# page sizes
# https://github.com/openzfs/zfs/issues/11756
# https://github.com/openzfs/zfs/issues/11574
pagesize=$(cat "${__object:?}/explorer/pagesize")
if test $((pagesize)) -eq $((64 * 1024))
then
spl_kmem_cache_slab_limit=16384
fi
require='__package_apt/zfs-modules' \
__block /etc/modprobe.d/zfs.conf:cdist-spl-workaround-11574 \
--state "$(test "${spl_kmem_cache_slab_limit-}" && echo present || echo absent)" \
--file /etc/modprobe.d/zfs.conf \
--prefix '# cdist:spl-workaround-11574' \
--suffix '#/cdist:spl-workaround-11574' \
--text - <<EOF
options spl spl_kmem_cache_slab_limit=$((spl_kmem_cache_slab_limit))
EOF

set_zed_rc() {
require=__package_apt/zfs-zed \
__key_value /etc/zfs/zed.d/zed.rc:"$1" \
Expand Down

0 comments on commit fd43113

Please sign in to comment.