---
name: "tune"
section: "1"
platform: "linux"
package: "mosix"
version: "1.5.7-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/tune"
---

# tune(1)

calibrate MOSIX kernel parameters to suit processor and network

## NAME

**tune** – calibrate MOSIX kernel parameters to suit processor and network

## SYNOPSIS

**tune**

**mtune**

**tune\_kernel**

**prep\_tune**

## DESCRIPTION

**tune** measures the timing of certain kernel operations in MOSIX, resulting in 14 tuning parameters. Similarly, **mtune** measures the timing of MFS operations, producing 6 other tuning parameters.

Although the MOSIX kernel will run reasonably well with the pre-supplied parameters, optimal results are achieved by measuring different parameters for each set of nodes whose hardware differs by one or more of the following:

- 1\.

  the processor

- 2\.

  the type or speed of the memory

- 3\.

  the number of memory wait-states (if any)

- 4\.

  the networking hardware

- 5\.

  whether the kernel has the SMP option configured or not

**tune** produces two output files, corresponding to two different methods of installing the parameters: The first output file, named *dscosts.h*, is to be included as is in the kernel sources: *{kernel\_directory}/include/mos/dscosts.h*. The other output file, *mosix.costs*, contains the 14 integer tuning parameters:  when copied to the file */proc/mosix/admin/overheads*, those parameters override the kernel's built-in parameters from *dscosts.h*. In paraticular, if *mosix.costs* is copied to the file */etc/overheads*, the tuning parameters will be loaded at boot time (when MOSIX is being configured).

Similarly, **mtune** produces two output files, corresponding to two different methods of installing the parameters: The first output file, named *mfscosts.h*, is to be included as is in the kernel sources: *{kernel\_directory}/include/mos/mfscosts.h*. The other output file, *mfs.costs*, contains the 6 integer tuning parameters:  when copied to the file */proc/mosix/admin/mfscosts*, those parameters override the kernel's built-in parameters from *mfscosts.h*. In paraticular, if *mfs.costs* is copied to the file */etc/mfscosts*, the MFS tuning parameters will be loaded at boot time (when MOSIX is being configured).

**tune\_kernel** is a more user-friendly front-end script to **tune** and **mtune**, guiding the system-administrator through the tuning procedure. There is no need for the common system-administrator to run **tune** (or **mtune**) directly (but if choosing to do so anyway, one must either run them in the */sbin* directory, or first copy the file */sbin/tunepass* to one's current directory). **tune\_kernel** also supports complex network topologies, eg. when the network-distance is not even between all nodes, provided that the kernel is configured to support complex topologies.  In that case, it combines the outputs of several invocations of *tune* and/or *mtune* to produce a complex version of */etc/overheads* and/or */etc/mfscosts*.

The pre-requisites for running *tune* and *mtune* successfully and obtaining accurate results are:

- 1\.

  Have two and only two nodes on the MOSIX network (either disconnect the others or turn them off).  It is preferable, but not required that both nodes have the same hardware (otherwise, some manual intervention will be required by the program and the tuning process will take longer).

- 2

  If any other MOSIX node(s) must remain connected to the network because they act as routers between the two tested nodes, then MOSIX must be disabled on those node(s) for the duration of the test (this can be done by running *setpe* *-off*).

- 3\.

  Place both nodes in single-user mode.  One way to achieve this is by typing "telinit 1".  The other way is to boot the nodes straight into single-user mode.

- 4

  Run *prep\_tune* on the *other* node (no need to run it on the node where you run *tune\_kerenl*, since *tune\_kernel* runs it there automatically). *prep\_tune* does the following:

  - a.

    enables the network, since it is normally disabled in single-user mode.

  - b.

    enables/starts MOSIX.

  - c.

    shuts down the (normally active) background operations of MOSIX, so that other ongoing system-activities do not interfere with the measurements.

- 4\.

  Do not touch either keyboard while *tune* is running.

## USING THE OUTPUT OF TUNE(/MTUNE)

The output of *tune* (and *mtune*) is to be used only on the node where *tune\_kernel* was running or on other nodes with identical hardware. If you have nodes of different hardware, you may need to run *tune\_kernel* several times on different consoles.

In a simple cluster, where the network-distance is even between all nodes, both methods are available: either re-compiling the kernel with the produced *dscosts.h* (*mfscosts.h* for *mtune*) or copying the file *mosix.costs*, containing 14 tuning-parameters to */etc/overheads* (or *mfs.costs*, containing 6 MFS tuning-parameters to */etc/mfscosts*).

In a complex cluster, only the second method is available and MOSIX supports up to CONFIG\_MOSIX\_MAXTOPOLOGY (configurable in the kernel) different network distances from each node to CONFIG\_MOSIX\_MAXTOPOLOGY groups of other nodes. The */etc/overheads* file may therefore contain up to (14+2)\*CONFIG\_MOSIX\_MAXTOPOLOGY integer constants, where each 14 tuning-parameters are followed by 2 constants: FIRST and LAST.

Similarly, the */etc/mfscosts* file may contain up to (6+2)\*CONFIG\_MOSIX\_MAXTOPOLOGY integer constants, where each 6 MFS tuning-parameters are followed by 2 constants: FIRST and LAST.

- \*

  When FIRST \<= LAST the preceding 14 (or 6) parameters apply to all MOSIX-nodes numbered between FIRST and LAST (inclusive).

- \*

  When FIRST \> LAST the preceding 14 (or 6) parameters apply to all MOSIX-nodes NOT between LAST and FIRST.

- \*

  When FIRST is non-zero and LAST is 0, the preceding 14 parameters (or 6) apply to all nodes except FIRST.

- \*

  When FIRST is 0, the preceding 14 (or 6) parameters include all the remaining nodes.

The first set of 14 (or 6) parameters also applies to all other unselected nodes (if any).

## FILES

- /sbin/tunepass

  A supplementary program required by *tune*.

- /sbin/prep\_tune

  A script to prepare the system for tuning.

- dscosts.h

  An output of *tune*, to be included in the kernel.

- mfscosts.h

  An output of *mtune*, to be included in the kernel.

- mosix.costs

  An output of *tune* containing 14 integer tuning parameters.

- mfs.costs

  An output of *mtune* containing 6 integer MFS tuning parameters.

- /proc/mosix/admin/overheads

  Where the resulting tuning parameters are written (if different from the kernel's).

- /proc/mosix/admin/mfscosts

  Where the resulting MFS tuning parameters are written (if different from the kernel's).

- /etc/overheads

  Tuning parameters.

- /etc/mfscosts

  MFS Tuning parameters.

## SEE ALSO

[mosix(7)](/mosix/7.md), MFS(7), [setpe(1)](/setpe/1.md).

## HISTORY

*tune*, *mtune* and *tune\_kernel* are MOSIX utilities.
