linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Josh Triplett <josh@freedesktop.org>,
	Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: How do I get the latest sparse?
Date: Wed, 17 Jan 2007 12:03:57 -0800	[thread overview]
Message-ID: <20070117200357.GB2077@chrisli.org> (raw)
In-Reply-To: <20070117190520.GA30108@uranus.ravnborg.org>

Yes, sparse is a memory hog if you keep adding files to it.
It is actually very hard to free the memory used in middle
stage, because they have dependences.

Here is my plan on this:

Save the linearized/AST result as byte code to file. Because
my checking is linearization based. Currently I only include the
information I cared. Most of the expression and statement
is not stored. They turn into linearize code any way.

Process all the byte code result, build a global symbol dictionary
into ident hash table. The implementation part of the symbol, namely
the function body, is dynamically loaded.

When we need some global symbol, the corresponding byte code file can
be load into memory. I don't deal with individual symbol loading because
they have dependence to other symbol in the same file any way. A byte
code file can be removed from the memory as well.

My current hacking shows that the byte code size is about 10x the size
of the .o file. Given that each linearized instruction is 32 bytes, it
is not as bad as it sounds. The total result of a linux kernel will
be a few hundred Mb. It might be possible to fit that all in the machine
I have, keep my finger crossed.

Chris


On Wed, Jan 17, 2007 at 08:05:20PM +0100, Sam Ravnborg wrote:
> 
> I experimented with a patch some time ago that allowed us to run
> sparse on all files in a directory for the kernel.
> But I experienced OOM while checking the XFS sources.
> Reply on the matter from Linus was at that time something in the line
> of that sparse did not do any atemp to free up memory after the early
> parse stage so it is consuming much more memory than needed.
> 
> This was almost one year ago so things may have changed - but at least
> something to keep an eye on.
> 
> XFS was just triggering this - it surely was due to codesize alone so
> any other big directory could have been the trigger too. It is not XFS specific.
> 
> 	Sam

  reply	other threads:[~2007-01-17 20:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 23:48 How do I get the latest sparse? Mitesh Shah
2007-01-16  0:17 ` Christopher Li
2007-01-16 12:23   ` Josh Triplett
2007-01-17  1:49     ` Christopher Li
2007-01-17  5:41       ` Josh Triplett
2007-01-17  6:31         ` Christopher Li
2007-01-17 19:05         ` Sam Ravnborg
2007-01-17 20:03           ` Christopher Li [this message]
2007-01-16  0:59 ` Randy Dunlap
2007-01-16  1:07   ` Mitesh Shah
2007-01-16  2:15     ` Randy Dunlap
2007-01-16  3:16       ` Dave Jones
2007-01-16 12:14         ` Josh Triplett
2007-01-16 15:40           ` Mitesh Shah
2007-01-17  0:23             ` Dave Jones

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=20070117200357.GB2077@chrisli.org \
    --to=sparse@chrisli.org \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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;
as well as URLs for NNTP newsgroup(s).