All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user: use default mmap_min_addr 65536 when /proc/sys/vm/mmap_min_addr cannot be read
Date: Thu, 13 May 2010 21:26:26 +0200	[thread overview]
Message-ID: <20100513192626.GO3370@jama> (raw)
In-Reply-To: <4BEC2FEC.6070900@twiddle.net>

On Thu, May 13, 2010 at 09:59:24AM -0700, Richard Henderson wrote:
> On 05/13/2010 06:17 AM, Martin Jansa wrote:
> > @@ -2899,8 +2900,14 @@ int main(int argc, char **argv, char **envp)
> >              if (fscanf(fp, "%lu", &tmp) == 1) {
> >                  mmap_min_addr = tmp;
> >                  qemu_log("host mmap_min_addr=0x%lx\n", mmap_min_addr);
> > +            } else {
> > +                qemu_log("cannot read value from /proc/sys/vm/mmap_min_addr, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
> > +                mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
> >              }
> >              fclose(fp);
> > +        } else {
> > +            qemu_log("cannot open /proc/sys/vm/mmap_min_addr for reading, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
> > +            mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
> >          }
> >      }
> 
> Perhaps you can combine these two else clauses?

Sure it would be possible, but while trying to find why qemu doesn't
work on someone box but works on mine I wanted to distinguish between
cannot open and cannot read.

Also if I combine it in test ie initialize mmap_min_addr with -1, and 
then check if it changed after read (because 0 is also valid value), 
or moving fopen and fscanf to one condition, then it gets IMHO as 
complicated as those 2 else clauses.

BTW: I noticed that qemu-arm works ok when mmap_min_addr is low enough
(and doesn't have to be zero).

my box had mmap_min_addr 4096 and qemu-arm worked fine even without
reading it

and the other boxes had mmap_min_addr = 64K and failed later to mmap.

Regards,

-- 
uin:136542059                jid:Martin.Jansa@gmail.com
Jansa Martin                 sip:jamasip@voip.wengo.fr 
JaMa                         

  reply	other threads:[~2010-05-13 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 13:17 [Qemu-devel] [PATCH] linux-user: use default mmap_min_addr 65536 when /proc/sys/vm/mmap_min_addr cannot be read Martin Jansa
2010-05-13 16:59 ` Richard Henderson
2010-05-13 19:26   ` Martin Jansa [this message]
2010-05-14 13:11     ` Richard Henderson

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=20100513192626.GO3370@jama \
    --to=martin.jansa@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.