qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: use default mmap_min_addr 65536 whe


From: Martin Jansa
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
User-agent: Mutt/1.5.20 (2009-06-14)

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:address@hidden
Jansa Martin                 sip:address@hidden 
JaMa                         



reply via email to

[Prev in Thread] Current Thread [Next in Thread]