[Bug 230273] linux_select CALL is very slow (100 ms)

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 28 Jun 2022 21:19:32 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230273

--- Comment #11 from Jason Mader <jasonmader@gmail.com> ---
(In reply to Dmitry Chagin from comment #10)

I've since updated the computer to FreeBSD 13.0-RELEASE, but here is a new
ktrace, kdump -HAR -m 32,

 35539 101733 lstc_server 0.000004 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000001 RET   L64  linux_time 1656449008/0x62bb67f0
 35539 101733 lstc_server 0.000002 CALL  L64 
linux_newstat(0x800b88f74,0x7fffffffbe60)
 35539 101733 lstc_server 0.000002 NAMI  L64  "/compat/linux/etc/localtime"
 35539 101733 lstc_server 0.000002 NAMI  L64  "/etc/localtime"
 35539 101733 lstc_server 0.000002 STRU  L64  struct stat
{dev=16125346129888550616, ino=897, mode=0100444, nlink=1, uid=0, gid=0,
rdev=18446744073709551615, atime=1632399362.502502000,
mtime=1632399362.502578000, ctime=1632932022.897132000,
birthtime=1632399362.502578000, size=118, blksize=4096, blocks=1, flags=0x800 }
 35539 101733 lstc_server 0.000001 RET   L64  linux_newstat 0
 35539 101733 lstc_server 0.000004 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000002 RET   L64  linux_time 1656449008/0x62bb67f0
 35539 101733 lstc_server 0.000002 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000001 RET   L64  linux_time 1656449008/0x62bb67f0
 35539 101733 lstc_server 0.000003 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000001 RET   L64  linux_time 1656449008/0x62bb67f0
 35539 101733 lstc_server 0.000003 CALL  L64 
linux_semop(0x60000,0x7fffffffe3d0,0x1)
 35539 101733 lstc_server 0.000002 RET   L64  linux_semop -1 errno -11 Resource
temporarily unavailable
 35539 101733 lstc_server 0.000002 CALL  L64 
linux_select(0x6,0x7fffffffe310,0,0,0x7fffffffe390)
 35539 101733 lstc_server 156.624888 RET   L64  linux_select 1
 35539 101733 lstc_server 0.000042 CALL  L64 
linux_accept(0x4,0,0x7fffffffe3ac)
 35539 101733 lstc_server 0.000006 RET   L64  linux_accept 0

You say timeval conversion, I looked at the /etc/localtime (which is FreeBSD
UTC)
# cksum etc/localtime
2003832353 118 etc/localtime

There is no Linux /compat/linux/etc/localtime in this Jail, and when I check a
Linux computer's UTC, it is slightly different,

# hexdump UTC
0000000 5a54 6669 0032 0000 0000 0000 0000 0000
0000010 0000 0000 0000 0000 0000 0000 0000 0000
0000020 0000 0000 0000 0100 0000 0400 0000 0000
0000030 0000 5455 0043 5a54 6669 0032 0000 0000
0000040 0000 0000 0000 0000 0000 0000 0000 0000
0000050 0000 0000 0000 0000 0000 0000 0100 0000
0000060 0400 0000 0000 0000 5455 0043 550a 4354
0000070 0a30
0000072

After adding the Linux UTC as /compat/linux/etc/localtime

 35539 101733 lstc_server 0.000003 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000001 RET   L64  linux_time 1656450808/0x62bb6ef8
 35539 101733 lstc_server 0.000002 CALL  L64 
linux_newstat(0x800b88f74,0x7fffffffbe60)
 35539 101733 lstc_server 0.000001 NAMI  L64  "/compat/linux/etc/localtime"
 35539 101733 lstc_server 0.000002 NAMI  L64  "/compat/linux"
 35539 101733 lstc_server 0.000003 NAMI  L64  "/compat/linux/etc/localtime"
 35539 101733 lstc_server 0.000002 STRU  L64  struct stat
{dev=16125346129888550616, ino=390, mode=0100644, nlink=1, uid=0, gid=0,
rdev=18446744073709551615, atime=1656450714.160038000, mtime=1568973652,
ctime=1656450714.160221000, birthtime=1568973652, size=114, blksize=4096,
blocks=1, flags=0x800 }
 35539 101733 lstc_server 0.000001 RET   L64  linux_newstat 0
 35539 101733 lstc_server 0.000003 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000003 RET   L64  linux_time 1656450808/0x62bb6ef8
 35539 101733 lstc_server 0.000002 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000002 RET   L64  linux_time 1656450808/0x62bb6ef8
 35539 101733 lstc_server 0.000002 CALL  L64  linux_time(0)
 35539 101733 lstc_server 0.000001 RET   L64  linux_time 1656450808/0x62bb6ef8
 35539 101733 lstc_server 0.000003 CALL  L64 
linux_semop(0x60000,0x7fffffffe3d0,0x1)
 35539 101733 lstc_server 0.000001 RET   L64  linux_semop -1 errno -11 Resource
temporarily unavailable
 35539 101733 lstc_server 0.000004 CALL  L64 
linux_select(0x6,0x7fffffffe310,0,0,0x7fffffffe390)
 35539 101733 lstc_server 156.860688 RET   L64  linux_select 1
 35539 101733 lstc_server 0.000040 CALL  L64 
linux_accept(0x4,0,0x7fffffffe3ac)
 35539 101733 lstc_server 0.000004 RET   L64  linux_accept 0

-- 
You are receiving this mail because:
You are the assignee for the bug.