All about using memory mapped files. Questions on programming should be asked on Stack Overflow SE.

learn more… | top users | synonyms

9
votes
3answers
829 views

Memory size for kernel mmap operation

I'm interested in the way Linux mmaps files into the main memory (in my context its for executing, but I guess the mmap process is the same for writing and reading as well) and which size it uses. So ...
6
votes
1answer
427 views

File backed, locked shared memory and disk interaction

Varnish, a HTTP accelerator, uses a ~80MB file backed SHM log that is mlock()ed into memory. The Varnish docs recommend to store the file on tmpfs to avoid unnecessary disk access. However if the ...
5
votes
1answer
4k views

Hung system call

So I'm working with a custom kernel module that I'm writing a python front end for. The kernel module works, and it adds a framebuffer device file to /dev/fb1. I can read and write to it fine. I've ...
4
votes
1answer
1k views

Behavior of mmap'd memory on memory pressure

I have a large tar file (60GB) containing image files. I'm using mmap() on this entire file to read in these images, which are accessed randomly. I'm using mmap() for the following reasons: Thread ...
3
votes
1answer
72 views

Grsecurity subject mode x

I am conducting some research on Grsecurity on Hardened Gentoo, see http://en.wikibooks.org/wiki/Grsecurity. To be more specific, I am trying to find an example where subject mode x makes a difference....
2
votes
1answer
210 views

mmap /dev/random

Why is it that I cannot mmap /dev/random or /dev/urandom on Linux? I get errno 19 which is ENODEV. When I try the same code with /dev/zero it works. int fd = open(path, O_RDONLY); assert (...
2
votes
2answers
54 views

Can I add to /proc/self?

I want to create a number of named memory regions in my program, and mmap them somewhere so that other processes can read them. I can't guarantee that only one instance of my program will run at a ...
2
votes
3answers
3k views

How does mmap'ing /dev/mem work despite being from unprivileged mode?

As far as my understanding goes, User space programs run in the unprivileged mode, and thus do not have direct access to memory or I/O. Then how exactly can we directly access memory or I/O locations ...
2
votes
0answers
200 views

Using shared memory through tmpfs and NUMA on x86_64/Linux

Here's what I'd like to do: put a file on tmpfs but ensure that all of it (all pages of it) ends up on the same NUMA node. First, I thought this would be trivial: I'd just mmap() a tmpfs file with ...
1
vote
2answers
170 views

mmap and slow DMA transfers

I have a process that reads data from a hardware device using DMA transfers at a speed of ~4 * 50MB/s and at the same time the data is processed, compressed and written to a 4TB memory mapped file. ...
1
vote
1answer
236 views

proc/sys/vm/flush_mmap_pages missing in 3.9 kernel, how to get it?

There was an option in redHat 5.2 called flush_mmap_pages, I could set this to zero and that would turn of writing dirty pages from a mapped memory file (so I can do it myself when I want to). However ...
1
vote
1answer
957 views

Ext4 exhibits unexpected write latency variance vs. ext2

I have a latency sensitive application running on an embedded system, and I'm seeing some discrepancy between writing to a ext4 partition and an ext2 partition on the same physical device. ...
1
vote
0answers
39 views

Pagemap on memory mapped devices not working

I am trying to find the physical addresses of heap variables, stack variables and memory mapped peripheral addresses using the /proc/{pid}/pagemap file using the steps detailed in the file: http://lxr....
1
vote
0answers
318 views

Problems when using the framebuffer device directly

I am writing a program using the framebuffer device directly and I have three problems there. 1) The only way I can set the screen resolution correct is by passing the kernel option during boot: ...
0
votes
1answer
76 views

Linux Swap Space

I have 32GB memory. SSD and NonSSD drives. I installed Linux to NonSSD drive but I prefer SSD for /var directory and I didn't create swap space because there is high memory. I know physical memory +...
0
votes
0answers
17 views

mmap() fails while devmem2 succeeds (C/CPP) [Allwinner A20] [migrated]

I am trying to access the hardware registers of an A20 SOM by mmapping them to userspace. In this case, target is the PIO, listed at physical address 0x01C20800. The official Olimex Debian7(wheezy) ...