Skip to content

Avoid polling and other inefficiencies #9

@danielzgtg

Description

@danielzgtg

I found that the userspace drivers are wasting a lot of CPU (~3%) while waiting, even when the touchscreen is completely idle. The only way userspace becomes knowledgeable of changes is by polling get_device_ready and get_doorbell every millisecond, and that is wasting power. Decreasing the polling frequency isn't a solution because that would only introduce latency.

There are many better alternatives to polling:

  • Have get_device_ready and get_doorbell block until new data is ready
  • Support actual nonblocking IO such as select, poll, and epoll
  • Have those be blocking character devices

Additionally, I'm not sure how efficient copying the buffers to userspace is. Performance might be improved if we allow userspace to mmap the 16 buffers instead of reading from them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions