Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 31

Configuring the

HP-UX Kernel
Why Reconfigure the Kernel?

Tuning the HP-UX kernel allows you to customize your kernel configuration
to meet the needs of the devices, applications, and users on your system.

Q: ioscan says that Q: My database needs


my new Fibre Channel access to more shared
interface card is UNCLAIMED. memory segments.
What should I do? What should I do?

A: Add a fibre channel A: Tune a kernel


driver module! parameter!
Configuring the
HP-UX Kernel
Part 1: Managing the11i v1 Kernel
11i v1 Kernel Configuration Features

•11i v1 administrators can manage kernel drivers, subsystems, and tunables


•Most 11i v1 administrators use SAM

11i 1 kernel tuning features:


• Static and dynamically loadable (DLKM) kernel modules/drivers/subsystems
• Static and dynamically tunable kernel parameters
• Intuitive SAM interface for configuring the kernel
• SAM creates an automated kernel backup before applying a new kernel
Configuring 11i v1 Kernel Drivers &
Subsystems
Go to SAM->Kernel Configuration->Drivers to add and remove drivers
Go to SAM->Kernel Configuration->Subsystems to add and remove subsystems
− Changes to “Loadable” drivers/subsystems can be applied without a reboot
− Changes to “Static” drivers/subsystems require a reboot
Configuring 11i v1 Tunable Parameters

Go to SAM->Kernel Configuration->Configurable Parameters to modify tunables


− Changes to “Dynamic” tunables can be applied without a reboot
− Changes to “Static” tunables require a reboot
Processing and Applying the 11i v1
Kernel

• To build a new kernel using pending selections, click Actions->Process New Kernel
• Allow SAM to immediately backup the current kernel and apply the new one, or...
• Manually apply the new kernel with kmupdate later
• In either case, a reboot is required if static modules or tunables were modified

/stand

build

vmunix_test vmunix vmunix.prev

dlkm.vmunix_test dlkm dlkm.vmunix.prev

system.SAM system system.prev


Booting a Backup 11i v1 Kernel

• Before compiling a new kernel, SAM makes a backup of the existing kernel
• If the new kernel fails to boot, boot from the backup kernel instead

Boot to the ISL prompt


[POWER]
[ESC]
Main Menu> boot pri
Interact with the IPL? y

Look for /stand/vmunix.prev


ISL> hpux ls /stand

Boot the backup kernel


ISL> hpux -is /stand/vmunix.prev
Lab
activity
Configuring the
HP-UX Kernel
Part 2: Managing 11i v2 and v3 Kernels
11i v2 and v3 Kernel Configuration
Features

HP-UX 11i v2 and v3 introduce several kernel structural changes, and


several new commands to simplify kernel configuration and minimize downtime.

• Most configuration tasks may be performed via the new kcweb web interface, not sam
• All configuration tasks may also be performed via a streamlined command-line interface
• All kernel configuration commands can produce script-friendly formatted output
• Kernel configurations can be saved, restored, and moved between systems
• Admins can save multiple kernel configs, and can switch between them at will
• The running kernel configuration is automatically backed up before each config change
• The system automatically maintains a detailed log file of all kernel config changes
• Kernel module and tunable features and dependencies are better documented
• More kernel parameters are dynamically tunable
• More kernel modules are dynamically loadable
Configuring the
HP-UX Kernel
Part 4: Managing 11i v2 and
v3
Kernel Modules
Kernel Module Concept Review

• Each kernel configuration includes multiple kernel modules


• A kernel module is a device driver, kernel subsystem, or another body of kernel code
• Kernel modules must be linked or loaded into the HP-UX kernel
• An increasing number of kernel modules are “dynamically loadable” DLKMs
• Some kernel modules still must be “statically” linked into the kernel

btlan static module

Kernel
lvm static module Configuration

cdfs DLKM module

13
Kernel Module States

• A module’s state determines if/when the module will be accessible on the system
• HP-UX recognizes five different module states

State Description

unused The module isn’t included in the kernel configuration

static The module is statically bound into the vmunix kernel executable

auto The module will be dynamically loaded into the kernel when needed

loaded The module has been dynamically loaded into the kernel

best The module is in the “best” state, as defined by the developer


Kernel Module State Changes

• The system administrator can force a module state change via kcmodule
• Sometimes, HP-UX may change a module’s state automatically
• The kcmodule reports what caused each module to enter its current state

Cause Description

