Files
linux/arch/s390/include/asm
Christian Borntraeger 2173eee31d KVM: s390: reduce number of IO pins to 1
[ Upstream commit 774911290c ]

The current number of KVM_IRQCHIP_NUM_PINS results in an order 3
allocation (32kb) for each guest start/restart. This can result in OOM
killer activity even with free swap when the memory is fragmented
enough:

kernel: qemu-system-s39 invoked oom-killer: gfp_mask=0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), order=3, oom_score_adj=0
kernel: CPU: 1 PID: 357274 Comm: qemu-system-s39 Kdump: loaded Not tainted 5.4.0-29-generic #33-Ubuntu
kernel: Hardware name: IBM 8562 T02 Z06 (LPAR)
kernel: Call Trace:
kernel: ([<00000001f848fe2a>] show_stack+0x7a/0xc0)
kernel:  [<00000001f8d3437a>] dump_stack+0x8a/0xc0
kernel:  [<00000001f8687032>] dump_header+0x62/0x258
kernel:  [<00000001f8686122>] oom_kill_process+0x172/0x180
kernel:  [<00000001f8686abe>] out_of_memory+0xee/0x580
kernel:  [<00000001f86e66b8>] __alloc_pages_slowpath+0xd18/0xe90
kernel:  [<00000001f86e6ad4>] __alloc_pages_nodemask+0x2a4/0x320
kernel:  [<00000001f86b1ab4>] kmalloc_order+0x34/0xb0
kernel:  [<00000001f86b1b62>] kmalloc_order_trace+0x32/0xe0
kernel:  [<00000001f84bb806>] kvm_set_irq_routing+0xa6/0x2e0
kernel:  [<00000001f84c99a4>] kvm_arch_vm_ioctl+0x544/0x9e0
kernel:  [<00000001f84b8936>] kvm_vm_ioctl+0x396/0x760
kernel:  [<00000001f875df66>] do_vfs_ioctl+0x376/0x690
kernel:  [<00000001f875e304>] ksys_ioctl+0x84/0xb0
kernel:  [<00000001f875e39a>] __s390x_sys_ioctl+0x2a/0x40
kernel:  [<00000001f8d55424>] system_call+0xd8/0x2c8

As far as I can tell s390x does not use the iopins as we bail our for
anything other than KVM_IRQ_ROUTING_S390_ADAPTER and the chip/pin is
only used for KVM_IRQ_ROUTING_IRQCHIP. So let us use a small number to
reduce the memory footprint.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20200617083620.5409-1-borntraeger@de.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-16 08:29:34 +09:00
..
2014-03-04 10:41:04 +01:00
2016-06-13 15:58:23 +02:00
2016-06-13 15:58:19 +02:00
2016-03-07 16:54:32 +01:00
2015-10-14 14:32:15 +02:00
2015-11-27 09:24:17 +01:00
2016-08-29 11:05:09 +02:00
2015-03-25 11:49:33 +01:00
2016-03-02 17:01:56 +02:00
2013-01-08 10:57:09 +01:00
2023-05-15 12:36:37 +09:00
2012-03-28 18:30:02 +01:00
2023-05-15 13:59:12 +09:00
2016-06-13 15:58:17 +02:00
2013-11-13 20:21:46 +01:00
2015-03-25 11:49:33 +01:00
2016-06-13 15:58:26 +02:00
2016-06-13 15:58:24 +02:00
2016-01-19 12:14:01 +01:00
2016-08-07 23:47:20 -04:00
2011-12-27 11:27:12 +01:00
2016-06-28 09:33:00 +02:00
2010-06-09 11:12:36 +02:00
2015-03-25 11:49:33 +01:00
2015-08-03 18:40:25 +02:00
2015-10-27 09:33:55 +01:00
2016-01-26 12:45:49 +01:00
2016-06-20 09:54:04 +02:00
2023-05-12 17:16:36 +09:00
2016-06-10 12:07:30 +02:00
2012-09-26 15:44:57 +02:00
2015-11-27 09:24:14 +01:00
2015-03-25 11:49:33 +01:00
2016-06-13 15:58:21 +02:00
2015-02-12 18:54:14 -08:00
2015-03-25 11:49:33 +01:00
2016-10-17 11:25:25 +02:00
2016-01-11 13:01:24 +01:00
2012-11-30 17:47:28 +01:00