Bug 183717 - High CPU Utilization on HylaFAX processes
Summary: High CPU Utilization on HylaFAX processes
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-06 14:30 UTC by ruanchunping
Modified: 2018-05-20 23:57 UTC (History)
2 users (show)

See Also:


Attachments
Patch for comms/hylafax port. (1.01 KB, patch)
2014-11-22 14:30 UTC, Alexander Moisseev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ruanchunping 2013-11-06 14:30:00 UTC
The problem is the same as kern/166071 described.

The box is installed 9.1-RELEASE,and updated to stable/10 with custom kernel(add PF_ALTQ support).

Install hylafax from posts.

$ pkg info|grep hylafax
hylafax-6.0.6                  Fax software

faxgetty and faxq cost too many cpu load.(>70% system.)
and can't receive or send fax.

$ ps -auxww|grep faxq
uucp    63466 63.1  0.1  35224   2836  -  Rs    2:55PM   25:19.28 /usr/local/sbin/faxq
$ sudo ktrace -t c -p 63466
$ sudo ktrace -C
$ sudo kdump -R
 63466 faxq     1383636856.659275 CALL  read(0x4,0x7fffffffcfa0,0x7ff)
 63466 faxq     0.000257 RET   read 0
 63466 faxq     0.000055 CALL  select(0x5,0x7fffffffd950,0x7fffffffd8d0,0x7fffffffd850,0)
 63466 faxq     0.000031 RET   select 1
 63466 faxq     0.000026 CALL  read(0x4,0x7fffffffcfa0,0x7ff)
 63466 faxq     0.000024 RET   read 0
 63466 faxq     0.000041 CALL  select(0x5,0x7fffffffd950,0x7fffffffd8d0,0x7fffffffd850,0)
 63466 faxq     0.000027 RET   select 1
 63466 faxq     0.000025 CALL  read(0x4,0x7fffffffcfa0,0x7ff)
 63466 faxq     0.000024 RET   read 0
 63466 faxq     0.000022 CALL  select(0x5,0x7fffffffd950,0x7fffffffd8d0,0x7fffffffd850,0)
 63466 faxq     0.000023 RET   select 1
 63466 faxq     0.000037 CALL  read(0x4,0x7fffffffcfa0,0x7ff)
 63466 faxq     0.000025 RET   read 0
 63466 faxq     0.000024 CALL  select(0x5,0x7fffffffd950,0x7fffffffd8d0,0x7fffffffd850,0)
 63466 faxq     0.000024 RET   select 1
 63466 faxq     0.000023 CALL  read(0x4,0x7fffffffcfa0,0x7ff)
 63466 faxq     0.000023 RET   read 0
 ========== more ===========


