* [PATCH] lpfc: lower stack use in lpfc_fc_frame_check
@ 2010-12-22 15:52 Tomas Henzl
2011-01-03 13:53 ` James Smart
0 siblings, 1 reply; 2+ messages in thread
From: Tomas Henzl @ 2010-12-22 15:52 UTC (permalink / raw)
To: 'linux-scsi@vger.kernel.org'; +Cc: james.smart
Hi,
according to checkstack the lpfc_fc_frame_check occupies the first place in stack usage:
make checkstack
objdump -d vmlinux $(find . -name '*.ko') | \
perl /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/scripts/checkstack.pl x86_64
0x000013f4 lpfc_fc_frame_check [lpfc]: 1936
...
This change makes the rctl_names static, thus not on stack.
Tomas
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index e98e792..634b2fe 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -11578,7 +11578,8 @@ lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *phba, struct list_head *sblist,
static int
lpfc_fc_frame_check(struct lpfc_hba *phba, struct fc_frame_header *fc_hdr)
{
- char *rctl_names[] = FC_RCTL_NAMES_INIT;
+ /* make rctl_names static to save stack space */
+ static char *rctl_names[] = FC_RCTL_NAMES_INIT;
char *type_names[] = FC_TYPE_NAMES_INIT;
struct fc_vft_header *fc_vft_hdr;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lpfc: lower stack use in lpfc_fc_frame_check
2010-12-22 15:52 [PATCH] lpfc: lower stack use in lpfc_fc_frame_check Tomas Henzl
@ 2011-01-03 13:53 ` James Smart
0 siblings, 0 replies; 2+ messages in thread
From: James Smart @ 2011-01-03 13:53 UTC (permalink / raw)
To: Tomas Henzl; +Cc: 'linux-scsi@vger.kernel.org'
Tomas,
Thank you.
Acked-by: James Smart <james.smart@emulex.com>
-- james s
On 12/22/2010 10:52 AM, Tomas Henzl wrote:
> Hi,
> according to checkstack the lpfc_fc_frame_check occupies the first place in stack usage:
> make checkstack
> objdump -d vmlinux $(find . -name '*.ko') | \
> perl /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/scripts/checkstack.pl x86_64
> 0x000013f4 lpfc_fc_frame_check [lpfc]: 1936
> ...
> This change makes the rctl_names static, thus not on stack.
>
> Tomas
>
> Signed-off-by: Tomas Henzl<thenzl@redhat.com>
>
>
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index e98e792..634b2fe 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -11578,7 +11578,8 @@ lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *phba, struct list_head *sblist,
> static int
> lpfc_fc_frame_check(struct lpfc_hba *phba, struct fc_frame_header *fc_hdr)
> {
> - char *rctl_names[] = FC_RCTL_NAMES_INIT;
> + /* make rctl_names static to save stack space */
> + static char *rctl_names[] = FC_RCTL_NAMES_INIT;
> char *type_names[] = FC_TYPE_NAMES_INIT;
> struct fc_vft_header *fc_vft_hdr;
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-03 13:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22 15:52 [PATCH] lpfc: lower stack use in lpfc_fc_frame_check Tomas Henzl
2011-01-03 13:53 ` James Smart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).