2007-10-14 14:58:51

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

Hi,

Following patches debloat drivers/scsi/aic7xxx/*.
I also had to add prototypes for ahc_lookup_scb
and ahd_lookup_scb to .h files.

1-debloat.patch
Deinlines and moves big functions from .h to .c files.
Adds prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

2-addstatic.patch
Adds statics, #ifdefs out huge amount of unused code, adds consts

3-addconst.patch
Adds more consts

Driver code/data size reductions:

Build with debugging on (CONFIG_AIC7XXX_DEBUG_ENABLE=y):
text data bss dec hex filename
310865 49922 1204 361991 58607 linux-2.6.23.t/drivers/scsi/aic7xxx/built-in.o
221987 2754 1204 225945 37299 linux-2.6.23-aic-3-addconst.t/drivers/scsi/aic7xxx/built-in.o

With debugging off:
text data bss dec hex filename
298896 42754 1172 342822 53b26 linux-2.6.23.tt/drivers/scsi/aic7xxx/built-in.o
216068 2754 1172 219994 35b5a linux-2.6.23-aic-3-addconst.tt/drivers/scsi/aic7xxx/built-in.o

make namespacecheck goes from 400+ functions to:
drivers/scsi/aic7xxx/aic79xx_core.o
ahd_inq
ahd_inw
ahd_outq
ahd_outw
drivers/scsi/aic7xxx/aic79xx_osm.o
ahd_insb
drivers/scsi/aic7xxx/aic7xxx_core.o
ahc_inq
ahc_outq
drivers/scsi/aic7xxx/aic7xxx_osm.o
ahc_insb

None of these patches touch any logic, code changes are pretty minimal.

Compile tested and applies cleanly to 2.6.23.
I don't have this hardware anymore and cannot run test these patches.

Please apply.

Signed-off-by: Denys Vlasenko <[email protected]>
--
vda


2007-10-14 15:00:37

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH 1/3] debloat aic7xxx and aic79xx drivers

Deinlines and moves big functions from .h to .c files.
Adds prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

Signed-off-by: Denys Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (188.00 B)
linux-2.6.23-aic-1-debloat.patch (102.45 kB)
Download all attachments

2007-10-14 15:01:42

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH 2/3] debloat aic7xxx and aic79xx drivers

Adds statics, #ifdefs out huge amount of unused code, adds consts

Signed-off-by: Denys Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (131.00 B)
linux-2.6.23-aic-2-addstatic.patch (199.52 kB)
Download all attachments

2007-10-14 17:52:18

by Gabriel C

[permalink] [raw]
Subject: Re: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

Denys Vlasenko wrote:
> Hi,

Hi,

> Compile tested and applies cleanly to 2.6.23.
> I don't have this hardware anymore and cannot run test these patches.

I can test these patches on an aic7892 controller later on today if you want.

BTW while you seems to care about this driver could you have a look at :

http://bugzilla.kernel.org/show_bug.cgi?id=3062 ?!?


Regards,

Gabriel C

2007-10-15 11:26:10

by Denys Vlasenko

[permalink] [raw]
Subject: Re: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

On Sunday 14 October 2007 18:47, Gabriel C wrote:
> > Compile tested and applies cleanly to 2.6.23.
> > I don't have this hardware anymore and cannot run test these patches.
>
> I can test these patches on an aic7892 controller later on today if you want.

I'd appreciate that.

Do you, by any chance, use aic94xx driver too (drivers/scsi/aic94xx/*)?
After i'm done with aic7xxx, I may attack this one.

> BTW while you seems to care about this driver could you have a look at :
>
> http://bugzilla.kernel.org/show_bug.cgi?id=3062 ?!?

I am a desktop Linux user, so far I don't use suspend at all. Sorry.
--
vda

2007-10-15 13:57:15

by Gabriel C

[permalink] [raw]
Subject: Re: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

>> Compile tested and applies cleanly to 2.6.23.
>> I don't have this hardware anymore and cannot run test these patches.
>
> I can test these patches on an aic7892 controller later on today if you want.

Works fine for me tested on :

03:0e.0 SCSI storage controller [0100]: Adaptec AIC-7892P U160/m [9005:008f] (rev 02)


Gabriel

2007-10-16 22:05:58

by Gabriel C

[permalink] [raw]
Subject: Re: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

Denys Vlasenko wrote:
> On Sunday 14 October 2007 18:47, Gabriel C wrote:
>>> Compile tested and applies cleanly to 2.6.23.
>>> I don't have this hardware anymore and cannot run test these patches.
>> I can test these patches on an aic7892 controller later on today if you want.
>
> I'd appreciate that.
>
> Do you, by any chance, use aic94xx driver too (drivers/scsi/aic94xx/*)?
> After i'm done with aic7xxx, I may attack this one.

Sorry I don't have any box uses this one , but I'll ask some friends maybe someone has :)

>
>> BTW while you seems to care about this driver could you have a look at :
>>
>> http://bugzilla.kernel.org/show_bug.cgi?id=3062 ?!?
>
> I am a desktop Linux user, so far I don't use suspend at all. Sorry.

Ok , no problem maybe one 'day' the SCSI folks cares ( where the 'day' may be never ), I dunno :(

> --
> vda
>

Gabriel

2007-10-18 11:20:46

by Denys Vlasenko

[permalink] [raw]
Subject: Re: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

Hi Andrew, James,

On Monday 15 October 2007 14:53, Gabriel C wrote:
> >> Compile tested and applies cleanly to 2.6.23.
> >> I don't have this hardware anymore and cannot run test these patches.
> >
> > I can test these patches on an aic7892 controller later on today if you want.
>
> Works fine for me tested on :
>
> 03:0e.0 SCSI storage controller [0100]: Adaptec AIC-7892P U160/m [9005:008f] (rev 02)

I hope this is enough for these patches to be accepted.

If it is not, please let me know what do I need to do more.
--
vda

2007-10-18 21:36:57

by J.A. Magallón

[permalink] [raw]
Subject: Re: [PATCH 0/3] debloat aic7xxx and aic79xx drivers

On Sun, 14 Oct 2007 15:58:26 +0100, Denys Vlasenko <[email protected]> wrote:

> Hi,
>
> Following patches debloat drivers/scsi/aic7xxx/*.
> I also had to add prototypes for ahc_lookup_scb
> and ahd_lookup_scb to .h files.
>

Sorry for the late replay, but.. working fine on

annwn:~# lspci | grep Adap
03:02.0 SCSI storage controller: Adaptec ASC-29320 U320 (rev 03)
03:02.1 SCSI storage controller: Adaptec ASC-29320 U320 (rev 03)
annwn:~# lsscsi -H
[1] aic79xx
[2] aic79xx

with
annwn:~# lsscsi
[2:0:0:0] disk SEAGATE ST336807LW 0C01 /dev/sdb
[2:0:1:0] disk SEAGATE ST336807LW 0C01 /dev/sdc
[2:0:2:0] disk SEAGATE ST336807LW 0C01 /dev/sdd
[2:0:3:0] disk SEAGATE ST336807LW 0C01 /dev/sde

and giving up to 200Mb/s on a pretty old mobo (see cached reads) with raid5:

annwn:~# hdparm -tT /dev/sd[bcde]

/dev/sdb:
Timing cached reads: 950 MB in 2.00 seconds = 474.23 MB/sec
Timing buffered disk reads: 228 MB in 3.00 seconds = 75.93 MB/sec

/dev/sdc:
Timing cached reads: 1020 MB in 2.00 seconds = 510.01 MB/sec
Timing buffered disk reads: 228 MB in 3.01 seconds = 75.76 MB/sec

/dev/sdd:
Timing cached reads: 1022 MB in 2.00 seconds = 510.69 MB/sec
Timing buffered disk reads: 228 MB in 3.01 seconds = 75.79 MB/sec

/dev/sde:
Timing cached reads: 1016 MB in 2.00 seconds = 507.92 MB/sec
Timing buffered disk reads: 228 MB in 3.02 seconds = 75.48 MB/sec
annwn:~# hdparm -tT /dev/md0

/dev/md0:
Timing cached reads: 1020 MB in 2.00 seconds = 509.96 MB/sec
Timing buffered disk reads: 602 MB in 3.01 seconds = 199.84 MB/sec


--
J.A. Magallon <jamagallon()ono!com> \ Software is like sex:
\ It's better when it's free
Mandriva Linux release 2008.1 (Cooker) for i586
Linux 2.6.23-jam01 (gcc 4.2.2 20070909 (4.2.2-0.RC.1mdv2008.0)) SMP PREEMPT
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

2007-11-01 22:15:23

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH 1/3] debloat aic7xxx and aic79xx drivers

On Sun, Oct 14, 2007 at 04:00:10PM +0100, Denys Vlasenko wrote:
> Deinlines and moves big functions from .h to .c files.
> Adds prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

Adds trailing whitespace.
.dotest/patch:216: * We also set the full residual flag which the
Adds trailing whitespace.
.dotest/patch:2383:{
warning: 2 lines add trailing whitespaces.

--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."

2007-11-01 22:16:21

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH 3/3] debloat aic7xxx and aic79xx drivers

On Sun, Oct 14, 2007 at 04:02:15PM +0100, Denys Vlasenko wrote:
> Adds more consts

error: patch failed: drivers/scsi/aic7xxx/aic79xx.h:1328
error: drivers/scsi/aic7xxx/aic79xx.h: patch does not apply
error: patch failed: drivers/scsi/aic7xxx/aic7xxx.h:1145
error: drivers/scsi/aic7xxx/aic7xxx.h: patch does not apply

--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."

2007-11-01 22:25:34

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 3/3] debloat aic7xxx and aic79xx drivers

On Thu, 1 Nov 2007 16:16:04 -0600 Matthew Wilcox wrote:

> On Sun, Oct 14, 2007 at 04:02:15PM +0100, Denys Vlasenko wrote:
> > Adds more consts
>
> error: patch failed: drivers/scsi/aic7xxx/aic79xx.h:1328
> error: drivers/scsi/aic7xxx/aic79xx.h: patch does not apply
> error: patch failed: drivers/scsi/aic7xxx/aic7xxx.h:1145
> error: drivers/scsi/aic7xxx/aic7xxx.h: patch does not apply

when attempting to apply to scsi-misc or linus-git or ... ?

Thanks,
---
~Randy

2007-11-01 23:00:19

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH 3/3] debloat aic7xxx and aic79xx drivers

On Thu, Nov 01, 2007 at 03:23:28PM -0700, Randy Dunlap wrote:
> when attempting to apply to scsi-misc or linus-git or ... ?

scsi-misc

--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."