From: arisawa <arisawa@ar.aichi-u.ac.jp>
To: 9front@9front.org
Subject: Re: [9front] cwfs fsmempercent
Date: Sun, 4 May 2014 21:40:16 +0900 [thread overview]
Message-ID: <DB91CCB8-7CF7-4DAE-A291-4F0DD77E6133@ar.aichi-u.ac.jp> (raw)
In-Reply-To: <edd12afe17b1d29d9dfa30cc39d59228@felloff.net>
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
next prev parent reply other threads:[~2014-05-04 12:40 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 4:25 9FRONT "опен-сссл" Released sl
2014-04-28 10:52 ` cwfs fsmempercent arisawa
2014-04-28 17:08 ` [9front] " cinap_lenrek
2014-04-28 17:26 ` cinap_lenrek
2014-04-28 22:55 ` arisawa
2014-04-29 20:11 ` cinap_lenrek
2014-04-30 14:41 ` Kenji Arisawa
2014-04-30 20:14 ` cinap_lenrek
2014-05-01 10:39 ` 9pc64 arisawa
2014-05-01 11:07 ` [9front] 9pc64 Aram Hăvărneanu
2014-05-01 14:06 ` arisawa
2014-05-01 14:25 ` cinap_lenrek
2014-05-01 14:39 ` cinap_lenrek
2014-05-01 15:27 ` cinap_lenrek
2014-05-01 21:49 ` Kenji Arisawa
2014-05-01 21:51 ` cinap_lenrek
2014-05-01 23:22 ` Kenji Arisawa
2014-05-01 23:34 ` Kenji Arisawa
2014-05-02 0:22 ` cinap_lenrek
2014-05-02 11:02 ` Aram Hăvărneanu
2014-05-04 5:24 ` malloc Kenji Arisawa
2014-05-04 8:22 ` [9front] malloc arisawa
2014-05-04 12:40 ` arisawa [this message]
2014-05-04 23:22 ` [9front] cwfs fsmempercent cinap_lenrek
2014-05-05 0:11 ` arisawa
2014-05-05 0:31 ` cinap_lenrek
2014-05-05 0:43 ` cinap_lenrek
2014-05-05 2:04 ` arisawa
2014-05-05 4:32 ` cinap_lenrek
2014-05-05 8:00 ` arisawa
2014-05-05 11:15 ` arisawa
2014-05-05 12:08 ` arisawa
2014-05-03 0:37 ` cinap_lenrek
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=DB91CCB8-7CF7-4DAE-A291-4F0DD77E6133@ar.aichi-u.ac.jp \
--to=arisawa@ar.aichi-u.ac.jp \
--cc=9front@9front.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).