Re: mmap() question

2013-10-13 Thread Dmitry Sivachenko
On 12.10.2013, at 18:14, Konstantin Belousov kostik...@gmail.com wrote: First I tried with some swap space configured. The OS started to swap out my process after it reached about 20GB which is also not what I expected: what is the reason to swap out regions of read-only mmap()ed files?

Re: mmap() question

2013-10-12 Thread Konstantin Belousov
On Fri, Oct 11, 2013 at 09:57:24AM +0400, Dmitry Sivachenko wrote: On 11.10.2013, at 9:17, Konstantin Belousov kostik...@gmail.com wrote: On Wed, Oct 09, 2013 at 03:42:27PM +0400, Dmitry Sivachenko wrote: Hello! I have a program which mmap()s a lot of large files (total size more

Re: mmap() question

2013-10-12 Thread Dmitry Sivachenko
On 12.10.2013, at 13:59, Konstantin Belousov kostik...@gmail.com wrote: I was not able to reproduce the situation locally. I even tried to start a lot of threads accessing the mapped regions, to try to outrun the pagedaemon. The user threads sleep on the disk read, while pagedaemon has a

Re: mmap() question

2013-10-12 Thread Konstantin Belousov
On Sat, Oct 12, 2013 at 04:04:31PM +0400, Dmitry Sivachenko wrote: On 12.10.2013, at 13:59, Konstantin Belousov kostik...@gmail.com wrote: I was not able to reproduce the situation locally. I even tried to start a lot of threads accessing the mapped regions, to try to outrun the

Re: mmap() question

2013-10-11 Thread Dmitry Sivachenko
On 11.10.2013, at 9:17, Konstantin Belousov kostik...@gmail.com wrote: On Wed, Oct 09, 2013 at 03:42:27PM +0400, Dmitry Sivachenko wrote: Hello! I have a program which mmap()s a lot of large files (total size more that RAM and I have no swap), but it needs only small parts of that files

Re: mmap() question

2013-10-10 Thread Konstantin Belousov
On Wed, Oct 09, 2013 at 03:42:27PM +0400, Dmitry Sivachenko wrote: Hello! I have a program which mmap()s a lot of large files (total size more that RAM and I have no swap), but it needs only small parts of that files at a time. My understanding is that when using mmap when I access some

mmap() question

2013-10-09 Thread Dmitry Sivachenko
Hello! I have a program which mmap()s a lot of large files (total size more that RAM and I have no swap), but it needs only small parts of that files at a time. My understanding is that when using mmap when I access some memory region OS reads the relevant portion of that file from disk and

Re: mmap() question

2013-10-09 Thread RW
On Wed, 9 Oct 2013 15:42:27 +0400 Dmitry Sivachenko wrote: Hello! I have a program which mmap()s a lot of large files (total size more that RAM and I have no swap), but it needs only small parts of that files at a time. My understanding is that when using mmap when I access some memory

/dev/dsp mmap question

2011-02-26 Thread Andriy Gapon
Guys, if we the following on FreeBSD (pseudo-code): fd = open(/dev/dsp, O_RDWR); mmap(PROT_READ, fd); mmap(PROT_WRITE, fd); This won't work entirely correctly, right? I base my question on some observations of how a particular program behaves on FreeBSD and on the following comment in

Re: KLD mmap question

2002-05-31 Thread Doug White
On Thu, 30 May 2002, Tom Tang wrote: Thanks for the reply, I'll check it out. However if you'll notice in my prev mail, I stated that I was trying to contigmalloc 4K... Hard to believe that the system doesnt have 4K lying around. Good point. Contigmallocing a page is pretty silly, since

KLD mmap question

2002-05-30 Thread Tom Tang
Hello, I have a question about implementing mmap functions in device drivers. Thinking it would be simple, I contigmalloc'd a buffer of PAGE_SIZE and returned it using atop like other mmap device implementations. However when my userland program mmaps the device with offset 0, when I try

Re: KLD mmap question

2002-05-30 Thread Doug White
On Thu, 30 May 2002, Tom Tang wrote: I have a question about implementing mmap functions in device drivers. Thinking it would be simple, I contigmalloc'd a buffer of PAGE_SIZE and returned it using atop like other mmap device implementations. However when my userland program mmaps the

Re: KLD mmap question

2002-05-30 Thread Tom Tang
Doug, Thanks for the reply, I'll check it out. However if you'll notice in my prev mail, I stated that I was trying to contigmalloc 4K... Hard to believe that the system doesnt have 4K lying around. - Tom On Thu, 30 May 2002, Doug White wrote: On Thu, 30 May 2002, Tom Tang wrote: I

Re: KLD mmap question

2002-05-30 Thread Eric Anholt
On Thu, 2002-05-30 at 13:14, Tom Tang wrote: Hello, I have a question about implementing mmap functions in device drivers. Thinking it would be simple, I contigmalloc'd a buffer of PAGE_SIZE and returned it using atop like other mmap device implementations. However when my userland

Re: mmap question

1999-07-06 Thread John Polstra
In article 000101bec73c$e20e3660$[EMAIL PROTECTED], Kelly Yancey [EMAIL PROTECTED] wrote: Also, in case it hasn't been notice already (I'm running -stable from May 18th), the mmap(2) manpage has a typo: it has "#include sys/mman.h" So what's the typo, exactly? John -- John Polstra

Re: mmap question

1999-07-06 Thread John Polstra
In article 000101bec73c$e20e3660$291c4...@kbyanc.alcnet.com, Kelly Yancey kby...@alcnet.com wrote: Also, in case it hasn't been notice already (I'm running -stable from May 18th), the mmap(2) manpage has a typo: it has #include sys/mman.h So what's the typo, exactly? John -- John

Re: mmap question

1999-07-05 Thread Matthew Dillon
: Which is fine and dandy, I'll just stat() the file to get the filesize and :mmap() it. But what happens in someone comes along and replaces the file :with :a larger file? I understand that my view of the file will change to the new :file, but only the length that I mmap()ed originally. Do I

mmap question

1999-07-05 Thread Kelly Yancey
I have a quick question about mmap, hopefully someone can smack me and point out what I'm missing :) the man page says: The mmap() function causes the pages starting at addr and continuing for at most len bytes to be mapped from the object described by fd, starting at byte offset

Re: mmap question

1999-07-05 Thread Matthew Dillon
: Which is fine and dandy, I'll just stat() the file to get the filesize and :mmap() it. But what happens in someone comes along and replaces the file :with :a larger file? I understand that my view of the file will change to the new :file, but only the length that I mmap()ed originally. Do I