Bug 191916 - pflogd(8) eats cpu and hangs with net.bpf.zerocopy_enable=0
Summary: pflogd(8) eats cpu and hangs with net.bpf.zerocopy_enable=0
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.3-RELEASE
Hardware: i386 Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-17 07:59 UTC by Lukasz Wasikowski
Modified: 2017-11-12 17:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Wasikowski 2014-07-17 07:59:29 UTC
After update to 9.3-RELEASE pflog started to eat 100% CPU and needs kill -9 to shut (this is on i386). Some details:

# uname -a
FreeBSD vesper.wasikowski.net 9.3-RELEASE FreeBSD 9.3-RELEASE #30 r268740: Wed Jul 16 16:54:40 CEST 2014     root@vesper.wasikowski.net:/usr/obj/usr/src/sys/vesper  i386

# sysctl net.bpf.zerocopy_enable
net.bpf.zerocopy_enable: 0

# ps axufw | grep [p]flogd
_pflogd   5718 100.0  0.0   9628   1740 ??  R     9:58AM  0:37.24 pflogd: [initializing] (pflogd)
root      5717   0.0  0.0   9628   1744 ??  Is    9:58AM  0:00.01 pflogd: [priv] (pflogd)


# grep -Ev "^#|^$" /boot/loader.conf
zfs_load="YES"
vm.kmem_size="1400M"
vm.kmem_size_max="1400M"
vfs.zfs.arc_max="1200M"
vfs.zfs.prefetch_disable="0"
geom_mirror_load="YES"
if_bge_load="YES"
if_lagg_load="YES"
random_load="YES"
sem_load="YES"
sysvmsg_load="YES"
sysvsem_load="YES"
sysvshm_load="YES"
accf_http_load="YES"
linprocfs_load="YES"
accf_data_load="YES"
loader_logo="beastiebw"

Kernel config: http://pastebin.com/8kSgHxJN
Comment 1 Lukasz Wasikowski 2014-07-17 08:01:05 UTC
(In reply to Lukasz Wasikowski from comment #0)
> After update to 9.3-RELEASE pflog started to eat 100% CPU and needs kill -9
> to shut (this is on i386). Some details:
> 
> # uname -a
> FreeBSD vesper.wasikowski.net 9.3-RELEASE FreeBSD 9.3-RELEASE #30 r268740:
> Wed Jul 16 16:54:40 CEST 2014    
> root@vesper.wasikowski.net:/usr/obj/usr/src/sys/vesper  i386
> 
> # sysctl net.bpf.zerocopy_enable
> net.bpf.zerocopy_enable: 0
> 
> # ps axufw | grep [p]flogd
> _pflogd   5718 100.0  0.0   9628   1740 ??  R     9:58AM  0:37.24 pflogd:
> [initializing] (pflogd)
> root      5717   0.0  0.0   9628   1744 ??  Is    9:58AM  0:00.01 pflogd:
> [priv] (pflogd)
> 
> 
> # grep -Ev "^#|^$" /boot/loader.conf
> zfs_load="YES"
> vm.kmem_size="1400M"
> vm.kmem_size_max="1400M"
> vfs.zfs.arc_max="1200M"
> vfs.zfs.prefetch_disable="0"
> geom_mirror_load="YES"
> if_bge_load="YES"
> if_lagg_load="YES"
> random_load="YES"
> sem_load="YES"
> sysvmsg_load="YES"
> sysvsem_load="YES"
> sysvshm_load="YES"
> accf_http_load="YES"
> linprocfs_load="YES"
> accf_data_load="YES"
> loader_logo="beastiebw"
> 
> Kernel config: http://pastebin.com/8kSgHxJN

Forgot to add /etc/sysctl.conf:

# grep -Ev "^#|^$" /etc/sysctl.conf
security.bsd.see_other_uids=0
kern.maxvnodes=200000
security.bsd.unprivileged_read_msgbuf=0
net.enc.out.ipsec_bpf_mask=0x00000003
net.enc.out.ipsec_filter_mask=0x00000001
net.enc.in.ipsec_bpf_mask=0x00000001
net.enc.in.ipsec_filter_mask=0x00000002
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-07-20 18:12:27 UTC
Over to maintainers.
Comment 3 Lukasz Wasikowski 2017-09-13 08:47:11 UTC
I can't verify this anymore, pflog is working fine on all BSD systems I'm using these days.
Comment 4 Marcin Gryszkalis 2017-11-12 17:54:23 UTC
Note for those with similar problem: I just noticed same effect (pflogd eating 100% cpu on initializing). It was because mistake in newsyslog.conf that stopped /var/log/pflog rotation and the log file grown to over 20GB. 

As pflogd(8) says:

     pflogd tries to preserve the integrity of the log file against I/O
     errors.  Furthermore, integrity of an existing log file is verified
     before appending.