there is a developed kernel subsystem that needs a chunk of memory allocated to itself that only it could manipulate this chunk. this memory should be physically contiguous and also it need the access like the way with block devices(i mean /dev/..).

what would you suggest ?
between ram disk and reserving memory at boot time what would you suggest ?

  • Duplicate of this question that you have asked, and which is as confusing as this one. – Basile Starynkevitch Jul 23 '15 at 10:20
  • 2
    How exactly have you created your RAM disk? – Basile Starynkevitch Jul 23 '15 at 10:23
  • And what is the specific process doing? Can you change its code? – Basile Starynkevitch Jul 23 '15 at 10:26
  • 1
    Show some code: the commands to make or use the "RAM disk", the relevant code of your particular process. – Basile Starynkevitch Jul 23 '15 at 10:39
  • 1
    If you're only going to use the data in a single process and you have a 64-bit system, it's probably simpler to keep the data in the process's address space and use mlock to lock it in RAM, rather than trying to make a RAM-resident filesystem do what you want here. – Mark Plotnick Jul 23 '15 at 14:17

You should probably not have created any RAM disk (i.e. use tmpfs not ramfs), see this. Linux is managing RAM better than you can, and its page cache is very good (so you might not need to create any "RAM" disk, just use a tmpfs mounted /tmp and put your file there, or even any file in any file system: with a lot of RAM very often the data stays in the page cache and no actual disk IO is involved, but see sync(2). See linuxatemyram and my answer to your previous (confusing) question.

And "assigning a RAM disk to a specific process" is impossible on Linux; you probably should explain the use case. a RAM disk is generally a tmpfs filesystem (or perhaps an obsolete ramfs one) so you assign it to a file system, not a single process.

You could probably limit most of the other processes using your Linux. For example, use the ulimit shell builtin (based upon the setrlimit(2) syscall)

How can i be sure that this RAM Disk is only used by the mentioned process and other processes wont change its data?

The kernel should guarantee the tmpfs file system (like it is guaranteeing other file systems). Only processes accessing files in that file system can change the data inside them.

If you can change the code of the program of the specific process you want to favor, use mlock(2).

See also ionice(1) & nice(1)

I guess that if you did not create any RAM disk, your Linux system will perform (or can be configured to perform) better than with explicit RAM disk.

You won't get any help unless you show the exact commands, and some code dealing with your issue.

Not the answer you're looking for? Browse other questions tagged or ask your own question.