explicit The system administrator explicitly chose the current state

The system administrator chose to use the module, but didn’t choose a
best specific state, so the module is placed in its “best” state, as determined
by the module developer

The module was in the auto state, and was automatically loaded when
auto
something tried to use it (DLKMs only)

required The module is required by the kernel

The module is in use because some other module in the configuration


depend
depends on it
Viewing Module States with kcmodule

Use kcmodule to view kernel module states

List one line module summaries


# kcmodule [cdfs ...]
Module State Cause Notes
cdfs auto best auto-loadable, unloadable
sdisk static best
List module details
# kcmodule -v [cdfs ...]
Module cdfs (0.1.0)
Description CD File System
State auto (best state)
State at Next Boot auto (best state)
Capable auto static loaded unused
Depends On interface HPUX_11_23:1.0
List pending module changes in the nextboot kernel
# kcmodule -D
Managing Module States with kcmodule

kcmodule may also be used to change module states

Change the module state


# kcmodule \
[-h] \ optionally, hold changes for nextboot kernel
[-K] \ optionally, skip the automatic kernel backup
[-c config] \ optionally, apply change to a named configuration
[-C comment] \ optionally, provide an explanation of the change
module=state desired module and state
Mark a DLKM module to be dynamically loadable in the current kernel
# kcmodule cdfs=auto
Explicitly load a DLKM module into the current kernel
# kcmodule cdfs=loaded
Add a module to the static nextboot kernel
# kcmodule cdfs=static
Mark a module unusable in the static nextboot kernel
# kcmodule cdfs=unused
Place a module in the “best” state, as defined by the module developer
# kcmodule cdfs=best
Configuring the
HP-UX Kernel
Part 5: Managing 11i v2 and v3
Kernel Tunables
Kernel Module Tunable Parameters

• Each kernel module may contain one or more tunable parameters


• Tunable parameters may be modified on a per-kernel-configuration basis
• Many parameters can be modified dynamically
• Some parameters can only be modified by rebooting

vxfs kernel module

module metadata module code


vx_maxlink

Name Initialization routines vx_ninode


Version Tunable handlers
Type Module functions vxfs_bc_bufhwm
Description
vxfs_ifree_timelag
Dependencies
Tunables vxtask_max_monitors
Types of Tunables

HP-UX 11i v2 now supports five different types of tunable parameters

Type Description

Static Changes require re-linking, and rebooting

Dynamic Changes may be applied immediately

Automatic Values are set automatically, but can be overridden

User-Defined May be used like variables in other tunables’ formulas


Viewing Tunables with kctune

Use kctune to view kernel parameter values

List one line tunable summaries


# kctune [nproc ...]
Tunable Value Expression Changes
nproc 4200 Default Immed
List tunable details
# kctune -v nproc
Tunable nproc
Description Maximum number of processes on the system
Module pm
Current Value 4200 [Default]
Value at Next Boot 4200 [Default]
Value at Last Boot 4200
Default Value 4200
Constraints nproc >= 100
Can Change Immediately or at Next Boot
List pending tunable changes in the nextboot kernel
# kctune -D
Managing Tunables with kctune

• kctune may also be used to change tunable parameters


• kctune automatically verifies that all parameters are within allowed boundaries

Define one or more tunable parameters


# kctune [-h] \ optionally, hold changes for nextboot kernel
[-K] \ optionally, skip the automatic backup
[-c config] \ apply to named configuration rather than running kernel
[-C comment] \ optionally, provide an explanation of the change
tunable=value ...
Increment a tunable
# kctune nproc+=32
Set tunable to n, if not already greater than n
# kctune nproc>=1024
Create a user-defined parameter
# kctune –u numdbs=4
Define a tunable as an expression based on another system or user-defined parameter
# kctune nproc=1024+256*numdbs
Return a parameter to its default value
# kctune nproc=default
Monitoring Tunables with kcusage

• The Kernel Resource Monitor monitors kernel resource usage for selected tunables
• Use kcusage to monitor tunable usage patterns

View current usage for all supported kernel parameters


# kcusage [nproc ...]
Tunable Usage / Setting
==========================
nproc 137 / 4200

View top consumers and usage over the last hour/day/month/year, for tunable parameters
# kcusage [-t] [–h|-d|-m|-y] [nproc ...]
Parameter: maxfiles_lim
Setting: 4096
Time Usage % Usage ID Name
=========================================================
Mon 12/29/06 08:00 CST 35 0.9
35 740 inetd
22 1241 pwgrd
20 1369 scopeux
19 544 netfmt
17 1109 dced
Learning More about Tunable Parameters

