| From: Jelte van der Hoek <[EMAIL PROTECTED]>
| > | From: Jelte van der Hoek <[EMAIL PROTECTED]>
| > |
| > | I made a change to the cx25840 driver that changes the seq arrays to
| > | function calls (and uses an additional array to buffer the settings), I
| > | was still testing this but it seems to work. I don't have time to make a
| > | patch against the 0.3.2e and test it right now, but I'll do it tonight
| > | after I can test it.
| >
| > Do you know if that change is worthwhile? How big are those arrays?
| > In some cases, you are moving work from compile time to runtime -- not
| > a great tradeoff.
|
| The arrays are big enough to crash the kernel when the driver activates.
| My current patch runs fine on FC3 with REGPARMS and 4KSTACKS. The array
| I added is smaller than the two debug arrays currently in cx25840_state.
| struct cx25840_state {
| :
| /** Stores the desired state of each register. Dirty registers may
| still need to be updated. */
| u8 reg_cache[number_of_registers];
|
| /** Stores a dirty bit for each register. */
| u8 reg_dirty[(number_of_registers+7)/8];
|
I think I understand this part of what you are doing:
- converting dirty into a bitset (takes 1/8th the memory) and each
element of dirty really only stores 0 or 1 anyway.
- storing that bitset in the struct cs25840_state i.e. no longer on
the stack
In fact, either of these transformations would reduce the stack growth
by roughly the same amount -- you don't need to do both.
According to Robert Love's "Linux Kernel Development", the kernel
provides a suite of bitset operations. It might be good to use
them. Since atomicity isn't required of auto variables, the __
versions should be used.
| I just changed the macros used in the arrays slightly to call a function
| instead of produce a value.
I don't understand the motivation for this part. Note: I'm not saying
that it is wrong or bad.
How much stack do you save? In which functions? How much does the
object code increase in size?
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
ivtv-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel