-1

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
  • @BasileStarynkevitch : i've changed my question can you help me now ?? – zakhar_asli Jul 25 '15 at 11:07
  • What kernel subsystem? Are you coding a kernel module? Can't it allocate kernel memory? This looks like a completely different question, and showing some source code could help.... You really should edit your question, or ask a new one, showing relevant commands and source code..... – Basile Starynkevitch Jul 25 '15 at 11:41
  • i have not developed this module !!all i know is that, this module got to use dedicated chunks of memory that is also accessible like block devices!! as i mentioned before! tell me something : is it possible that this module could access a memory that is reserved at boot time by alloc_boottime like block devices ? – zakhar_asli Jul 25 '15 at 12:20
  • @BasileStarynkevitch : did you see it my friend ? – zakhar_asli Jul 25 '15 at 12:47
  • I would not call you my friend, especially given the harsh & rude comments you gave me previously... And I still don't understand what you are asking. Please edit your question (or ask a new one), don't comment it. Show some code and some commands in your question. – Basile Starynkevitch Jul 25 '15 at 12:49

1 Answers1

0

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.