Making CPUSets Persistent Across Reboots

This document (7007601) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11 Service Pack 1
SUSE Linux Enterprise Real Time 11

Situation

Every time a SLERTE server is rebooted, configured CPUsets must be created again. How can the CPUsets be configured persistent across reboots?

Resolution

If you use CPUsets, it is recommended to configure the cset service for persistent cpusets.

From the cset(1) man page:

PERSISTENT CPUSETS
To create a persistent cpuset setup, i.e. one that survives a reboot, you need to create the file /etc/init.d/cset. This distribuition of cset includes an example cset init.d file found in /usr/share/doc/pacakges/cpuset which is called cset.init.d. You will need to alter the file to your specifications and copy it to be the file /etc/init.d/cset. See the comments in that file for more details.

INSTRUCTIONS
1. Make sure the cpuset rpm package is installed.
# zypper in cpuset

2. Copy the default cset service script to /etc/init.d.
# cp /usr/share/doc/pacakges/cpuset/cset.init.d /etc/init.d/

3. Rename the cset service template script
# mv /etc/init.d/cset.init.d /etc/init.d/cset

4. Customize the /etc/init.d/cset script to meet your needs.
NOTE: See example script below

5. Turn the service on.
# insserv cset

6. Start the service.
# /etc/init.d/cset start

WARNING: The default /usr/share/doc/pacakges/cpuset/cset.init.d service script is blank. It will NOT work until you customize the start() and stop() sections to meet your server needs.
 

Additional Information

EXAMPLE
The following is an example of the /etc/init.d/cset file that creates and destroys a two cpusets called "system" and "rtcpus".
 
#!/bin/sh
#
# Example system startup script for setting up presistent cpusets with the
# cset tool from package cpuset. Copy this script to /etc/init.d/cset and
# uncomment out the commands in start() and stop() below, or add your own.
# Based on /etc/init.d/skeleton template.
[.....]
### BEGIN INIT INFO
# Provides: cset
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Make cpuset setup persistent across boots
# Description: Configure desired cpuset setup with the
# cset tool for persistent cpusets across boots.
### END INIT INFO
#
CSET_BIN=/usr/bin/cset
test -x $CSET_BIN || { echo "$CSET_BIN not installed";     if [ "$1" = "stop"]; then exit 0;    else exit 5; fi; }
CSET_SYSTEM=0
CSET_USER=1-3
. /etc/rc.status
rc_reset

case "$1" in    start)        echo -n "Starting cpuset "        $CSET_BIN shield --userset=rtcpus --cpu="$CSET_USER" --kthread=on        rc_status -v        ;;    stop)        echo -n "Shutting down cpuset "        $CSET_BIN set --set=system --destroy        $CSET_BIN set --set=rtcpus --destroy        rc_status -v        ;;    status)        echo -n "Checking for service cpuset "        $CSET_BIN set --recurse        rc_status -v        ;;    *)        echo "Usage: $0 {start|stop|status}"        exit 1        ;;
esac
rc_exit

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7007601
  • Creation Date: 19-Jan-2011
  • Modified Date:19-Mar-2021
    • SUSE Linux Enterprise Real Time
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center