HewlettPackard / HewlettPackard/LinuxKI
BUG: scheduling while atomic
- Dominant language
- C
- Stars
- 260
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
The following stack trace was observed in the message buffer, and threads/cpus may potentially hang:
```
[103749.755327] [T1537571] BUG: scheduling while atomic: /1537571/0x00000002
[103749.755455] [T1537571] CPU: 121 PID: 1537571 Comm: Kdump: loaded Tainted: G W OE n 6.4.0-150700.53.31.1.31163.1.PTF.1258832-default #1 SLE15-SP7 c32f9d05779acfd3c26375bed
0af236826910550
[103749.755461] [T1537571] Hardware name: HPE Compute Scale-up Server 3250/Compute Scale-up Server 3250, BIOS Bundle:1.0.318-20260202_033206 SFW:010.001.009.000.26013002
[103749.755463] [T1537571] Call Trace:
[103749.755463] [T1537571]
[103749.755468] [T1537571] dump_stack_lvl+0x57/0x80
[103749.755472] [T1537571] __schedule_bug+0x56/0x70
[103749.755475] [T1537571] __schedule+0x110f/0x1510
[103749.755477] [T1537571] ? udp_sendmsg+0x309/0xeb0
[103749.755480] [T1537571] schedule+0x24/0xb0
[103749.755483] [T1537571] __lock_sock+0x79/0xc0
[103749.755488] [T1537571] ? __pfx_autoremove_wake_function+0x10/0x10
[103749.755490] [T1537571] lock_sock_nested+0x30/0x50
[103749.755492] [T1537571] inet_getname+0x41/0x120
[103749.755496] [T1537571] syscall_exit_trace+0xada/0x1090 [likit 0591213becb6a96489dcb7606c95c9281782a9f8]
```
Note that the liki function syscall_exit_trace() is calling inet_getname(). We can see this in the liki code below:
` if ((loclen = sock->ops->getname(sock, (struct sockaddr *)&local, 0)) <= 0) {
`
You can see in the stack trace that when inet_getname() is called, the thread tries to go to sleep as the socket is locked. I thought it was odd that another thread would be operating on the same socket, but this benchmark test is using the loopback network. So there is a thread writing to the socket and a thread reading the socket at the same time. But you could also have multiple threads writing to the same socket, or reading from the same socket.
In short, we don’t want code that LiKI calls going to sleep. I’ve already had to remove normal file lookups as you can see in the comment here:
```
fput_needed = 1;
if ((sock = sockfd_lookup_light_fp(fd, &err, &fput_needed)) != NULL) {
...
} else {
/* if target if NFS file, we have issues which can cause softlockups,
so we cannot call vfs_fstat(), so just exit
*/
goto scexit_skip_vldata;
}
```
I really like getting the IP addresses with the system calls:
` 0.007017 cpu=460 pid=1551469 tgid=1551469 recvfrom [45] ret=272 syscallbeg= 0.000002 sockfd=9 *buf=0x7f01ab7ff048 len=272 flags=0x0 *src_addr=0x0 *addrlen=0x0 family=INET type=TCP L=127.0.0.1:44540 R=127.0.0.1:39715`
Unfortunately, looks like we are going to have to lose this. Note if we get lsof data, we may still get the IP addresses with kipid output, but it does mean that we may lose some important IP address information if the socket was not open when lsof was run or lsof was unavailable.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.