You are not logged in.

#1 2019-07-14 19:58:55

jneem
Member
Registered: 2011-07-14
Posts: 13

[SOLVED] Can no longer load usb-storage: percpu fails to allocate

Sometime in the last few weeks, I stopped being able to use USB drives on my laptop. It turns out that the usb-storage module is failing to load. On a fresh reboot, if I try "modprobe usb-storage", I get this:

[   20.547694] percpu: allocation failed, size=4104 align=32 atomic=0, alloc from reserved chunk failed
[   20.547698] CPU: 2 PID: 1196 Comm: modprobe Tainted: G           OE     5.2.0-arch2-1-ARCH #1
[   20.547700] Hardware name: LENOVO 20JES34M00/20JES34M00, BIOS N1NET28W (1.15 ) 07/13/2017
[   20.547701] Call Trace:
[   20.547710]  dump_stack+0x5c/0x80
[   20.547715]  pcpu_alloc.cold+0x21/0x44
[   20.547719]  ? __vmalloc_node_range+0x199/0x220
[   20.547724]  load_module+0xea5/0x23a0
[   20.547728]  ? release_pages+0x183/0x3f0
[   20.547732]  ? alloc_vmap_area+0x3d6/0x810
[   20.547735]  ? vmap_page_range_noflush+0x23c/0x350
[   20.547739]  ? map_vm_area+0x31/0x40
[   20.547741]  ? __vmalloc_node_range+0x199/0x220
[   20.547744]  ? __se_sys_init_module+0x114/0x180
[   20.547746]  __se_sys_init_module+0x114/0x180
[   20.547753]  do_syscall_64+0x5b/0x1b0
[   20.547757]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   20.547760] RIP: 0033:0x7f0f54cc0b3e
[   20.547763] Code: 48 8b 0d 55 f3 0b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 22 f3 0b 00 f7 d8 64 89 01 48
[   20.547765] RSP: 002b:00007ffff0ec7298 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
[   20.547767] RAX: ffffffffffffffda RBX: 000055ae29784f10 RCX: 00007f0f54cc0b3e
[   20.547769] RDX: 000055ae27f16400 RSI: 0000000000074219 RDI: 00007f0f53fc3010
[   20.547770] RBP: 000055ae27f16400 R08: 000000000000005f R09: 000055ae29784c40
[   20.547771] R10: 000055ae29784010 R11: 0000000000000246 R12: 00007f0f53fc3010
[   20.547772] R13: 000055ae29784ec0 R14: 0000000000040000 R15: 000055ae29784f10
[   20.547776] scsi_mod: Could not allocate 4104 bytes percpu data

Does anyone know what to make of this? I'm trying to install an LTS kernel, but I'm on flaky wifi right now so it's taking a while...

Last edited by jneem (2019-07-15 18:16:57)

Offline

#2 2019-07-14 20:11:56

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] Can no longer load usb-storage: percpu fails to allocate

Offline

#3 2019-07-15 07:50:25

zett
Member
Registered: 2019-07-15
Posts: 2

Re: [SOLVED] Can no longer load usb-storage: percpu fails to allocate

hey,
thanks  for the link.
my machine is bugged as well.
what i am wondering about the  postet 'solution': 

https://bugzilla.kernel.org/show_bug.cgi?id=204119 wrote:

The "size=4104" in the error message probably refers to the SCSI log buffer. From drivers/scsi/scsi_logging.c:

#define SCSI_LOG_SPOOLSIZE 4096
struct scsi_log_buf {
    char buffer[SCSI_LOG_SPOOLSIZE];
    unsigned long map;
};
static DEFINE_PER_CPU(struct scsi_log_buf, scsi_format_log);

I am not aware of any changes between kernel versions v5.1 and v5.2 in the SCSI logging mechanism so I don't think that this indicates a regression in the SCSI subsystem. Anyway, does this patch help?

diff --git a/drivers/scsi/scsi_logging.c b/drivers/scsi/scsi_logging.c
index 39b8cc4574b4..148d8635d5f6 100644
--- a/drivers/scsi/scsi_logging.c
+++ b/drivers/scsi/scsi_logging.c
@@ -15,7 +15,7 @@
#include <scsi/scsi_eh.h>
#include <scsi/scsi_dbg.h>

-#define SCSI_LOG_SPOOLSIZE 4096
+#define SCSI_LOG_SPOOLSIZE SCSI_LOG_BUFSIZE

#if (SCSI_LOG_SPOOLSIZE / SCSI_LOG_BUFSIZE) > BITS_PER_LONG
#warning SCSI logging bitmask too large

because my system behaved well so far.. i am left with a question:
what is the best way to get this change into my system?

-#define SCSI_LOG_SPOOLSIZE 4096
+#define SCSI_LOG_SPOOLSIZE SCSI_LOG_BUFSIZE

i had a look here:
https://wiki.archlinux.org/index.php/Kernel#Compilation
but i don't have enough knowledge to recognize the important or relevant parts for me.
thanks!

Offline

#4 2019-07-15 09:49:58

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] Can no longer load usb-storage: percpu fails to allocate

Since there's an upstream bug and a patch and if the kernel compilation instructions are over your head, I'd suggest to simply resort to the LTS kernel for the moment and wait for the patch to hit the main kernel, then switch back.

Offline

#5 2019-07-15 11:07:20

zett
Member
Registered: 2019-07-15
Posts: 2

Re: [SOLVED] Can no longer load usb-storage: percpu fails to allocate

thanks for the quick reply.
when installing the lts kernel

sudo pacman -Syu linux-lts

i would simply change my systemd boot config
https://wiki.archlinux.org/index.php/Sy … ng_loaders
and be fine?

Last edited by zett (2019-07-15 11:08:50)

Offline

#6 2019-07-15 18:16:39

jneem
Member
Registered: 2011-07-14
Posts: 13

Re: [SOLVED] Can no longer load usb-storage: percpu fails to allocate

Thanks for the help! I can confirm that switching to the LTS kernel fixes the issue for now, so I'm just going to use that for a while.

@zett: yes, if you're using systemd-boot then after installing the kernel you should just add a loader using the vmlinuz-linux-lts kernel.

Offline

Board footer

Powered by FluxBB