Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Gerald Champagne <gerald.champagne@esstech.com>
To: linux-mips@oss.sgi.com
Subject: Freeing global memory used only by __init functions
Date: Tue, 18 Sep 2001 12:58:19 -0500	[thread overview]
Message-ID: <3BA78B3B.6090602@esstech.com> (raw)

I noticed that several global buffers are used by a few functions marked
as __init functions.  I assume that the code space used by these functions
will be freed up when kernel initialization is completed, but can the
associated global memory be freed up as well?

An example can be found in arch/mips/mips-boards/generic/cmdline.c:

char arcs_cmdline[COMMAND_LINE_SIZE];
char * __init prom_getcmdline(void);
void  __init prom_init_cmdline(void);

arcs_cmdline is only used by these two functions and one other function
marked as __init.

This buffer is small, but it can apply to larger buffers as well.  For
example, in arch/mips/mips-boards/generic/printf.c, I think the functions
putPromChar and getPromChar should be marked as __init functions, and the
1k buffer "buf" is never used after initialization.  Can this 1k be recovered?

I know kmalloc could normally be used in kernel code, but that won't work on
initialization code used before kmalloc is initialized.

Thanks.

Gerald

             reply	other threads:[~2001-09-18 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-18 17:58 Gerald Champagne [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-09-18 18:08 Freeing global memory used only by __init functions Zhang Fuxin
     [not found] <200109181808.LAA05245@mail.esstech.com>
2001-09-18 18:37 ` Gerald Champagne
2001-09-19  1:02   ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BA78B3B.6090602@esstech.com \
    --to=gerald.champagne@esstech.com \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox