From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ar.aichi-u.ac.jp ([202.250.160.40]) by ttr; Sun May 4 08:40:28 EDT 2014 Received: from [192.168.1.105] ([125.193.25.135]) by ar; Sun May 4 21:40:17 JST 2014 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: [9front] cwfs fsmempercent From: arisawa In-Reply-To: Date: Sun, 4 May 2014 21:40:16 +0900 Content-Transfer-Encoding: 7bit Message-Id: List-ID: <9front.9front.org> X-Glyph: ➈ X-Bullshit: cloud-oriented grid backend References: To: 9front@9front.org X-Mailer: Apple Mail (2.1510) Now we can allocate large memory allocation for cwfs on 9pc64. it seems the change below works for me. change of malloc.c static ulong memsize(void) { ... // pgmax = (1024*1024*1024)/pgsize; /* 1GB max for 386 */ pgmax = (3*1024*1024*1024)/pgsize; /* 3GB max for x64 */ ... } void* sbrkz(ulong n) { char *p; p = sbrk(n); memset(p,0,n); return p; } /* * allocate rest of mem * for io buffers. */ void iobufinit(void) { ... // hiob = ialloc(nhiob * sizeof(Hiob), 0); hiob = sbrkz(nhiob * sizeof(Hiob)); ... // p = ialloc(niob * sizeof(Iobuf), 0); p = sbrkz(niob * sizeof(Iobuf)); ... // xiop = ialloc(niob * RBUFSIZE, 0); xiop = sbrkz(niob * RBUFSIZE); ... } term% ps ... arisawa 2649 0:00 0:00 3160928K Semacqui 6.cwfs64x arisawa 2650 0:00 0:00 3160928K Pread 6.cwfs64x arisawa 2651 0:00 0:00 3160928K Pread 6.cwfs64x arisawa 2652 0:00 0:00 3160928K Pread 6.cwfs64x arisawa 2653 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2654 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2655 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2656 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2657 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2658 0:00 0:00 3160928K Semacqui 6.cwfs64x arisawa 2659 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2660 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2661 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2662 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2663 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2664 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2665 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2666 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2667 0:00 0:00 3160928K Rendez 6.cwfs64x arisawa 2668 0:00 0:00 3160928K Sleep 6.cwfs64x arisawa 2669 0:00 0:00 3160928K Sleep 6.cwfs64x ... term% don't remove #define malloc(n) ialloc(n, 0) in all.h thank you cinap. Kenji Arisawa On 2014/04/30, at 5:11, cinap_lenrek@felloff.net wrote: > that might work. i havnt tried it. you need to be carefull > with overflows as 2GB becomes negative with signed 32 bit ints. > > if(dsize >= 0x80000000UL){ /* for sanity, overflow */ > werrstr("invalid allocation size"); > return nil; > } > > the only routine that does substantial allocation is iobufinit() > in cwfs/malloc.c. > > as far as i can see, this memory is never freed, so we might > just remove the define: > > all.h:13: #define malloc(n) ialloc(n, 0) > > and provide our own ialloc() that just uses brk(). > > -- > cinap