Skip to content

I have a solution to solve this potential issue, CPUTune::readConfigAtRuntime(). #44

Description

@iAaronLau

I have a solution to solve this potential issue, but as for my ability, I am unable to realize it:

// FIXME: As per Apple Document (https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP0000018-BAJFFJAD Listing 7-5):

    // FIXME: As per Apple Document (https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP0000018-BAJFFJAD Listing 7-5):
    // Events originating from timers are handled by the driver’s Action routine.
    // As with other event handlers, this routine should never block indefinitely.
    // This specifically means that timer handlers, and any function they invoke,
    // must not allocate memory or create objects, as allocation can block for unbounded periods of time.
    // As for now, the reading procedure reads only one byte, which is fairly fast in our case, so we assume
    // this routine will not cause infinite blocking. Let me know if you have some other good ideas.

The solution just need to do a replacement and to modify the function CPUTune::init():

  1. replace all the "/tmp/"with "/tmp/CPUTune/" in the project;

in the init function:

  1. mkdir /tmp/CPUTune
  2. mount a disk made by RAM with just 1MB size; All the config files work in RAM.

In this way, the disk I/O requests could be transformed into RAM requests. Therefore the
infinite blocking risk avoided.

@syscl @asepms92 @Mrc527 @christophe-duc @schdt899

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions