mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Abinash Singh <abinashsinghlalotra@gmail.com>, bvanassche@acm.org
Cc: James.Bottomley@HansenPartnership.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	martin.petersen@oracle.com
Subject: Re: [PATCH v9 2/3] scsi: sd: Fix build warning in sd_revalidate_disk()
Date: Mon, 25 Aug 2025 10:53:12 +0900	[thread overview]
Message-ID: <392d911c-7b71-4d58-b07f-8e215c65b3c8@kernel.org> (raw)
In-Reply-To: <20250824180218.39498-3-abinashsinghlalotra@gmail.com>

On 8/25/25 3:02 AM, Abinash Singh wrote:
> A build warning was triggered due to excessive stack usage in
> sd_revalidate_disk():
> 
> drivers/scsi/sd.c: In function ‘sd_revalidate_disk.isra’:
> drivers/scsi/sd.c:3824:1: warning: the frame size of 1160 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> This is caused by a large local struct queue_limits (~400B) allocated
> on the stack. Replacing it with a heap allocation using kmalloc()
> significantly reduces frame usage. Kernel stack is limited (~8 KB),
> and allocating large structs on the stack is discouraged.
> As the function already performs heap allocations (e.g. for buffer),
> this change fits well.
> 
> Signed-off-by: Abinash Singh <abinashsinghlalotra@gmail.com>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>

Looks good, but please move this patch as patch 1 in the series to make sure it
can be easily backported. And please add:

Fixes: 804e498e0496 ("sd: convert to the atomic queue limits API")
Cc: stable@vger.kernel.org

before your signed-off.

-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2025-08-25  1:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-24 18:02 [PATCH v9 0/3] scsi: sd: Cleanups and warning fixes " Abinash Singh
2025-08-24 18:02 ` [PATCH v9 1/3] scsi: sd: Remove redundant printk after kmalloc failure Abinash Singh
2025-08-25  1:56   ` Damien Le Moal
2025-08-24 18:02 ` [PATCH v9 2/3] scsi: sd: Fix build warning in sd_revalidate_disk() Abinash Singh
2025-08-25  1:53   ` Damien Le Moal [this message]
2025-08-24 18:02 ` [PATCH v9 3/3] scsi: sd: make sd_revalidate_disk() return void Abinash Singh
2025-08-25  1:58   ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=392d911c-7b71-4d58-b07f-8e215c65b3c8@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=abinashsinghlalotra@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®