diff mbox series

[v4,08/27] ata: optimize ata_scsi_rbuf[] size

Message ID 20200317144333.2904-9-b.zolnierkie@samsung.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [v4,01/27] ata: remove stale maintainership information from core code | expand

Commit Message

Bartlomiej Zolnierkiewicz March 17, 2020, 2:43 p.m. UTC
Currently the maximum required size of the ata_scsi_rbuf[] is
576 bytes in ata_scsiop_inq_89() so modify ATA_SCSI_RBUF_SIZE
define accordingly.

Code size savings on m68k arch using (modified) atari_defconfig:

   text    data     bss     dec     hex filename
before:
  20782     105    4096   24983    6197 drivers/ata/libata-scsi.o
after:
  20782     105     576   21463    53d7 drivers/ata/libata-scsi.o

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
 drivers/ata/libata-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig March 26, 2020, 9:48 a.m. UTC | #1
On Tue, Mar 17, 2020 at 03:43:14PM +0100, Bartlomiej Zolnierkiewicz wrote:
> Currently the maximum required size of the ata_scsi_rbuf[] is
> 576 bytes in ata_scsiop_inq_89() so modify ATA_SCSI_RBUF_SIZE
> define accordingly.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

Btw, I wonder if we should switch this to a dynamic allocation, as
a lot of people are more concerned about kernel size footprint vs
dynamic allocations.
diff mbox series

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 2a43eef97b87..7bdda82fe886 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -37,7 +37,7 @@ 
 #include "libata.h"
 #include "libata-transport.h"
 
-#define ATA_SCSI_RBUF_SIZE	4096
+#define ATA_SCSI_RBUF_SIZE	576
 
 static DEFINE_SPINLOCK(ata_scsi_rbuf_lock);
 static u8 ata_scsi_rbuf[ATA_SCSI_RBUF_SIZE];