<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Petr,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for your debugging.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 20, 2021 at 8:47 PM Petr Vorel <<a href="mailto:pvorel@suse.cz">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Alexander, Li,<br>
<br>
First I found quite hard to have correct setup to avoid TCONF "Not enough swap<br>
space to test". It often requires to add additional swap file via mkswap && swapon<br>
and use some RAM with:<br>
<br>
dd if=/dev/zero of=/dev/shm/fill bs=1k count=14024k<br>
<br>
It'd be great if test could do required setup itself.<br>
And it'd also help at least to print swap_free_init and mem_over_max in that TCONF:<br>
<br>
if (swap_free_init < mem_over_max)<br>
- tst_brk(TCONF, "Not enough swap space to test.");<br>
+ tst_brk(TCONF, "Not enough swap space to test (%ld < %ld)", swap_free_init, mem_over_max);<br>
<br>
<br>
I tried to debug swapping01 on s390x (without this patch) with using additional<br>
swap and eat RAM with dd. and got bus error (core dumped). Is that due too<br>
aggressive memory eating? I'm not able to crash it on intel arch.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I think it is the correct behavior on your system, noticed that you tried</div><div class="gmail_default" style="font-size:small">with almost 14G(1k*14024k) on /dev/shm, but the MemFree is only</div><div class="gmail_default" style="">3218768 kB on your system. Since the size of /dev/shm is limited by</div><div class="gmail_default" style="">excess RAM, so that couldn't provide such a huge ramdisk for your test</div><div class="gmail_default" style="">and get SIGBUS eventually.</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="">(you can have a look the size of /dev/shm/fill is far less than 14G, I believe)</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
# strace ./swapping01<br>
execve("./swapping01", ["./swapping01"], 0x3ffdd9fdd30 /* 163 vars */) = 0<br>
brk(NULL) = 0x18ce000<br>
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3ffb41fc000<br>
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br>
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3<br>
fstat(3, {st_mode=S_IFREG|0644, st_size=51982, ...}) = 0<br>
mmap(NULL, 51982, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3ffb4100000<br>
close(3) = 0<br>
openat(AT_FDCWD, "/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3<br>
read(3, "\177ELF\2\2\1\0\0\0\0\0\0\0\0\0\0\3\0\26\0\0\0\1\0\0\0\0\0\0\205\370"..., 832) = 832<br>
fstat(3, {st_mode=S_IFREG|0755, st_size=160168, ...}) = 0<br>
mmap(NULL, 143720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3ffb4080000<br>
mprotect(0x3ffb409d000, 4096, PROT_NONE) = 0<br>
mmap(0x3ffb409e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x3ffb409e000<br>
mmap(0x3ffb40a0000, 12648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3ffb40a0000<br>
close(3) = 0<br>
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3<br>
read(3, "\177ELF\2\2\1\3\0\0\0\0\0\0\0\0\0\3\0\26\0\0\0\1\0\0\0\0\0\2\263\250"..., 832) = 832<br>
fstat(3, {st_mode=S_IFREG|0755, st_size=2012560, ...}) = 0<br>
mmap(NULL, 1765032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3ffb3e80000<br>
mprotect(0x3ffb4025000, 4096, PROT_NONE) = 0<br>
mmap(0x3ffb4026000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a5000) = 0x3ffb4026000<br>
mmap(0x3ffb402c000, 11944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3ffb402c000<br>
close(3) = 0<br>
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3ffb41fa000<br>
mprotect(0x3ffb4026000, 12288, PROT_READ) = 0<br>
mprotect(0x3ffb409e000, 4096, PROT_READ) = 0<br>
mprotect(0x1025000, 4096, PROT_READ) = 0<br>
mprotect(0x3ffb41a7000, 4096, PROT_READ) = 0<br>
munmap(0x3ffb4100000, 51982) = 0<br>
set_tid_address(0x3ffb41fb060) = 124658<br>
set_robust_list(0x3ffb41fb070, 24) = 0<br>
rt_sigaction(SIGRTMIN, {sa_handler=0x3ffb4088050, sa_mask=[], sa_flags=SA_SIGINFO}, NULL, 8) = 0<br>
rt_sigaction(SIGRT_1, {sa_handler=0x3ffb4088108, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0<br>
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br>
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0<br>
getpid() = 124658<br>
geteuid() = 0<br>
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 3<br>
read(3, "0-1\n", 8192) = 4<br>
close(3) = 0<br>
access("/dev/shm", F_OK) = 0<br>
getpid() = 124658<br>
openat(AT_FDCWD, "/dev/shm/ltp_swapping01_124658", O_RDWR|O_CREAT|O_EXCL, 0600) = 3<br>
chmod("/dev/shm/ltp_swapping01_124658", 0666) = 0<br>
ftruncate(3, 4096) = 0<br>
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x3ffb4100000<br>
unlink("/dev/shm/ltp_swapping01_124658") = 0<br>
close(3) = 0<br>
rt_sigaction(SIGALRM, {sa_handler=0x1005a88, sa_mask=[ALRM], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0<br>
rt_sigaction(SIGUSR1, {sa_handler=0x1005910, sa_mask=[USR1], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0<br>
--- SIGBUS {si_signo=SIGBUS, si_code=BUS_ADRERR, si_addr=0x3ffb4100000} ---<br>
+++ killed by SIGBUS (core dumped) +++<br>
Bus error (core dumped)<br>
<br>
$ cat /proc/meminfo<br>
MemTotal: 12300520 kB<br>
MemFree: 3218768 kB<br>
MemAvailable: 5748908 kB<br>
Buffers: 6956 kB<br>
Cached: 8756848 kB<br>
SwapCached: 0 kB<br>
Active: 6651856 kB<br>
Inactive: 2152212 kB<br>
Active(anon): 6198384 kB<br>
Inactive(anon): 24904 kB<br>
Active(file): 453472 kB<br>
Inactive(file): 2127308 kB<br>
Unevictable: 18292 kB<br>
Mlocked: 18292 kB<br>
SwapTotal: 2538488 kB<br>
SwapFree: 2538488 kB<br>
Dirty: 16 kB<br>
Writeback: 0 kB<br>
AnonPages: 56544 kB<br>
Mapped: 32840 kB<br>
Shmem: 6175368 kB<br>
KReclaimable: 105912 kB<br>
Slab: 156604 kB<br>
SReclaimable: 105912 kB<br>
SUnreclaim: 50692 kB<br>
KernelStack: 6672 kB<br>
PageTables: 1976 kB<br>
NFS_Unstable: 0 kB<br>
Bounce: 0 kB<br>
WritebackTmp: 0 kB<br>
CommitLimit: 8688748 kB<br>
Committed_AS: 6360300 kB<br>
VmallocTotal: 132120576 kB<br>
VmallocUsed: 49520 kB<br>
VmallocChunk: 0 kB<br>
Percpu: 67680 kB<br>
AnonHugePages: 22528 kB<br>
ShmemHugePages: 0 kB<br>
ShmemPmdMapped: 0 kB<br>
CmaTotal: 0 kB<br>
CmaFree: 0 kB<br>
HugePages_Total: 0<br>
HugePages_Free: 0<br>
HugePages_Rsvd: 0<br>
HugePages_Surp: 0<br>
Hugepagesize: 1024 kB<br>
Hugetlb: 0 kB<br>
DirectMap4k: 6144 kB<br>
DirectMap1M: 4188160 kB<br>
DirectMap2G: 8388608 kB<br>
<br>
Kind regards,<br>
Petr<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>