and , the /var/spool/hylafax/ is on zfs 
$ mount
zroot on / (zfs, local, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
zroot/data on /data (zfs, NFS exported, local, nfsv4acls)
zroot/data/ftp on /data/ftp (zfs, NFS exported, local, noatime, nfsv4acls)
zroot/data/mysql on /data/mysql (zfs, local, nfsv4acls)
zroot/home on /home (zfs, local, nfsv4acls)
zroot/tmp on /tmp (zfs, local, nfsv4acls)
zroot/usr on /usr (zfs, local, nfsv4acls)
zroot/var on /var (zfs, local, nfsv4acls)

$ zfs get all zroot/var
NAME       PROPERTY              VALUE                  SOURCE
zroot/var  type                  filesystem             -
zroot/var  creation              Wed Oct 30 22:42 2013  -
zroot/var  used                  2.16G                  -
zroot/var  available             410G                   -
zroot/var  referenced            1.84G                  -
zroot/var  compressratio         1.00x                  -
zroot/var  mounted               yes                    -
zroot/var  quota                 none                   default
zroot/var  reservation           none                   default
zroot/var  recordsize            128K                   default
zroot/var  mountpoint            /var                   local
zroot/var  sharenfs              off                    default
zroot/var  checksum              on                     default
zroot/var  compression           off                    default
zroot/var  atime                 on                     default
zroot/var  devices               on                     default
zroot/var  exec                  on                     default
zroot/var  setuid                on                     default
zroot/var  readonly              off                    default
zroot/var  jailed                off                    default
zroot/var  snapdir               hidden                 default
zroot/var  aclmode               discard                default
zroot/var  aclinherit            restricted             default
zroot/var  canmount              on                     default
zroot/var  xattr                 off                    temporary
zroot/var  copies                1                      default
zroot/var  version               5                      -
zroot/var  utf8only              off                    -
zroot/var  normalization         none                   -
zroot/var  casesensitivity       sensitive              -
zroot/var  vscan                 off                    default
zroot/var  nbmand                off                    default
zroot/var  sharesmb              off                    default
zroot/var  refquota              none                   default
zroot/var  refreservation        none                   default
zroot/var  primarycache          all                    default
zroot/var  secondarycache        all                    default
zroot/var  usedbysnapshots       329M                   -
zroot/var  usedbydataset         1.84G                  -
zroot/var  usedbychildren        0                      -
zroot/var  usedbyrefreservation  0                      -
zroot/var  logbias               latency                default
zroot/var  dedup                 off                    default
zroot/var  mlslabel                                     -
zroot/var  sync                  standard               default
zroot/var  refcompressratio      1.00x                  -
zroot/var  written               39.2M                  -
zroot/var  logicalused           2.05G                  -
zroot/var  logicalreferenced     1.80G                  -


$ sudo fstat -v -p 63466
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W
uucp     faxq       63466 text /usr     1630604 -r-sr-xr-x  274064  r
uucp     faxq       63466   wd /var       1381 drwxr-xr-x      20  r
uucp     faxq       63466 root /             4 drwxr-xr-x      26  r
uucp     faxq       63466    0 /dev          7 crw-rw-rw-    null rw
uucp     faxq       63466    1 /dev          7 crw-rw-rw-    null rw
uucp     faxq       63466    2 /dev          7 crw-rw-rw-    null rw
uucp     faxq       63466    3 /dev          7 crw-rw-rw-    null rw
uucp     faxq       63466    4 /var      50545 prw-------       0  r
uucp     faxq       63466    5* local dgram fffff80039013d20 <-> fffff80004ef7a50

FD 4, it's inode is 50545
$ ls -i /var/spool/hylafax/FIFO
50545 /var/spool/hylafax/FIFO
$ file /var/spool/hylafax/FIFO
/var/spool/hylafax/FIFO: fifo (named pipe)

Fix: 

Everything is ok from 7.1 to 8.2-RELEASE, and worked for 3 years.

so ,is it a bug about /usr/src/sys/fs/fifofs/fifo_vnops.c ?
How-To-Repeat: freebsd: amd64 stable/10
install hylafax from posts and start it.

edit /etc/ttys,add this line:
cuau0   "/usr/local/sbin/faxgetty"      dialup  on
kill -HUP 1

than call the fax modem from another phone.

monit the cpu usage from top.
Comment 1 Alexander Moisseev 2014-11-22 14:30:19 UTC
Created attachment 149713 [details]
Patch for comms/hylafax port.

It is actually comms/hylafax bug, not the kernel bug.

The releaseAtLeast() function in the configure script compares OS version as a string, and that is wrong.

# expr 9.3-RELEASE \>= 3.0
1
# expr 10.1-RELEASE \>= 3.0
0

As a result, hylafax is building without CONFIG_OPENFIFO="O_RDWR".
Comment 2 ruanchunping 2014-11-22 15:57:29 UTC
(In reply to Alexander Moisseev from comment #1)
> Created attachment 149713 [details]
> Patch for comms/hylafax port.
> 
> It is actually comms/hylafax bug, not the kernel bug.
> 
> The releaseAtLeast() function in the configure script compares OS version as
> a string, and that is wrong.
> 
> # expr 9.3-RELEASE \>= 3.0
> 1
> # expr 10.1-RELEASE \>= 3.0
> 0
> 
> As a result, hylafax is building without CONFIG_OPENFIFO="O_RDWR".

Thanks for your help.

I setup a jail (8.2 world with 10-STABLE kernel) to run hylafax, it works very well for 1 year.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:57:09 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"