[PATCH 7/7] um: simplify IRQ handling code

Anton Ivanov anton.ivanov at kot-begemot.co.uk
Wed Dec 2 04:03:38 EST 2020


On 01/12/2020 20:15, Johannes Berg wrote:
> On Mon, 2020-11-30 at 16:30 +0000, Anton Ivanov wrote:
>> On 23/11/2020 19:56, Johannes Berg wrote:
>>> From: Johannes Berg <johannes.berg at intel.com>
>>>
>>> Reduce dynamic allocations (and thereby cache misses) by simply
>>> embedding the registration data for IRQs in the irq_entry, we
>>> never supported these being really dynamic anyway as only one
>>> was ever allowed ("Trying to reregister ...").
>>>
>>> Lockless behaviour is preserved by removing the FD from the poll
>>> set appropriately, but we use reg->events to indicate whether or
>>> not this entry is used, rather than dynamically allocating them.
>>>
>>> Also port the list of IRQ entries to list_head instead of the
>>> current open-coded singly-linked list implementation, just for
>>> sanity.
>> This one is broken. I will look exactly where. It is somewhere in the IRQ delete/re-request logic.
>>
>> How to test
>>
>> run iperf -s in the UML with a vector network driver.
>>
>> run iperf -c to the UML instance from the host in a loop
> How do you usually use it? tap device?

raw sockets on a vEth pair.

I avoid tap as it does not exercise the full vector IO code for now. One day I will find a way to extract from the kernel the underlying socket which tap uses internally and it will become 100% equivalent to the other transports.

>
>> Try to ifup/ifdown the vecX interface inside the UML.
>>
>> With master it works fine. With this patch it fails.
> How does it fail?

------------[ cut here ]------------
WARNING: CPU: 0 PID: 401 at arch/um/kernel/irq.c:177 um_request_irq+0xff/0x22e
Modules linked in:
CPU: 0 PID: 401 Comm: ip Tainted: G        W 5.10.0-rc6-00007-g6a51713e7f43 #377
Stack:
  60312019 00000000 65bc31d0 60312019
  00000009 00000000 00000000 ffffff8e
  65bc31e0 60313228 65bc3220 6003e2d2
Call Trace:
  [<60312019>] ? printk+0x0/0x94
  [<6001f34b>] show_stack+0x13e/0x14d
  [<60312019>] ? printk+0x0/0x94
  [<60312019>] ? printk+0x0/0x94
  [<60313228>] dump_stack+0x34/0x36
  [<6003e2d2>] __warn+0xf0/0x137
  [<60035374>] ? set_signals+0x0/0x36
  [<60311606>] warn_slowpath_fmt+0xd1/0xdf
  [<60028624>] ? uml_raw_enable_vnet_headers+0x0/0x5d
  [<60227c06>] ? strlen+0x0/0x11
  [<60314bb7>] ? netdev_info+0xad/0xaf
  [<60311535>] ? warn_slowpath_fmt+0x0/0xdf
  [<600353a4>] ? set_signals+0x30/0x36
  [<600353a4>] ? set_signals+0x30/0x36
  [<6001d7e1>] um_request_irq+0xff/0x22e
  [<60027f05>] ? vector_rx_interrupt+0x0/0x2a
  [<60026288>] ? get_depth+0x0/0x4b
  [<6001d6e2>] ? um_request_irq+0x0/0x22e
  [<60027cd8>] vector_net_open+0x1e9/0x416
  [<60272059>] __dev_open+0x100/0x15a
  [<60271f20>] ? dev_set_rx_mode+0x0/0x39
  [<602723d7>] __dev_change_flags+0x125/0x1cc
  [<602724a8>] dev_change_flags+0x2a/0x67
  [<60282502>] do_setlink+0x375/0xe90
  [<6021c4e5>] ? __nla_validate_parse+0x6d/0x8cf
  [<6021cd88>] ? __nla_parse+0x2b/0x2d
  [<602836db>] __rtnl_newlink+0x3f2/0x81f
  [<600353a4>] ? set_signals+0x30/0x36
  [<6027c23f>] ? __nlmsg_parse+0x58/0x60
  [<600cf37a>] ? get_page_from_freelist+0x0/0x973
  [<600cd71b>] ? first_zones_zonelist+0x0/0x20
  [<600d0393>] ? __alloc_pages_nodemask+0x128/0x81c
  [<600377fe>] ? wait_stub_done+0x40/0x10c
  [<60283b63>] rtnl_newlink+0x5b/0x7b
  [<6029af9a>] ? __netlink_ns_capable+0x25/0x53
  [<6027bc5b>] ? rtnl_get_link+0x0/0x2b
  [<6027e0ae>] rtnetlink_rcv_msg+0x229/0x25a
  [<6002135c>] ? copy_chunk_from_user+0x0/0x2e
  [<6002135c>] ? copy_chunk_from_user+0x0/0x2e
  [<60021644>] ? buffer_op+0x4a/0xdb
  [<6027de85>] ? rtnetlink_rcv_msg+0x0/0x25a
  [<6029f289>] netlink_rcv_skb+0x67/0xcb
  [<6025c08d>] ? kfree_skb+0x0/0x2c
  [<6027c66a>] rtnetlink_rcv+0x1a/0x1c
  [<6029eace>] netlink_unicast+0x139/0x1df
  [<6029eec9>] netlink_sendmsg+0x355/0x37a
  [<602156b4>] ? __import_iovec+0xe1/0x104
  [<60250913>] ? sock_sendmsg_nosec+0x0/0x65
  [<60250925>] sock_sendmsg_nosec+0x12/0x65
  [<60250b65>] ____sys_sendmsg+0x10b/0x16b
  [<60252966>] ___sys_sendmsg+0x79/0xa8
  [<60037179>] ? do_syscall_stub+0xff/0x22f
  [<60037347>] ? run_syscall_stub+0x9e/0xa0
  [<60037441>] ? map+0x4a/0x4c
  [<600f9ed7>] ? __fget_light+0x36/0x63
  [<600f9f19>] ? __fdget+0x15/0x17
  [<602503fb>] ? fdget+0x10/0x1c
  [<60252a18>] __sys_sendmsg+0x54/0x82
  [<60252a5b>] sys_sendmsg+0x15/0x17
  [<6002132e>] handle_syscall+0x79/0xa7
  [<60037f0e>] userspace+0x483/0x510
  [<6001e166>] fork_handler+0x94/0x96
---[ end trace 95ba15d7fc338465 ]---
uml-vector uml-vector.0 vec0: vector_open: failed to get rx irq(-114)

>
> johannes
>
>
-- 
Anton R. Ivanov
https://www.kot-begemot.co.uk/




More information about the linux-um mailing list