• HP-UX now includes a man page for every tunable parameter


• Man pages describe what each parameter does, and how it should be tuned

NAME
VALUES
Failsafe
Default
Allowed values
Recommended values
DESCRIPTION
Who Is Expected to Change This Tunable?
Restrictions on Changing
When Should the Value of This Tunable Be Raised?
What Are the Side Effects of Raising the Value of This Tunable?
When Should the Value of This Tunable Be Lowered?
What Are the Side Effects of Lowering the Value of This Tunable?
WARNINGS
AUTHOR
SEE ALSO
Configuring the
HP-UX Kernel
Part 6: 11i v2 and v3
Kernel Troubleshooting
Kernel Troubleshooting Overview

HP-UX 11i v2 includes several solutions for


HELP! My kernel solving kernel configuration problems:
won’t boot!
• Review the kernel change log
• Review other log files
• Boot/load an alternate kernel configuration
• Boot using override parameters
• Boot to single-user tunable failsafe mode
Viewing the Kernel Change Log with
kclog
• HP-UX records all kernel changes are recorded in /var/adm/kc.log
• Use more to view the log, or...
• Use kclog to filter log entries by search key, module, or tunable

 View the last five log entries for the current kernel
# kclog 5
 View the last 5 entries for a specific named kernel configuration
# kclog –c weekendConfig 5
 View the last 5 entries that contain a specified string
# kclog –f “Oracle” 5
 View the last 5 entries associated with a specific tunable or module
# kclog –n “maxdsiz” 5
 View the last 5 entries for all tunable changes (but not kernel module changes)
# kclog –t tunable 5
 Add a general comment in the kernel log
Booting from an Alternate Kernel

If the default kernel configuration won’t boot,


boot from the backup kernel configuration, or any other kernel configuration

Booting with an override parameter, or from a backup configuration on PA-RISC:


Processor is booting from first available device.
To discontinue, press any key within 10 seconds. Escape
Main Menu: boot pri isl
Interact with IPL? y
ISL> hpux ls
ISL> hpux /stand/backup/vmunix

Booting with an override parameter, or from a backup configuration on Integrity:


HP-UX Boot Loader for IA64 Revision 1.71
Press Any Key to interrupt Autoboot Escape
\EFI\HPUX\AUTO ==> boot vmunix
HPUX> ll
HPUX> boot vmunix nproc=6000
HPUX>
Booting with Override Parameters

• If the default kernel configuration won’t boot, specify an override kernel parameter
• Override parameters override parameter values in /stand/vmunix

Booting with an override parameter on PA-RISC:


Processor is booting from first available device.
To discontinue, press any key within 10 seconds. Escape
Main Menu: boot pri isl
Interact with IPL? y
ISL> hpux /stand/vmunix nproc=6000

Booting with an override parameter on Integrity:


HP-UX Boot Loader for IA64 Revision 1.71
Press Any Key to interrupt Autoboot Escape
\EFI\HPUX\AUTO ==> boot vmunix
HPUX> boot vmunix nproc=6000
Booting to Tunable Maintenance Mode

Booting to tunable maintenance mode boots to single-user mode using


failsafe tunable parameters hard-coded in the kernel modules. After booting to
tunable maintenance mode, review the kernel log, modify the kernel as necessary,
and reboot.

Booting to tunable maintenance mode on PA-RISC:


Processor is booting from first available device.
To discontinue, press any key within 10 seconds. Escape
Main Menu: boot pri isl
Interact with IPL? y
ISL> hpux -tm

Booting to tunable maintenance mode on Integrity:


HP-UX Boot Loader for IA64 Revision 1.71
Press Any Key to interrupt Autoboot
\EFI\HPUX\AUTO ==> boot vmunix Escape
HPUX> boot vmunix –tm
Kernel Recovery Roadmap

System State Configuration State Action

Load the backup kernel configuration, or


backup is good another good kernel configuration using
kconfig -l
System is up
Find previous changes in the kernel
backup is questionable change log and reverse them using
kctune and kcmodule

backup is good Boot a known good configuration


Boot using an override parameter.

System is down Boot to failsafe mode, find previous


changes in the kernel change log, and
backup is questionable
reverse them using kctune and
kcmodule.

Boot from a system recovery tape

You might also like