public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Martin Hunt <hunt@redhat.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: Roland McGrath <roland@redhat.com>, systemtap@sources.redhat.com
Subject: Re: offline elfutils processing committed
Date: Mon, 06 Nov 2006 20:55:00 -0000	[thread overview]
Message-ID: <1162839113.2797.33.camel@dragon> (raw)
In-Reply-To: <20061103234334.GC29330@redhat.com>

On Fri, 2006-11-03 at 18:43 -0500, Frank Ch. Eigler wrote:

> 
> Yup, now done, at least an easy way (emitting an inline query every
> time the relocatable $target variable is accessed).
> 
> It however exposes two problems with the newest symbol table code.
> First, the new _stp_module_lookup function holds a spinlock on its
> data structure, which could conceivably block.  

Is there some reason why the $target variable must be looked up each
time it is accessed?  Sounds slow.

I put the spinlock in at the last minute because I was worried that
someone might be tempted to use it to try to resolve addresses during a
kprobe. I don't think it can deadlock.


> The second problem is memory allocation.  Like ordinary associative
> arrays, the new symbol table also appears to be allocated using what
> comes down to kmalloc.  Unfortunately, with large number of entries of
> either kind, this allocation can fail, or trigger OOM handling.
> 
> The runtime needs to learn to either rely more (perhaps exclusively)
> on data segment allocation (.data or .bss arrays), or needs to make
> sure that it fails in a clean way if kernel free memory happens to be
> short.  This is essential.  (To see why, try running a script with
> -DMAXMAPENTRIES=999999.)

Moving the allocations into .data or .bss sections could still trigger
OOM situations.  You just simplify things some be having one large
allocation. I made this argument a year ago and was told to rewrite to
allocate memory in small chunks with kmalloc.  Now we are back to large
chunks with vmalloc?  I'm fine with that, but let's be clear we agree on
why we are doing this.

Regarding OOM killer, shouldn't we just set oom_adj to something like
+15?  That would put us at the top of the victims list so avoid the
situation where loading a systemtap module puts the system in a low
memory state which causes the oom killer to start ramdomly killing off
processes.

Martin



  parent reply	other threads:[~2006-11-06 18:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01  4:48 Frank Ch. Eigler
2006-11-01 20:37 ` Roland McGrath
2006-11-04  3:29   ` Frank Ch. Eigler
2006-11-04  4:05     ` Roland McGrath
2006-11-04 14:27       ` Frank Ch. Eigler
2006-11-06 20:55     ` Martin Hunt [this message]
2006-11-06 21:18       ` Frank Ch. Eigler
2006-11-06 21:52         ` Martin Hunt
2006-11-06 22:15           ` Frank Ch. Eigler
2006-11-01 22:22 Stone, Joshua I
2006-11-01 22:57 ` Frank Ch. Eigler
2006-11-02 16:42 Stone, Joshua I
2006-11-06 22:41 Stone, Joshua I
2006-11-07  4:37 ` Roland McGrath
2006-11-07  6:36 ` Martin Hunt
2006-11-07 15:13   ` Frank Ch. Eigler
2006-11-07 15:43     ` Martin Hunt
2006-11-07 16:17       ` Frank Ch. Eigler
2006-11-07 16:39         ` Martin Hunt
2006-11-08  1:26           ` Frank Ch. Eigler

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=1162839113.2797.33.camel@dragon \
    --to=hunt@redhat.com \
    --cc=fche@redhat.com \
    --cc=roland@redhat.com \
    --cc=systemtap@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).