lkml.org 
[lkml]   [2002]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch] reduce stack usage of sanitize_e820_map
    Hello,

    Currently, sanitize_e820_map uses 0x738 bytes of stack. The patch below
    moves the arrays into __initdata, reducing stack usage to 0x34 bytes.

    -ben

    :r ~/patches/v2.5/v2.5.31-stack-e820.diff
    diff -urN foo-v2.5.31/arch/i386/kernel/setup.c bar-v2.5.31/arch/i386/kernel/setup.c
    --- foo-v2.5.31/arch/i386/kernel/setup.c Mon Jun 17 15:41:13 2002
    +++ bar-v2.5.31/arch/i386/kernel/setup.c Thu Aug 15 17:47:41 2002
    @@ -275,16 +275,17 @@
    * replaces the original e820 map with a new one, removing overlaps.
    *
    */
    +struct change_member {
    + struct e820entry *pbios; /* pointer to original bios entry */
    + unsigned long long addr; /* address for this change point */
    +};
    +struct change_member change_point_list[2*E820MAX] __initdata;
    +struct change_member *change_point[2*E820MAX] __initdata;
    +struct e820entry *overlap_list[E820MAX] __initdata;
    +struct e820entry new_bios[E820MAX] __initdata;
    +
    static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
    {
    - struct change_member {
    - struct e820entry *pbios; /* pointer to original bios entry */
    - unsigned long long addr; /* address for this change point */
    - };
    - struct change_member change_point_list[2*E820MAX];
    - struct change_member *change_point[2*E820MAX];
    - struct e820entry *overlap_list[E820MAX];
    - struct e820entry new_bios[E820MAX];
    struct change_member *change_tmp;
    unsigned long current_type, last_type;
    unsigned long long last_addr;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:28    [W:0.023 / U:30.508 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site