Re: CONFIG_SWAPPING?

From: Russell King (rmk@arm.linux.org.uk)
Date: Fri Apr 28 2000 - 04:38:30 EST


Graham Stoney writes:
> I think this is a matter of degree. Certainly the non-trivial sys_swapon and
> sys_swapoff functions could easily be wrapped in a hypothetical
> #ifdef CONFIG_SWAPPING, and my --function-sections patch would then take out
> whatever other parts of the swap & vm code then become unused, without any
> further #ifdef's. Only a medium sized saving perhaps, but it sounds like a
> good idea to me.

Yes, that would get rid of the two syscalls, but they're probably only
around 2K. You could probably improve on that easily and cleanly:

1. get rid of swapfile.c from the compilation, and replace a couple
   of functions with dummy functions
2. replace swap_state.c with a set of dummy functions

I guess you could save around 10KB of code, and around 150 bytes of data.

Oh, if any of the mm people are reading this, what about killing the
redundant zero initialisers so that these variables can be placed in
the BSS? A quick grep of the mm/ code reveals 11 instances where data
is initialised to zero, and 4 cases where pointers are initialised to
NULL. by searching the first level down from linux/, there are 65
instances of explicit initialisation to 0, and 19 instances of
initialisation to NULL. I can supply a patch to remove these if anyone
is interested.
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:15 EST