mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 05:17:11 +07:00
9e6717af61
When CONFIG_DEBUG_ATOMIC_SLEEP on, calling kzalloc with
GFP_KERNEL in hclge_mac_update_stats() will get below warning:
[ 52.514677] BUG: sleeping function called from invalid context at mm/slab.h:501
[ 52.522051] in_atomic(): 0, irqs_disabled(): 0, pid: 1015, name: ifconfig
[ 52.528827] 2 locks held by ifconfig/1015:
[ 52.532921] #0: (____ptrval____) (&p->lock){....}, at: seq_read+0x54/0x748
[ 52.539878] #1: (____ptrval____) (rcu_read_lock){....}, at: dev_seq_start+0x0/0x140
[ 52.547610] CPU: 16 PID: 1015 Comm: ifconfig Not tainted 5.3.0-rc3-00697-g20b80be #98
[ 52.555408] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B050.01 08/08/2019
[ 52.564242] Call trace:
[ 52.566687] dump_backtrace+0x0/0x1f8
[ 52.570338] show_stack+0x14/0x20
[ 52.573646] dump_stack+0xb4/0xec
[ 52.576950] ___might_sleep+0x178/0x198
[ 52.580773] __might_sleep+0x74/0xe0
[ 52.584338] __kmalloc+0x244/0x2d8
[ 52.587744] hclge_mac_update_stats+0xc8/0x1f8 [hclge]
[ 52.592870] hclge_update_stats+0xe0/0x170 [hclge]
[ 52.597651] hns3_nic_get_stats64+0xa0/0x458 [hns3]
[ 52.602514] dev_get_stats+0x58/0x138
[ 52.606165] dev_seq_printf_stats+0x8c/0x280
[ 52.610420] dev_seq_show+0x14/0x40
[ 52.613898] seq_read+0x574/0x748
[ 52.617205] proc_reg_read+0xb4/0x108
[ 52.620857] __vfs_read+0x54/0xa8
[ 52.624162] vfs_read+0xa0/0x190
[ 52.627380] ksys_read+0xc8/0x178
[ 52.630685] __arm64_sys_read+0x40/0x50
[ 52.634509] el0_svc_common.constprop.0+0x120/0x1e0
[ 52.639369] el0_svc_handler+0x50/0x90
[ 52.643106] el0_svc+0x8/0xc
So this patch uses GFP_ATOMIC instead of GFP_KERNEL to fix it.
Fixes:
|
||
---|---|---|
.. | ||
appletalk | ||
arcnet | ||
bonding | ||
caif | ||
can | ||
dsa | ||
ethernet | ||
fddi | ||
fjes | ||
hamradio | ||
hippi | ||
hyperv | ||
ieee802154 | ||
ipvlan | ||
netdevsim | ||
phy | ||
plip | ||
ppp | ||
slip | ||
team | ||
usb | ||
vmxnet3 | ||
wan | ||
wimax | ||
wireless | ||
xen-netback | ||
dummy.c | ||
eql.c | ||
geneve.c | ||
gtp.c | ||
ifb.c | ||
Kconfig | ||
LICENSE.SRC | ||
loopback.c | ||
macsec.c | ||
macvlan.c | ||
macvtap.c | ||
Makefile | ||
mdio.c | ||
mii.c | ||
net_failover.c | ||
netconsole.c | ||
nlmon.c | ||
ntb_netdev.c | ||
rionet.c | ||
sb1000.c | ||
Space.c | ||
sungem_phy.c | ||
tap.c | ||
thunderbolt.c | ||
tun.c | ||
veth.c | ||
virtio_net.c | ||
vrf.c | ||
vsockmon.c | ||
vxlan.c | ||
xen-netfront.c |