From: Yum Rayan <yum.rayan@gmail.com>
To: Sreenivas.Bagalkote@lsil.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH]megaraid_sas: Reduce stack usage in megasas_probe_one()
Date: Wed, 20 Apr 2005 00:59:43 -0700 [thread overview]
Message-ID: <df35dfeb0504200059279a4417@mail.gmail.com> (raw)
This patch reduces stack usage in megasas_probe_one() from to 2200 to
156. A patched version of gcc 3.4.3 with -fno-unit-at-a-time disabled
was used on i386 platform.
Signed-off-by: Yum Rayan <yum.rayan@gmail.com>
--- linux-2.6.12-rc2-mm3.a/drivers/scsi/megaraid/megaraid_sas.c 2005-04-14
22:15:44.000000000 -0700
+++ linux-2.6.12-rc2-mm3.b/drivers/scsi/megaraid/megaraid_sas.c 2005-04-20
00:26:01.000000000 -0700
@@ -731,7 +731,7 @@
struct megasas_register_set* reg_set;
struct megasas_cmd* cmd;
- struct megasas_ctrl_info ctrl_info;
+ struct megasas_ctrl_info *ctrl_info;
struct megasas_init_frame* init_frame;
struct megasas_init_queue_info* initq_info;
@@ -846,15 +846,19 @@
megasas_return_cmd( instance, cmd );
+ ctrl_info = kmalloc(sizeof(struct megasas_ctrl_info), GFP_KERNEL);
+
/*
* Gather misc FW related information
*/
- if (!megasas_get_ctrl_info( instance, &ctrl_info ))
- instance->max_sectors_per_req = ctrl_info.max_request_size;
+ if (ctrl_info && !megasas_get_ctrl_info( instance, ctrl_info ))
+ instance->max_sectors_per_req = ctrl_info->max_request_size;
else
instance->max_sectors_per_req = instance->max_num_sge *
PAGE_SIZE / 512;
+ kfree(ctrl_info);
+
return 0;
fail_fw_init:
next reply other threads:[~2005-04-20 7:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-20 7:59 Yum Rayan [this message]
2005-04-20 16:26 ` [PATCH]megaraid_sas: Reduce stack usage in megasas_probe_one() Randy.Dunlap
-- strict thread matches above, loose matches on Subject: below --
2005-04-20 14:05 [PATCH]megaraid_sas: Reduce stack usage in megasas_probe_one( ) Bagalkote, Sreenivas
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=df35dfeb0504200059279a4417@mail.gmail.com \
--to=yum.rayan@gmail.com \
--cc=Sreenivas.Bagalkote@lsil.com \
--cc=linux-scsi@vger.kernel.org \
/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