Re: swap_pager: cannot allocate bio

From: Chris Ross <cross+freebsd_at_distal.com>
Date: Tue, 23 Nov 2021 20:17:18 UTC

> On Nov 23, 2021, at 06:18, Ronald Klop via freebsd-fs <freebsd-fs@freebsd.org> wrote:
> 
> Just a wild guess. Would it help if you set a limit in the vfs.zfs.arc_max variable?
> Maybe that will help lower the memory pressure and gain some stability.
> You can use the zfs-stats package to see the current ARC size.
> 
> My RPI4 gives:
> # zfs-stats -A
> ...
> ARC Size:                               28.19%  1.93    GiB
>        Target Size: (Adaptive)         30.47%  2.08    GiB
>        Min Size (Hard Limit):          3.58%   250.80  MiB
>        Max Size (High Water):          27:1    6.84    GiB
> ...
> 
> You can use your stats to tune it to not use too much memory for ARC and leave more for the running applications so swapping might also be reduced.
> 
> You can check zfs-stats -E to see if the ARC cache hit ratio is still ok with limited ARC.


Thanks for that detail regarding zfs-stats.  Someone else had suggested limiting
arc_max, but the concern was that it might just mask the real problem.  It was
my fallback plan, though, if we couldn’t make progress towards avoiding the
lock-up.

                  - Chris