Re: tty_[un]register_devfs putting 3K structures on the stack

From: Theodore Y. Ts'o (tytso@MIT.EDU)
Date: Fri Oct 06 2000 - 14:48:02 EDT

  • Next message: Jeff V. Merkey: "Re: Tux 2 patents"

       Date: Fri, 06 Oct 2000 12:01:34 -0500
       From: Jeff Dike <jdike@karaya.com>

       tty_register_devfs and tty_unregister_devfs both declare "struct tty_struct" locals.

       According to gdb:

       (gdb) p sizeof(struct tty_struct)
       $20 = 3084

       This eats up most of a 4K page, and on UML this is causing the stack to flow off the page for some people.

       Is it possible to make that tty_struct static or kmalloc it or
       something?

    And it's allocating a tty_struct for a really dumb reason, too. It's
    just using it so it cna call tty_name.

    Just replace the call to tty_name with something like this:

            sprintf(buf, driver->name, idx + driver->name_base)

    and make the obvious change to avoid using tty.device, and you can avoid
    need to allocate a tty_struct altogether.

                                                    - Ted

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



    This archive was generated by hypermail 2b29 : Fri Oct 06 2000 - 14:50:55 EDT