<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Please add CPU and memory hotplug udev rules"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=78478">78478</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Please add CPU and memory hotplug udev rules
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>benjamin.drung@profitbricks.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

please add udev rules to enable hotplugged CPUs and memory. I propose following
two rules:

ACTION=="add", SUBSYSTEM=="cpu", ATTR{online}=="0", ATTR{online}="1"
ACTION=="add", SUBSYSTEM=="memory", ATTR{state}=="offline",
ATTR{state}="online"

These rules are tested (without the ATTR online/state checks) on Debian
7/testing, Fedora 19/20/21, and Ubuntu 12.04/13.10/14.04.

Some distributions already ship CPU and memory hotplug rules. openSUSE 13.1 has
80-hotplug-cpu-mem.rules:

SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0",
ATTR{online}="1"
SUBSYSTEM=="memory", ACTION=="add", TEST=="state", ATTR{state}=="offline",
ATTR{state}="online"

CentOS 6 modified the acpi_memhotplug kernel module to automatically online
memory (configurable with CONFIG_ACPI_HOTPLUG_MEMORY_AUTO_ONLINE). This patch
is not mainlined (yet). They ship one rule for CPU hotplugging in
/lib/udev/rules.d/40-redhat.rules:

ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 >
/sys/devices/system/cpu/%k/online'"</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>