×

Handling CPU hotplug events in RCU without sleeplocks

  • US 9,940,290 B2
  • Filed: 10/19/2015
  • Issued: 04/10/2018
  • Est. Priority Date: 10/02/2015
  • Status: Expired due to Fees
First Claim
Patent Images

1. A method, comprising:

  • providing a combining tree to track RCU grace periods and CPU hotplug activity, said combining tree comprising;

    a root node at a root level of said combining tree and a set of lower level nodes in one or more lower levels of said combining tree, said lower level nodes including a set of two or more leaf nodes at a leaf level of said combining tree, and said lower level nodes optionally including zero or more intermediate nodes in zero or more intermediate levels of said combining tree;

    each said leaf node being accessed by a set of assigned CPUs and referencing an assigned higher level node in said combining tree that is said root node if there are two levels in said combining tree or that is one of said intermediate nodes if there are more than two levels in said combining tree;

    said root node being referenced by a set of assigned lower level nodes that are said leaf nodes if there are two levels in said combining tree or that are one or more levels of said intermediate nodes if there are more than two levels in said combining tree; and

    each node in said combining tree having a first bitmask whose bits indicate online or offline status of said CPUs, and a second bitmask whose bits indicate RCU quiescent state status of said CPUs, each bitmask bit in said leaf nodes directly corresponding to one of said CPUs, and each bitmask bit in said higher level nodes directly corresponding to an assigned lower level node and indirectly corresponding to CPUs represented by said assigned lower level node;

    periodically performing RCU grace period initialization in which, for each said node, said first bitmask is copied to said second bitmask;

    periodically performing CPU hotplug operations that result in said CPUs coming online or going offline, said CPU hotplug operations indicating online or offline status of said CPUs to said associated leaf nodes to which said CPUs are assigned, said online or offline status being indicated without manipulating any bits in said first bitmask of said leaf nodes;

    prior to each RCU grace period initialization, performing RCU grace period pre-initialization at each of said leaf nodes, said RCU grace period pre-initialization including (1) updating said first bitmask by setting or clearing bits to account for said leaf node'"'"'s assigned CPUs that have come online or gone offline as a result of said CPU hotplug operations, and (2) if said updating said first bitmask results in said first bitmask transitioning from a state in which at least one bit is set to a cleared state, or from a cleared state to a state in which at least one bit is set, conditionally propagating said state change to said leaf node'"'"'s assigned higher level node by setting or clearing a bit that corresponds to said leaf node in said higher level node'"'"'s first bitmask; and

    synchronizing access to said leaf nodes by said RCU grace period pre-initialization and said CPU hotplug operations without using a sleeplock that prevents said RCU grace-period initialization from running concurrently with manipulations of said combining tree by said CPU hotplug operations.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×