All of lore.kernel.org
 help / color / mirror / Atom feed
* Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
@ 2016-08-01  9:03 Marcin Mirosław
  2016-08-01  9:08 ` Vitaly Wool
  2016-08-04 11:58 ` Sergey Senozhatsky
  0 siblings, 2 replies; 10+ messages in thread
From: Marcin Mirosław @ 2016-08-01  9:03 UTC (permalink / raw)
  To: linux-mm; +Cc: vitaly.wool

Hi!
I'm testing kernel-git
(git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git , at
07f00f06ba9a5533d6650d46d3e938f6cbeee97e ) because I noticed strange OOM
behavior in kernel 4.7.0. As for now I can't reproduce problems with
OOM, probably it's fixed now.
But now I wanted to try z3fold with zswap. When I did `echo z3fold >
/sys/module/zswap/parameters/zpool` I got trace from dmesg:

[  429.722411] ------------[ cut here ]------------
[  429.723476] WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503
__zswap_pool_current+0x56/0x60
[  429.725161] Modules linked in: z3fold tun algif_skcipher af_alg
dm_crypt netconsole xt_policy ipt_REJECT nf_reject_ipv4 xt_TARPIT(OE)
xt_NFLOG ip_set_hash_ip ip_set_hash_net xt_SYSRQ(OE) xt_multiport
nfnetlink_queue sit ip_tunnel tunnel4 xt_set ip_set iptable_filter
xt_nat xt_comment xt_length iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4
nf_nat_ipv4 nf_nat iptable_mangle xt_CT iptable_raw ip_tables
nf_conntrack_ipv6 nf_defrag_ipv6 ip6t_rt xt_conntrack nf_conntrack
ip6table_filter ip6table_mangle ip6_tables ipv6 xfs libcrc32c btrfs xor
zlib_deflate raid6_pq tcp_diag inet_diag aesni_intel aes_x86_64
glue_helper lrw gf128mul ablk_helper cryptd button virtio_net
virtio_balloon crc32c_intel
[  429.738937] CPU: 0 PID: 5140 Comm: bash Tainted: G           OE
4.7.0+ #4
[  429.739880] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007
[  429.740048]  0000000000000286 000000002ea2eeca ffff8ecca91efcd8
ffffffffad255d43
[  429.740048]  0000000000000000 0000000000000000 ffff8ecca91efd18
ffffffffad04c997
[  429.740048]  000001f700000003 ffffffffad9b8a58 ffff8eccbd162b58
0000000000000000
[  429.740048] Call Trace:
[  429.740048]  [<ffffffffad255d43>] dump_stack+0x63/0x90
[  429.740048]  [<ffffffffad04c997>] __warn+0xc7/0xf0
[  429.740048]  [<ffffffffad04cac8>] warn_slowpath_null+0x18/0x20
[  429.740048]  [<ffffffffad1250c6>] __zswap_pool_current+0x56/0x60
[  429.740048]  [<ffffffffad1250e3>] zswap_pool_current+0x13/0x20
[  429.740048]  [<ffffffffad125efb>] __zswap_param_set+0x1db/0x2f0
[  429.740048]  [<ffffffffad126042>] zswap_zpool_param_set+0x12/0x20
[  429.740048]  [<ffffffffad06645f>] param_attr_store+0x5f/0xc0
[  429.740048]  [<ffffffffad065b69>] module_attr_store+0x19/0x30
[  429.740048]  [<ffffffffad1b0b02>] sysfs_kf_write+0x32/0x40
[  429.740048]  [<ffffffffad1b0663>] kernfs_fop_write+0x113/0x190
[  429.740048]  [<ffffffffad13fc52>] __vfs_write+0x32/0x150
[  429.740048]  [<ffffffffad15f0ae>] ? __fd_install+0x2e/0xe0
[  429.740048]  [<ffffffffad15ef11>] ? __alloc_fd+0x41/0x180
[  429.740048]  [<ffffffffad0838dd>] ? percpu_down_read+0xd/0x50
[  429.740048]  [<ffffffffad140d33>] vfs_write+0xb3/0x1a0
[  429.740048]  [<ffffffffad13db81>] ? filp_close+0x51/0x70
[  429.740048]  [<ffffffffad142140>] SyS_write+0x50/0xc0
[  429.740048]  [<ffffffffad413836>] entry_SYSCALL_64_fastpath+0x1e/0xa8
[  429.764069] ---[ end trace ff7835fbf4d983b9 ]---


Second issue:
Since 4.7.0 up to now I've got strange problem with starting BIND (dns).
It can't start, throws:
2016-08-01T10:42:21.449188+02:00 jowisz named[3730]: listening on IPv4
interface eth0, 81.4.122.249#53
2016-08-01T10:42:21.449412+02:00 jowisz named[3730]: could not listen on
UDP socket: out of memory
2016-08-01T10:42:21.449455+02:00 jowisz named[3730]: creating IPv4
interface eth0 failed; interface ignored
2016-08-01T10:42:21.449514+02:00 jowisz named[3730]: not listening on
any interfaces
2016-08-01T10:42:21.449670+02:00 jowisz named[3730]: generating session
key for dynamic DNS
2016-08-01T10:42:21.449910+02:00 jowisz named[3730]: sizing zone task
pool based on 69 zones
2016-08-01T10:42:21.450094+02:00 jowisz named[3730]: dns_master_load:
out of memory
2016-08-01T10:42:21.450668+02:00 jowisz named[3730]: could not configure
root hints from 'named.cache': out of memory
2016-08-01T10:42:21.451236+02:00 jowisz named[3730]: additionally
listening on IPv4 interface eth0, 81.4.122.249#53
2016-08-01T10:42:21.451298+02:00 jowisz named[3730]: could not listen on
UDP socket: out of memory
2016-08-01T10:42:21.451342+02:00 jowisz named[3730]: creating IPv4
interface eth0 failed; interface ignored
2016-08-01T10:42:21.451479+02:00 jowisz named[3730]: loading
configuration: out of memory
2016-08-01T10:42:21.451515+02:00 jowisz named[3730]: exiting (due to
fatal error)

strace shows:
[pid 26247] sendto(3, "<29>Aug  1 11:02:23 named[26230]"..., 80,
MSG_NOSIGNAL, NULL, 0) = 80
[pid 26247] mprotect(0x7f8828051000, 8192, PROT_READ|PROT_WRITE) = -1
ENOMEM (Cannot allocate memory)
[pid 26247] mmap(NULL, 134217728, PROT_NONE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f8820000000
[pid 26247] munmap(0x7f8824000000, 67108864) = 0
[pid 26247] mprotect(0x7f8820000000, 143360, PROT_READ|PROT_WRITE) = -1
ENOMEM (Cannot allocate memory)
[pid 26247] munmap(0x7f8820000000, 67108864) = 0
[pid 26247] mmap(NULL, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
[pid 26247] mprotect(0x7f8828051000, 8192, PROT_READ|PROT_WRITE) = -1
ENOMEM (Cannot allocate memory)
[pid 26247] mmap(0x7f8824000000, 67108864, PROT_NONE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f8824000000
[pid 26247] mprotect(0x7f8824000000, 143360, PROT_READ|PROT_WRITE) = -1
ENOMEM (Cannot allocate memory)
[pid 26247] munmap(0x7f8824000000, 67108864) = 0


Thanks,
Marcin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-01  9:03 Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60 Marcin Mirosław
@ 2016-08-01  9:08 ` Vitaly Wool
  2016-08-01  9:21   ` Marcin Mirosław
  2016-08-04 11:58 ` Sergey Senozhatsky
  1 sibling, 1 reply; 10+ messages in thread
From: Vitaly Wool @ 2016-08-01  9:08 UTC (permalink / raw)
  To: Marcin Mirosław; +Cc: Linux-MM

[-- Attachment #1: Type: text/plain, Size: 5822 bytes --]

Hi Marcin,

Den 1 aug. 2016 11:04 fm skrev "Marcin Mirosław" <marcin@mejor.pl>:
>
> Hi!
> I'm testing kernel-git
> (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git , at
> 07f00f06ba9a5533d6650d46d3e938f6cbeee97e ) because I noticed strange OOM
> behavior in kernel 4.7.0. As for now I can't reproduce problems with
> OOM, probably it's fixed now.
> But now I wanted to try z3fold with zswap. When I did `echo z3fold >
> /sys/module/zswap/parameters/zpool` I got trace from dmesg:

Could you please give more info on how to reproduce this?

~vitaly

>
> [  429.722411] ------------[ cut here ]------------
> [  429.723476] WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503
> __zswap_pool_current+0x56/0x60
> [  429.725161] Modules linked in: z3fold tun algif_skcipher af_alg
> dm_crypt netconsole xt_policy ipt_REJECT nf_reject_ipv4 xt_TARPIT(OE)
> xt_NFLOG ip_set_hash_ip ip_set_hash_net xt_SYSRQ(OE) xt_multiport
> nfnetlink_queue sit ip_tunnel tunnel4 xt_set ip_set iptable_filter
> xt_nat xt_comment xt_length iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4
> nf_nat_ipv4 nf_nat iptable_mangle xt_CT iptable_raw ip_tables
> nf_conntrack_ipv6 nf_defrag_ipv6 ip6t_rt xt_conntrack nf_conntrack
> ip6table_filter ip6table_mangle ip6_tables ipv6 xfs libcrc32c btrfs xor
> zlib_deflate raid6_pq tcp_diag inet_diag aesni_intel aes_x86_64
> glue_helper lrw gf128mul ablk_helper cryptd button virtio_net
> virtio_balloon crc32c_intel
> [  429.738937] CPU: 0 PID: 5140 Comm: bash Tainted: G           OE
> 4.7.0+ #4
> [  429.739880] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007
> [  429.740048]  0000000000000286 000000002ea2eeca ffff8ecca91efcd8
> ffffffffad255d43
> [  429.740048]  0000000000000000 0000000000000000 ffff8ecca91efd18
> ffffffffad04c997
> [  429.740048]  000001f700000003 ffffffffad9b8a58 ffff8eccbd162b58
> 0000000000000000
> [  429.740048] Call Trace:
> [  429.740048]  [<ffffffffad255d43>] dump_stack+0x63/0x90
> [  429.740048]  [<ffffffffad04c997>] __warn+0xc7/0xf0
> [  429.740048]  [<ffffffffad04cac8>] warn_slowpath_null+0x18/0x20
> [  429.740048]  [<ffffffffad1250c6>] __zswap_pool_current+0x56/0x60
> [  429.740048]  [<ffffffffad1250e3>] zswap_pool_current+0x13/0x20
> [  429.740048]  [<ffffffffad125efb>] __zswap_param_set+0x1db/0x2f0
> [  429.740048]  [<ffffffffad126042>] zswap_zpool_param_set+0x12/0x20
> [  429.740048]  [<ffffffffad06645f>] param_attr_store+0x5f/0xc0
> [  429.740048]  [<ffffffffad065b69>] module_attr_store+0x19/0x30
> [  429.740048]  [<ffffffffad1b0b02>] sysfs_kf_write+0x32/0x40
> [  429.740048]  [<ffffffffad1b0663>] kernfs_fop_write+0x113/0x190
> [  429.740048]  [<ffffffffad13fc52>] __vfs_write+0x32/0x150
> [  429.740048]  [<ffffffffad15f0ae>] ? __fd_install+0x2e/0xe0
> [  429.740048]  [<ffffffffad15ef11>] ? __alloc_fd+0x41/0x180
> [  429.740048]  [<ffffffffad0838dd>] ? percpu_down_read+0xd/0x50
> [  429.740048]  [<ffffffffad140d33>] vfs_write+0xb3/0x1a0
> [  429.740048]  [<ffffffffad13db81>] ? filp_close+0x51/0x70
> [  429.740048]  [<ffffffffad142140>] SyS_write+0x50/0xc0
> [  429.740048]  [<ffffffffad413836>] entry_SYSCALL_64_fastpath+0x1e/0xa8
> [  429.764069] ---[ end trace ff7835fbf4d983b9 ]---
>
>
> Second issue:
> Since 4.7.0 up to now I've got strange problem with starting BIND (dns).
> It can't start, throws:
> 2016-08-01T10:42:21.449188+02:00 jowisz named[3730]: listening on IPv4
> interface eth0, 81.4.122.249#53
> 2016-08-01T10:42:21.449412+02:00 jowisz named[3730]: could not listen on
> UDP socket: out of memory
> 2016-08-01T10:42:21.449455+02:00 jowisz named[3730]: creating IPv4
> interface eth0 failed; interface ignored
> 2016-08-01T10:42:21.449514+02:00 jowisz named[3730]: not listening on
> any interfaces
> 2016-08-01T10:42:21.449670+02:00 jowisz named[3730]: generating session
> key for dynamic DNS
> 2016-08-01T10:42:21.449910+02:00 jowisz named[3730]: sizing zone task
> pool based on 69 zones
> 2016-08-01T10:42:21.450094+02:00 jowisz named[3730]: dns_master_load:
> out of memory
> 2016-08-01T10:42:21.450668+02:00 jowisz named[3730]: could not configure
> root hints from 'named.cache': out of memory
> 2016-08-01T10:42:21.451236+02:00 jowisz named[3730]: additionally
> listening on IPv4 interface eth0, 81.4.122.249#53
> 2016-08-01T10:42:21.451298+02:00 jowisz named[3730]: could not listen on
> UDP socket: out of memory
> 2016-08-01T10:42:21.451342+02:00 jowisz named[3730]: creating IPv4
> interface eth0 failed; interface ignored
> 2016-08-01T10:42:21.451479+02:00 jowisz named[3730]: loading
> configuration: out of memory
> 2016-08-01T10:42:21.451515+02:00 jowisz named[3730]: exiting (due to
> fatal error)
>
> strace shows:
> [pid 26247] sendto(3, "<29>Aug  1 11:02:23 named[26230]"..., 80,
> MSG_NOSIGNAL, NULL, 0) = 80
> [pid 26247] mprotect(0x7f8828051000, 8192, PROT_READ|PROT_WRITE) = -1
> ENOMEM (Cannot allocate memory)
> [pid 26247] mmap(NULL, 134217728, PROT_NONE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f8820000000
> [pid 26247] munmap(0x7f8824000000, 67108864) = 0
> [pid 26247] mprotect(0x7f8820000000, 143360, PROT_READ|PROT_WRITE) = -1
> ENOMEM (Cannot allocate memory)
> [pid 26247] munmap(0x7f8820000000, 67108864) = 0
> [pid 26247] mmap(NULL, 12288, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
> [pid 26247] mprotect(0x7f8828051000, 8192, PROT_READ|PROT_WRITE) = -1
> ENOMEM (Cannot allocate memory)
> [pid 26247] mmap(0x7f8824000000, 67108864, PROT_NONE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f8824000000
> [pid 26247] mprotect(0x7f8824000000, 143360, PROT_READ|PROT_WRITE) = -1
> ENOMEM (Cannot allocate memory)
> [pid 26247] munmap(0x7f8824000000, 67108864) = 0
>
>
> Thanks,
> Marcin

[-- Attachment #2: Type: text/html, Size: 7023 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-01  9:08 ` Vitaly Wool
@ 2016-08-01  9:21   ` Marcin Mirosław
  2016-08-02  9:13     ` Vitaly Wool
  0 siblings, 1 reply; 10+ messages in thread
From: Marcin Mirosław @ 2016-08-01  9:21 UTC (permalink / raw)
  To: Vitaly Wool; +Cc: Linux-MM

W dniu 01.08.2016 o 11:08, Vitaly Wool pisze:
> Hi Marcin,
> 
> Den 1 aug. 2016 11:04 fm skrev "Marcin MirosA?aw" <marcin@mejor.pl
> <mailto:marcin@mejor.pl>>:
>>
>> Hi!
>> I'm testing kernel-git
>> (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> <http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git> , at
>> 07f00f06ba9a5533d6650d46d3e938f6cbeee97e ) because I noticed strange OOM
>> behavior in kernel 4.7.0. As for now I can't reproduce problems with
>> OOM, probably it's fixed now.
>> But now I wanted to try z3fold with zswap. When I did `echo z3fold >
>> /sys/module/zswap/parameters/zpool` I got trace from dmesg:
> 
> Could you please give more info on how to reproduce this?

Nothing special. Just rebooted server (vm on kvm), started services and
issued `echo z3fold > ...`

Marcin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-01  9:21   ` Marcin Mirosław
@ 2016-08-02  9:13     ` Vitaly Wool
  2016-08-02  9:52       ` Marcin Mirosław
  0 siblings, 1 reply; 10+ messages in thread
From: Vitaly Wool @ 2016-08-02  9:13 UTC (permalink / raw)
  To: Marcin Mirosław; +Cc: Linux-MM

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

On Mon, Aug 1, 2016 at 11:21 AM, Marcin Mirosław <marcin@mejor.pl> wrote:

> W dniu 01.08.2016 o 11:08, Vitaly Wool pisze:
> > Hi Marcin,
> >
> > Den 1 aug. 2016 11:04 fm skrev "Marcin Mirosław" <marcin@mejor.pl
> > <mailto:marcin@mejor.pl>>:
> >>
> >> Hi!
> >> I'm testing kernel-git
> >> (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > <http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git> , at
> >> 07f00f06ba9a5533d6650d46d3e938f6cbeee97e ) because I noticed strange OOM
> >> behavior in kernel 4.7.0. As for now I can't reproduce problems with
> >> OOM, probably it's fixed now.
> >> But now I wanted to try z3fold with zswap. When I did `echo z3fold >
> >> /sys/module/zswap/parameters/zpool` I got trace from dmesg:
> >
> > Could you please give more info on how to reproduce this?
>
> Nothing special. Just rebooted server (vm on kvm), started services and
> issued `echo z3fold > ...`
>

Well, first of all this is Intel right?

~vitaly

[-- Attachment #2: Type: text/html, Size: 1870 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-02  9:13     ` Vitaly Wool
@ 2016-08-02  9:52       ` Marcin Mirosław
  0 siblings, 0 replies; 10+ messages in thread
From: Marcin Mirosław @ 2016-08-02  9:52 UTC (permalink / raw)
  To: Vitaly Wool; +Cc: Linux-MM

W dniu 02.08.2016 o 11:13, Vitaly Wool pisze:
> 
> 
> On Mon, Aug 1, 2016 at 11:21 AM, Marcin MirosA?aw <marcin@mejor.pl
> <mailto:marcin@mejor.pl>> wrote:
> 
>     W dniu 01.08.2016 o 11:08, Vitaly Wool pisze:
>     > Hi Marcin,
>     >
>     > Den 1 aug. 2016 11:04 fm skrev "Marcin MirosA?aw" <marcin@mejor.pl <mailto:marcin@mejor.pl>
>     > <mailto:marcin@mejor.pl <mailto:marcin@mejor.pl>>>:
>     >>
>     >> Hi!
>     >> I'm testing kernel-git
>     >> (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>     <http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git>
>     >
>     <http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git> , at
>     >> 07f00f06ba9a5533d6650d46d3e938f6cbeee97e ) because I noticed strange OOM
>     >> behavior in kernel 4.7.0. As for now I can't reproduce problems with
>     >> OOM, probably it's fixed now.
>     >> But now I wanted to try z3fold with zswap. When I did `echo z3fold >
>     >> /sys/module/zswap/parameters/zpool` I got trace from dmesg:
>     >
>     > Could you please give more info on how to reproduce this?
> 
>     Nothing special. Just rebooted server (vm on kvm), started services and
>     issued `echo z3fold > ...`
> 
> 
> Well, first of all this is Intel right?


Yes, this is Intel and I'm sitting inside vm (KVM).
[...]
processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz
stepping        : 4
microcode       : 0x1
cpu MHz         : 2599.851
cache size      : 4096 KB
physical id     : 3
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb lm
constant_tsc arch_perfmon nopl eagerfpu pni pclmulqdq ssse3 cx16 pcid
sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand
hypervisor lahf_lm fsgsbase smep xsaveopt
bugs            :
bogomips        : 5199.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

I've got 4 VCPU.

Marcin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-01  9:03 Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60 Marcin Mirosław
  2016-08-01  9:08 ` Vitaly Wool
@ 2016-08-04 11:58 ` Sergey Senozhatsky
  2016-08-04 18:15   ` Dan Streetman
  2016-08-07 22:40   ` Vitaly Wool
  1 sibling, 2 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2016-08-04 11:58 UTC (permalink / raw)
  To: Seth Jennings, Dan Streetman
  Cc: linux-mm, Vitaly Wool, Marcin Mirosław, Andrew Morton

Hello,

Cc Seth, Dan

On (08/01/16 11:03), Marcin MirosA?aw wrote:
> [  429.722411] ------------[ cut here ]------------
> [  429.723476] WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
> [  429.740048] Call Trace:
> [  429.740048]  [<ffffffffad255d43>] dump_stack+0x63/0x90
> [  429.740048]  [<ffffffffad04c997>] __warn+0xc7/0xf0
> [  429.740048]  [<ffffffffad04cac8>] warn_slowpath_null+0x18/0x20
> [  429.740048]  [<ffffffffad1250c6>] __zswap_pool_current+0x56/0x60
> [  429.740048]  [<ffffffffad1250e3>] zswap_pool_current+0x13/0x20
> [  429.740048]  [<ffffffffad125efb>] __zswap_param_set+0x1db/0x2f0
> [  429.740048]  [<ffffffffad126042>] zswap_zpool_param_set+0x12/0x20
> [  429.740048]  [<ffffffffad06645f>] param_attr_store+0x5f/0xc0
> [  429.740048]  [<ffffffffad065b69>] module_attr_store+0x19/0x30
> [  429.740048]  [<ffffffffad1b0b02>] sysfs_kf_write+0x32/0x40
> [  429.740048]  [<ffffffffad1b0663>] kernfs_fop_write+0x113/0x190
> [  429.740048]  [<ffffffffad13fc52>] __vfs_write+0x32/0x150
> [  429.740048]  [<ffffffffad15f0ae>] ? __fd_install+0x2e/0xe0
> [  429.740048]  [<ffffffffad15ef11>] ? __alloc_fd+0x41/0x180
> [  429.740048]  [<ffffffffad0838dd>] ? percpu_down_read+0xd/0x50
> [  429.740048]  [<ffffffffad140d33>] vfs_write+0xb3/0x1a0
> [  429.740048]  [<ffffffffad13db81>] ? filp_close+0x51/0x70
> [  429.740048]  [<ffffffffad142140>] SyS_write+0x50/0xc0
> [  429.740048]  [<ffffffffad413836>] entry_SYSCALL_64_fastpath+0x1e/0xa8
> [  429.764069] ---[ end trace ff7835fbf4d983b9 ]---

I think it's something like this.

suppose there are no pools available - the list is empty (see later).
__zswap_param_set():

	pool = zswap_pool_find_get(type, compressor);

gives NULL. so it creates a new one

	pool = zswap_pool_create(type, compressor);

then it does

	ret = param_set_charp(s, kp);

which gives 0 -- all ok. so it goes to

	if (!ret) {
		put_pool = zswap_pool_current();
	}

which gives WARN_ON(), as the list is still empty.



now, how is this possible. for example, we init a zswap with the default
configuration; but zbud is not available (can it be?). so the pool creation
fails, but init_zswap() does not set zswap_init_started back to false. it
either must clear it at the error path, or set it to true right before
'return 0'.

one more problem here is that param_set_charp() does GFP_KERNEL
under zswap_pools_lock.

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-04 11:58 ` Sergey Senozhatsky
@ 2016-08-04 18:15   ` Dan Streetman
  2016-08-05  0:43     ` Sergey Senozhatsky
  2016-08-07 22:40   ` Vitaly Wool
  1 sibling, 1 reply; 10+ messages in thread
From: Dan Streetman @ 2016-08-04 18:15 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Seth Jennings, Linux-MM, Vitaly Wool, Marcin Mirosław,
	Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 2921 bytes --]

On Thu, Aug 4, 2016 at 7:58 AM, Sergey Senozhatsky <
sergey.senozhatsky.work@gmail.com> wrote:

> Hello,
>
> Cc Seth, Dan
>
> On (08/01/16 11:03), Marcin Mirosław wrote:
> > [  429.722411] ------------[ cut here ]------------
> > [  429.723476] WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503
> __zswap_pool_current+0x56/0x60
> > [  429.740048] Call Trace:
> > [  429.740048]  [<ffffffffad255d43>] dump_stack+0x63/0x90
> > [  429.740048]  [<ffffffffad04c997>] __warn+0xc7/0xf0
> > [  429.740048]  [<ffffffffad04cac8>] warn_slowpath_null+0x18/0x20
> > [  429.740048]  [<ffffffffad1250c6>] __zswap_pool_current+0x56/0x60
> > [  429.740048]  [<ffffffffad1250e3>] zswap_pool_current+0x13/0x20
> > [  429.740048]  [<ffffffffad125efb>] __zswap_param_set+0x1db/0x2f0
> > [  429.740048]  [<ffffffffad126042>] zswap_zpool_param_set+0x12/0x20
> > [  429.740048]  [<ffffffffad06645f>] param_attr_store+0x5f/0xc0
> > [  429.740048]  [<ffffffffad065b69>] module_attr_store+0x19/0x30
> > [  429.740048]  [<ffffffffad1b0b02>] sysfs_kf_write+0x32/0x40
> > [  429.740048]  [<ffffffffad1b0663>] kernfs_fop_write+0x113/0x190
> > [  429.740048]  [<ffffffffad13fc52>] __vfs_write+0x32/0x150
> > [  429.740048]  [<ffffffffad15f0ae>] ? __fd_install+0x2e/0xe0
> > [  429.740048]  [<ffffffffad15ef11>] ? __alloc_fd+0x41/0x180
> > [  429.740048]  [<ffffffffad0838dd>] ? percpu_down_read+0xd/0x50
> > [  429.740048]  [<ffffffffad140d33>] vfs_write+0xb3/0x1a0
> > [  429.740048]  [<ffffffffad13db81>] ? filp_close+0x51/0x70
> > [  429.740048]  [<ffffffffad142140>] SyS_write+0x50/0xc0
> > [  429.740048]  [<ffffffffad413836>] entry_SYSCALL_64_fastpath+0x1e/0xa8
> > [  429.764069] ---[ end trace ff7835fbf4d983b9 ]---
>
> I think it's something like this.
>
> suppose there are no pools available - the list is empty (see later).
> __zswap_param_set():
>
>         pool = zswap_pool_find_get(type, compressor);
>
> gives NULL. so it creates a new one
>
>         pool = zswap_pool_create(type, compressor);
>
> then it does
>
>         ret = param_set_charp(s, kp);
>
> which gives 0 -- all ok. so it goes to
>
>         if (!ret) {
>                 put_pool = zswap_pool_current();
>         }
>
> which gives WARN_ON(), as the list is still empty.
>
>
>
> now, how is this possible. for example, we init a zswap with the default
> configuration; but zbud is not available (can it be?). so the pool creation
> fails, but init_zswap() does not set zswap_init_started back to false. it
> either must clear it at the error path, or set it to true right before
> 'return 0'.
>

yep that's exactly right.  I reproduced it with zbud compiled out.



>
> one more problem here is that param_set_charp() does GFP_KERNEL
> under zswap_pools_lock.
>

yep that's true as well.

i can get patches going for both these, unless you're already working on it?




>
>         -ss
>

[-- Attachment #2: Type: text/html, Size: 4110 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-04 18:15   ` Dan Streetman
@ 2016-08-05  0:43     ` Sergey Senozhatsky
  2016-08-05  1:22       ` Sergey Senozhatsky
  0 siblings, 1 reply; 10+ messages in thread
From: Sergey Senozhatsky @ 2016-08-05  0:43 UTC (permalink / raw)
  To: Dan Streetman
  Cc: Sergey Senozhatsky, Seth Jennings, Linux-MM, Vitaly Wool,
	Marcin Mirosław, Andrew Morton

On (08/04/16 14:15), Dan Streetman wrote:
[..]
>    yep that's exactly right.  I reproduced it with zbud compiled out.
[..]
>    yep that's true as well.
>    i can get patches going for both these, unless you're already working on
>    it?

please go ahead.

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-05  0:43     ` Sergey Senozhatsky
@ 2016-08-05  1:22       ` Sergey Senozhatsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2016-08-05  1:22 UTC (permalink / raw)
  To: Dan Streetman
  Cc: Seth Jennings, Linux-MM, Vitaly Wool, Marcin Mirosław,
	Andrew Morton, Sergey Senozhatsky, Sergey Senozhatsky

On (08/05/16 09:43), Sergey Senozhatsky wrote:
> On (08/04/16 14:15), Dan Streetman wrote:
> [..]
> >    yep that's exactly right.  I reproduced it with zbud compiled out.
> [..]
> >    yep that's true as well.
> >    i can get patches going for both these, unless you're already working on
> >    it?
> 
> please go ahead.

while at it.

__zswap_param_set():

	pool = zswap_pool_find_get(type, compressor);
	if (pool) {
		zswap_pool_debug("using existing", pool);
		list_del_rcu(&pool->list);
	} else {
		spin_unlock(&zswap_pools_lock);
		pool = zswap_pool_create(type, compressor);
		spin_lock(&zswap_pools_lock);
	}

	if (pool)
		ret = param_set_charp(s, kp);
	else
		ret = -EINVAL;

	if (!ret) {
		put_pool = zswap_pool_current();
		list_add_rcu(&pool->list, &zswap_pools);
	} else if (pool) {
		/* add the possibly pre-existing pool to the end of the pools
		 * list; if it's new (and empty) then it'll be removed and
		 * destroyed by the put after we drop the lock
		 */
		list_add_tail_rcu(&pool->list, &zswap_pools);
		put_pool = pool;
	}

this can be simplified, I think.

suppose there is no zswap_pool_find_get() pool. so we try to
zswap_pool_create() one, but it doesn't go well. at this point
we basically can just return -ENOMEM

	spin_unlock(&zswap_pools_lock);
	pool = zswap_pool_create(type, compressor);
	if (!pool)
		return -ENOMEM;
	spin_lock(&zswap_pools_lock);

so some of later if-s can go away.

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
  2016-08-04 11:58 ` Sergey Senozhatsky
  2016-08-04 18:15   ` Dan Streetman
@ 2016-08-07 22:40   ` Vitaly Wool
  1 sibling, 0 replies; 10+ messages in thread
From: Vitaly Wool @ 2016-08-07 22:40 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Seth Jennings, Dan Streetman, Linux-MM, Marcin Mirosław,
	Andrew Morton

Hi Sergey,

On Thu, Aug 4, 2016 at 1:58 PM, Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
> Hello,
>
> Cc Seth, Dan
>
> On (08/01/16 11:03), Marcin Mirosław wrote:
>> [  429.722411] ------------[ cut here ]------------
>> [  429.723476] WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60
>> [  429.740048] Call Trace:
>> [  429.740048]  [<ffffffffad255d43>] dump_stack+0x63/0x90
>> [  429.740048]  [<ffffffffad04c997>] __warn+0xc7/0xf0
>> [  429.740048]  [<ffffffffad04cac8>] warn_slowpath_null+0x18/0x20
>> [  429.740048]  [<ffffffffad1250c6>] __zswap_pool_current+0x56/0x60
>> [  429.740048]  [<ffffffffad1250e3>] zswap_pool_current+0x13/0x20
>> [  429.740048]  [<ffffffffad125efb>] __zswap_param_set+0x1db/0x2f0
>> [  429.740048]  [<ffffffffad126042>] zswap_zpool_param_set+0x12/0x20
>> [  429.740048]  [<ffffffffad06645f>] param_attr_store+0x5f/0xc0
>> [  429.740048]  [<ffffffffad065b69>] module_attr_store+0x19/0x30
>> [  429.740048]  [<ffffffffad1b0b02>] sysfs_kf_write+0x32/0x40
>> [  429.740048]  [<ffffffffad1b0663>] kernfs_fop_write+0x113/0x190
>> [  429.740048]  [<ffffffffad13fc52>] __vfs_write+0x32/0x150
>> [  429.740048]  [<ffffffffad15f0ae>] ? __fd_install+0x2e/0xe0
>> [  429.740048]  [<ffffffffad15ef11>] ? __alloc_fd+0x41/0x180
>> [  429.740048]  [<ffffffffad0838dd>] ? percpu_down_read+0xd/0x50
>> [  429.740048]  [<ffffffffad140d33>] vfs_write+0xb3/0x1a0
>> [  429.740048]  [<ffffffffad13db81>] ? filp_close+0x51/0x70
>> [  429.740048]  [<ffffffffad142140>] SyS_write+0x50/0xc0
>> [  429.740048]  [<ffffffffad413836>] entry_SYSCALL_64_fastpath+0x1e/0xa8
>> [  429.764069] ---[ end trace ff7835fbf4d983b9 ]---
>
> I think it's something like this.
>
> suppose there are no pools available - the list is empty (see later).
> __zswap_param_set():
>
>         pool = zswap_pool_find_get(type, compressor);
>
> gives NULL. so it creates a new one
>
>         pool = zswap_pool_create(type, compressor);
>
> then it does
>
>         ret = param_set_charp(s, kp);
>
> which gives 0 -- all ok. so it goes to
>
>         if (!ret) {
>                 put_pool = zswap_pool_current();
>         }
>
> which gives WARN_ON(), as the list is still empty.
>
>
>
> now, how is this possible. for example, we init a zswap with the default
> configuration; but zbud is not available (can it be?). so the pool creation
> fails, but init_zswap() does not set zswap_init_started back to false. it
> either must clear it at the error path, or set it to true right before
> 'return 0'.
>
> one more problem here is that param_set_charp() does GFP_KERNEL
> under zswap_pools_lock.
>

Thanks a lot for looking into this, I have very limited ability to
debug stuff while on vacation :)

~vitaly

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-07 22:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01  9:03 Choosing z3fold allocator in zswap gives WARNING: CPU: 0 PID: 5140 at mm/zswap.c:503 __zswap_pool_current+0x56/0x60 Marcin Mirosław
2016-08-01  9:08 ` Vitaly Wool
2016-08-01  9:21   ` Marcin Mirosław
2016-08-02  9:13     ` Vitaly Wool
2016-08-02  9:52       ` Marcin Mirosław
2016-08-04 11:58 ` Sergey Senozhatsky
2016-08-04 18:15   ` Dan Streetman
2016-08-05  0:43     ` Sergey Senozhatsky
2016-08-05  1:22       ` Sergey Senozhatsky
2016-08-07 22:40   ` Vitaly Wool

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.