1

Every time I try to open a new tab by clicking on a link in another application (such as Thunderbird), the entire desktop freezes (mouse moves, but that's it) and nothing happens for 10-15 seconds.

Only after that time elapses, an existing firefox window appears with the new tab in it opening the requested URL normally.

This delay's been bothering me for some months now, and I finally got around to trace it. Simply running ktrace -i firefox some://new/url I find, that it spends 5 seconds inside an NVidia ioctl -- twice.

(Note, the 3rd column lists the seconds elapsed from the beginning):


> kdump -E
...
 62726 MainThread 0.114878 CALL  exit(0)
 62727 firefox  5.419059 RET   ioctl 0
 62727 firefox  5.419083 CALL  openat(AT_FDCWD,0x186bf4be2420,0x2<O_RDWR>)
 62727 firefox  5.419087 NAMI  "/dev/nvidia0"
 62727 firefox  5.419114 RET   openat 15/0xf
 62727 firefox  5.419116 CALL  fcntl(0xf,F_SETFD,FD_CLOEXEC)
 62727 firefox  5.419117 RET   fcntl 0
 62727 firefox  5.419119 CALL  ioctl(0xf,0xc01446ce,0x186bf4be2500)
 62727 firefox  10.649216 RET   ioctl 0
 62727 firefox  10.649233 CALL  openat(AT_FDCWD,0x186bf4be2420,0x2<O_RDWR>)
 62727 firefox  10.649236 NAMI  "/dev/nvidia0"
 62727 firefox  10.649305 RET   openat 16/0x10
 62727 firefox  10.649307 CALL  fcntl(0x10,F_SETFD,FD_CLOEXEC)
 62727 firefox  10.649309 RET   fcntl 0
 62727 firefox  10.649310 CALL  ioctl(0x10,0xc01446ce,0x186bf4be2500)
 62727 firefox  15.849375 RET   ioctl 0
 62727 firefox  15.849418 CALL  ioctl(0x8,0xc020462a,0x186bf4be24d0)

What is that ioctl 0xc01446ce? I gather, it is something NVidia-specific -- which would also explain the brief freezing of the entire desktop...

Can this be avoided somehow? There are people having this problem on Windows -- an advice for them was to turn off the "Use hardware-accelaration if availble" setting, which had no effect here, on FreeBSD.

Is there something else I can try?

Mikhail T.
  • 634
  • 1
  • 8
  • 27
  • What is you NVIDIA adapter and which driver are you using? Is it the [latest version](https://www.nvidia.com/en-us/drivers/unix/freebsd-x64-archive/)? – harrymc May 05 '23 at 18:32
  • Using the nvidia-driver-390-390.151. The latest (in the 390-branch) is .154 -- I'll try upgrading, but doubt that'll help... The adapter is a Quadro 600, with two monitors connected. – Mikhail T. May 05 '23 at 18:40
  • This might also be a problem with the internet. – harrymc May 05 '23 at 20:14

2 Answers2

0

Ok, I upgraded nvidia-driver from 390.151 to 390.154, which necessitated a reboot, unfortunately. So, before rebooting, I also rebuilt world/kernel to the latest 13/stable...

After the restart, the new tabs open instantly -- and I don't know, which was it. I tried restarting just the Firefox before -- and that was not helpful -- but a full reboot has not happened in a while (265 days).

I wonder, what is/was it about the NVidia, that caused an ioctl to take 5 seconds -- but not after a reboot...

Mikhail T.
  • 634
  • 1
  • 8
  • 27
-1

ioctl is for I/O, e.g., to disk. If there is little RAM, and Firefox needs to use the Windows Page File on disk, particularly HDD, that vastly slows things. Test Firefox, with no tabs open, after rebooting... if links open rapidly, then the issue is too many items cached with too little RAM.

If that is the issue, then there are a few ways to help.

  • Close unneeded tabs.
  • Add more RAM.
  • Switch from HDD to SSD.

Another possibility is that an extension is doing something in the background, e.g., verifying URL safety. Try running Firefox in Troubleshooting Mode. If that runs more quickly, then try to identify which extension(s) are slowing things.

DrMoishe Pippik
  • 25,661
  • 4
  • 36
  • 54