0

As far as I understand it does not even touches the filesystem. So what can be a cause for this, using strace -T:

 0.481441 getcwd("/home/user/web/url.com/public_html", 4096) = some number 

I am using Linux 4.9.30.

The system has some strange lags, i want to identify it. Cpu, iowait, load, memory, all seems to be normal It is a kvm virtual machine, maybe that changes something.

2 Answers 2

1

hint: sudo perf record -ag might give you interesting info here, including time spent in specific kernel functions, if you have kernel debug symbols installed.

Anyways,

As far as I understand it does not even touches the filesystem.

That's not correct. getcwd as implemented by the linux kernel has to check whether your cwd still exists, whether the file system it's on is still mounted, and iterate up to the root of the file system to check whether the directory is still reachable.

That can have side effects, and be delayed by file systems somehow being in a state where they are blocked.

The most likely culprit here would be the RCU lock being held by very frequent memory reclamation runs in the kernel. That might be a hazardous driver's problem, but also things like very frequent namespace creations etc.

4
  • Thank you for your comment! According to perf there is no lag at all in the system. But according to strace it has. They measure performance differently. I am guessing, that someone steals all processor resources from the guest, and this way perf does not even runs when there is a lag. Strace lags are all over the place, pretty random to my eyes. So i am guessing my problem has nothing to do with getcwd(). Commented May 31, 2022 at 5:55
  • Perf would tell you if it missed samples Commented May 31, 2022 at 6:28
  • 1
    We found it. Your comment that this command does use the filesystem helped to identify it. Thank you! Commented Jun 12, 2022 at 6:21
  • @jsaak glad you did! Commented Jun 12, 2022 at 11:53
1

We found out, that it was a faulty SSD. These were the commands that helped to identify it:

$ ioping -c 20 /home/jsaak/temp/ min/avg/max/mdev = 1.00 ms / 5.71 ms / 29.3 ms / 7.62 ms 
$ fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=fiotest --filename=testfio --bs=4k --iodepth=64 --size=32M --readwrite=randrw --rwmixread=75 read : io=24608KB, bw=3136.8KB/s, iops=784, runt= 7845msec write: io=8160.0KB, bw=1040.2KB/s, iops=260, runt= 7845msec 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.