user663896
user663896

Reputation:

How to share linux kernel memory with userspace (read only)

I need to share about 100KiB of kernel memory to userspace. Userspace daemon will access this memory in read-only manner several (5-10) times a second. Does procfs is the best way for implementing it?

Upvotes: 4

Views: 12642

Answers (1)

CKmum
CKmum

Reputation: 641

kmalloc and vmalloc are the way to go.

But check these before proceeding: What is the difference between vmalloc and kmalloc?

mmap kernel buffer to user space

Allocating memory for user space from kernel thread

As already mentioned, procfs is poor way to share data. It is used for settings per se.

Upvotes: 3

Related Questions