On Thu, 23 Jun 2022 07:06:36, dave.hansen@xxxxxxxxx wrote: >> In our scenario, we need reserve or alloc large continous memory like >> 256M in machine which have different memory specification at just >> boot phase for a user land process. > >Just marking the memory reserved doesn't do any good by itself. There >must be some *other* kernel code to find this reserved area and make it >available to userspace. > Sorry for not describing clearly. We wanted to use /dev/mem as our interface to access the memory from userspace. So we don't add other kernel code. >It seems kinda silly to add this to the kernel without also adding the >other half of the solution. Plus, we don't really even know what this >is for. Are there other, better solutions? I certainly can't offer any >because this changelog did not provide a full picture of the problem >this solves. Again, sorry for not describing clearly. Here is our scenario. We need to reserve large continous memory at least 256M in 512G's machine, and need reserve more memory in larger machine. A userspace program will use it through /dev/mem to store some data. Besides, a hardware will need the data stored by the userspace program to do it's job. Why we need continous physical memory is that our hardware can only access memory without mmu. So allocing an area of large continous memory for userspace is the best way for us. Considering that we have several type of machine with different memory specification, so we want an easy way to reserve memory with only one size parameter. I find a better way to realize the requirement. I will send a v2 patch soon.