mmap slower than ioremap

前端 未结 2 1623
盖世英雄少女心
盖世英雄少女心 2021-02-02 17:44

I am developing for an ARM device running Linux 2.6.37. I am trying to toggle an IO pin as fast as possible. I made a little kernel module and a user space application. I tried

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 17:52

    My guess would be that since mmap has to check to make sure you're writing to memory you're allowed to write to, it's going to be slower than the kernel version (which I believe/assume doesn't do that kind of checking--with a kernel module you're responsible for testing until you're very sure you're not breaking things).

    Try using do_mmap (I believe that's the one) to use mmap from kernel space, and see how that compares. If it's comparably faster, then I'm right. If it's not, it's something else.

提交回复
热议问题