简体   繁体   English

在Linux中物理连续与虚拟非连续

[英]Physcial contiguous vs virtually non contiguous in linux

I have a requirement for large video frame buffer that needs to be physically contiguous. 我对需要物理上连续的大型视频帧缓冲区有要求。 So my question is when kernel driver request physical contig memory, the virtual address returned by kernel will be contiguous or non-contig? 所以我的问题是,当内核驱动程序请求物理重叠群内存时,内核返回的虚拟地址是连续的还是不连续的?

Update: My apology, let me add more details. 更新:抱歉,让我添加更多详细信息。 For a video buffer of resolution 640x480 with each pixel of 1 byte, the total memory expected 307200 bytes (640x480). 对于每个像素为1字节的分辨率为640x480的视频缓冲区,总内存应为307200字节(640x480)。 For a system that works on 4KiB page, the total pages needed by above buffer will be 75. 对于在4KiB页面上工作的系统,上述缓冲区所需的总页面数将为75。

Now lets assume in some way this 307200 memory block requested is physically contiguous. 现在,以某种方式假设所请求的307200存储块在物理上是连续的。 But when virtual address of each page is being returned by kernel, will those pages be contiguous or non-contiguous? 但是,当内核返回每个页面的虚拟地址时,这些页面是连续的还是不连续的?

连续的-内核虚拟地址空间映射通常与物理内存为1-1(即V = P +偏移)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM