On Sat, Jun 27, 2020 at 01:16:50PM +0800, 孙世龙 sunshilong wrote:
So as per the above - you allocate one struct array at driver load time for this stuff. You already know how big the structure/array has to be based on the maximum number of devices or whatever you're trying to track. And if you don't know the maximum, you're not doing real time programming. Or at least not correctly. Not at the driver load time, but the load time of the real-time process(i.e. before the entry of the main() function). It needs to allocate(i.e. use vmalloc) a huge memory (i.e. for example 80MB, maybe 50MB (how much memory is suitable is decided by the specific applications.) used by the user application later. And that's ok to allocate so huge memory size by vmalloc() and no error complained by the kernel.
Applications do not allocate kernel memory at all, that's up to a kernel driver. Userspace does things in totally different ways. Again, do you have a pointer to your kernel source code that is doing this allocation that is failing? thanks, greg k-h