Bug 204119
Summary: | scsi_mod: Could not allocate 4104 bytes percpu data | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Jan Palus (jpalus) |
Component: | SCSI | Assignee: | linux-scsi (linux-scsi) |
Status: | NEW --- | ||
Severity: | normal | CC: | bvanassche, justincase |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.2 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | kernel config 5.2 |
Description
Jan Palus
2019-07-09 20:16:02 UTC
From which kernel version did you upgrade to 5.2? From 5.1.15 where it works reliably well. Now I've noticed that this error seems somewhat random -- in most cases insert fails but every 10 boots or so it succeeds. Note that attempt to load module is made very early in initrd. Not sure if that's relevant but reported percpu values differ between those versions 5.1: percpu: Embedded 46 pages/cpu s151552 r8192 d28672 u524288 5.2: percpu: Embedded 54 pages/cpu s184320 r8192 d28672 u524288 Can you share your kernel config? Created attachment 283597 [details]
kernel config 5.2
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 The patch seems to fix the issue -- 5 successful boots in a row and no trace of failed percpu allocation. Thanks. Thanks for testing! I will submit a more elaborate patch after the merge window has closed. When find the patch the way into the 5.2 Kernel? I got the same bug. I can't use any usb device. Nothing happens. But I'm not able to build my own kernel. I tried all Kernel-Versions of 5.2 (5.2.1 - 5.2.7 (arch Linux)). This patch has been accepted in Martin's tree as commit dccc96abfb21 ("scsi: core: Reduce memory required for SCSI logging") and is on its way to kernel v5.4. If you need that patch in kernel v5.2 soon and if you cannot compile the kernel yourself then only your Linux distributor can help you. Thx for answer. I tried to patch my distribution-kernel with your bugfix. It works brilliant. I can use all my usb-devices again. |