Vous êtes sur la page 1sur 20

V10.

cover

Course Quick View with Full TOC

AIX Internals & Performance II: Memory Management


Course code QV472 ERC 1.1

IBM Systems Software Education


Course Quick View with Full TOC

Trademarks
IBM® and the IBM logo are registered trademarks of International Business Machines
Corporation.
The following are trademarks of International Business Machines Corporation, registered in
many jurisdictions worldwide:
AIX 6™ AIX® DB2®
DS8000® Express® FlashSystem™
GPFS™ IBM FlashSystem® Power Systems™
Power® PowerHA® PowerSC™
PowerVM® POWER6® POWER7+™
POWER7® POWER8® PurePower System™
SystemMirror® Systems Director
VMControl™
Intel is a trademark or registered trademark of Intel Corporation or its subsidiaries in the
United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Java™ and all Java-based trademarks and logos are trademarks or registered trademarks
of Oracle and/or its affiliates.
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered
trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other
jurisdictions.
Other product and service names might be trademarks of IBM or other companies.

May 2012 edition


The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

© Copyright International Business Machines Corporation 2012.


This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.
V7.0
Course Quick View with Full TOC

TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

Course description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

Agenda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

Unit 1. Memory Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1


Unit Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Big Picture POWER7 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
POWER Hypervisor Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Partition Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Dividing Memory Resources (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Dividing Memory Resources (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Viewing Memory Allocation (System Scope) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Viewing Memory Information (LPAR Scope) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Real Mode Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
Address Translation (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
Address Translation (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
Real Mode Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
Physical Address Range Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
Allocating Physical Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15
Partition Page Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16
Translation Control Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17
The Hypervisor and Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Example of Physical Memory Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19
Example Physical Memory Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20
Checkpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-21
Exercise Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-22
Unit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23

Unit 2. Memory Management Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1


Unit Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Pages and Page Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Virtual Memory and Physical Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Overview of Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Page Table Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Effective Address Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Supported Page and Segment Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
64 KB Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Supported Page Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Page Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Multiple Page Size Application Support and the vmo Tunables . . . . . . . . . . . . . . . 2-15

© Copyright IBM Corp. 2012 Contents iii


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Course Quick View with Full TOC

16 MB and 16 GB Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-16


Address Space of a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
Execution Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-18
32-bit Address Space (User Mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-19
64-bit Address Space(User and Kernel Mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-20
Process Address Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-21
Obtaining Page Size and Segment Information . . . . . . . . . . . . . . . . . . . . . . . . . . .2-22
svmon Global Report and Detailed Segment Report . . . . . . . . . . . . . . . . . . . . . . . .2-23
Shared Memory and Mapped Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-24
Memory Affinity Concepts (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
Memory Affinity Concepts (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-26
Process Table Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27
Extending the pvproc Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-28
Memory Affinity (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-29
Memory Affinity (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30
Checkpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-31
Exercise Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-32
Unit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-33

Unit 3. Memory Management Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1


Unit Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2
Kernel Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
Major VMM Functions (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4
Major VMM Functions (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
Demand Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
Translating Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
Effective Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
Hardware Address Resolution Effective Address to Physical Address . . . . . . . . . .3-9
Page-in/Page-out Mechanism and Assigned Segments . . . . . . . . . . . . . . . . . . . .3-10
VMM Involvement with I/Os . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11
File-in/File-out Mechanism and Assigned Segments . . . . . . . . . . . . . . . . . . . . . . .3-12
Major VMM Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13
Hardware Page Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-14
Page Not in Hardware Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-15
Page Exists on Paging Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-16
The External Page Table (XPT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17
Page Exists on a File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-18
How to Manage VMM Tunable Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-19
Managing Page Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-20
Dynamic Page Size Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-21
Dynamic Variable Page Size Support and How it works . . . . . . . . . . . . . . . . . . . .3-22
How to View Page Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-23
How to View Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-24
Memory Affinity Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-25
Multiple mempools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-26
Least Recently Used (LRU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-27
Clock Hand Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-28
Page Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-29

iv AIX Internals II © Copyright IBM Corp. 2012


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

TOC List of Free Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30


Free List Thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-32
Page Stealing Free List Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-33
When to Steal Pages Based on Free Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-34
When to Steal Pages Based on Client Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-35
What Types of Pages are Stolen? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36
Viewing Memory Page Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37
Significance of lruable pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38
Pinned Memory Limits (1 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-39
Pinned Memory Limits (2 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40
Pinned Memory Limits (3 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-41
Paging Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42
Paging Space Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43
Paging Space Garbage Collection (PSGC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44
PSGC Tunables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45
Storage Protection Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
How Does It Work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47
Kernel Storage Protection Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
Checkpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
Exercise Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50
Unit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51

Unit 4. Monitoring Memory Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1


Unit Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Monitoring Memory Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Monitoring Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
How is Memory Being Used? Using vmstat and topas . . . . . . . . . . . . . . . . . . . . . 4-6
Types of svmon Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Calculating Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
svmon (-G) Global Report (1 of 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
svmon (-G) Global Report (2 of 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
svmon (-G) Global Report (3 of 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
svmon (-G) Global Report (4 of 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
svmon (-P) Process Report (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
svmon (-P) Process Report (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
svmon (-S and -D) Process Segment Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Segment Information in svmon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
svmon (-S) Global Segment Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Working Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
File Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
svmon (-C) Command Segment Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Shared Memory Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
Shared Memory Segments and ipcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
Identifying Two Instances of the Same Program . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Identifying Two Processes Accessing the Same File . . . . . . . . . . . . . . . . . . . . . . 4-25
Memory Leaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Detecting a Memory Leak with ps gv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
Detecting a Memory Leak with svmon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28

© Copyright IBM Corp. 2012 Contents v


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Course Quick View with Full TOC

Checkpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-29
Exercise Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-30
Unit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-31

Unit 5. Memory Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1


Unit Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
5.1. Active Memory Sharing (AMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-3
Topic Objectives: Active Memory Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
What is Active Memory Sharing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-5
Operating System Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-6
AMS Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7
Working Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
AMS Components (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
AMS Components (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-10
I/O Entitled Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-11
Configuration Example (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-12
Configuration Example (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-13
It All Fits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
Small Physical Overcommitment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15
Cooperative Loaning (1 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
Cooperative Loaning (2 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-17
Cooperative Loaning (3 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18
Large Physical Overcommitment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-19
Page Stealing (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Page Stealing (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-21
Monitoring AIX (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22
Monitoring AIX (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-23
Tuning AIX for AMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-24
Active Memory Deduplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-25
Topic Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-26
5.2. Active Memory Expansion (AME) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-27
Topic Objectives: Active Memory Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-28
Active Memory Expansion Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-29
AME Scenarios (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
AME Scenarios (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-31
Expanded Logical Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-32
Memory Expansion Factor and Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
AME Planning Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
Example amepat Report (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35
Example amepat Report (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-36
Expanded Memory Deficit (1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-37
Expanded Memory Deficit (2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-38
The amepat Monitoring Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-39
The lparstat Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-40
The vmstat Monitoring Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-41
Fine Tuning AME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-42
Topic Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-43
Checkpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44

vi AIX Internals II © Copyright IBM Corp. 2012


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

TOC Unit Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-45

Appendix A. Checkpoint solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1

© Copyright IBM Corp. 2012 Contents vii


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

TMK Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM® and the IBM logo are registered trademarks of International Business Machines
Corporation.
The following are trademarks of International Business Machines Corporation, registered in
many jurisdictions worldwide:
Active Memory™ AIX 5L™ AIX 6™
AIX® POWER Hypervisor™ Power Systems™
Power® PowerVM® POWER6®
POWER7® Redbooks®
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other product and service names might be trademarks of IBM or other companies.

© Copyright IBM Corp. 2012 Trademarks ix


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

pref Course description


AIX Internals & Performance II: Memory Management

Duration: 3 days

Purpose
The goal of this course is to provide the student with a working
knowledge of AIX 7 kernel concepts as they relate to memory
management. It provides background information useful to those
looking to develop the skills to analyze complex performance issues in
AIX running on IBM Power Systems hardware. This course uses a
combination of instructor lectures and machine exercises to provide
the student with practical background knowledge regarding the topics
covered.

Audience
This is an intermediate to moderately advanced course. The audience
for this training includes system administrators, support personnel,
developers, IT specialists, IT architects, and system engineers.

Prerequisites
Students attending this course are expected to have AIX system
administration skills, and knowledge of the methods used by the AIX
kernel for process and thread management. These skills can be
obtained by attending the following courses or gained from equivalent
experience:
• AHQV471 - AIX Internals I: Process and Thread Management

Objectives
After completing this course, you should be able to:
• Describe memory resources, concepts and terminology
• Explain the purpose of the kernel Virtual Memory Manager
component
• Identify the data structures used by the kernel to manage memory
resources
• Explain the memory address translation mechanisms

© Copyright IBM Corp. 2012 Course description xi


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Course Quick View with Full TOC

• Describe the AIX memory affinity mechanisms


• Identify the AIX commands for monitoring memory resource
consumption
• Describe memory virtualization technologies

xii AIX Internals II © Copyright IBM Corp. 2012


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

pref Agenda

Welcome
Unit 1 - Memory Resources
Exercise 1 - Memory Resources
Unit 2 - Memory Management Fundamentals
Exercise 2 - Memory Management Fundamentals
Unit 3 - Memory Management Framework
Exercise 3 - Memory Management Framework
Unit 4 - Monitoring Memory Utilization
Exercise 4 - Monitoring Memory Utilization
Unit 5 - Memory Virtualization

© Copyright IBM Corp. 2012 Agenda xiii


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Course Quick View with Full TOC

Text highlighting
The following text highlighting conventions are used throughout this book:
Bold Identifies file names, file paths, directories, user names,
principals, menu paths and menu selections. Also identifies
graphical objects such as buttons, labels and icons that the
user selects.
Italics Identifies links to web sites, publication titles, is used where the
word or phrase is meant to stand out from the surrounding text,
and identifies parameters whose actual names or values are to
be supplied by the user.
Monospace Identifies attributes, variables, file listings, SMIT menus, code
examples and command output that you would see displayed
on a terminal, and messages from the system.
Monospace bold Identifies commands, subroutines, daemons, and text the user
would type.

xiv AIX Internals II © Copyright IBM Corp. 2012


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

Uempty Unit 1. Memory Resources

What this unit is about


This unit describes some fundamental concepts related to memory
resources as observed on Power Systems servers. In particular, the
unit concentrates on the terminology related to the allocation of
memory in a partitioned environment.

What you should be able to do


After completing this unit, you should be able to:
• Describe memory resources, concepts and terminology for the
partitioned environment

How you will check your progress


• Checkpoint questions
• Machine exercises

References
More information about the commands mentioned in this unit are
available from the IBM Systems Information Center:
http://publib.boulder.ibm.com/infocenter/systems/index.jsp

© Copyright IBM Corp. 2012 Unit 1. Memory Resources 1-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

Uempty Unit 2. Memory Management Fundamentals

What this unit is about


This unit describes how memory is organized and addressed in AIX 7.
It shows the memory hierarchy and the addressing framework. It also
describes the addressing entities, such as segments, pages, and
frames.

What you should be able to do


After completing this unit, you should be able to:
• Describe the basic elements of VMM, such as segments, pages,
and page frames
• Explain how virtual-to-real storage mapping works
• List the page sizes supported on AIX
• List the types of address spaces used by AIX and describe how
they are organized
• Describe the segmented address space layout for 32-bit and 64-bit
user processes
• List shared memory capabilities and services
• Explain ways of classifying memory objects

How you will check your progress


• Checkpoint questions
• Machine exercises

References
Bach, Maurice J., The Design of the UNIX Operating System
(ISBN-10: 0132017997)
IBM AIX Information Center for AIX 7.1
http://publib.boulder.ibm.com/infocenter/aix/v7r1
AIX 7.1 Manuals
http://publib.boulder.ibm.com/infocenter/pseries/v7r1/i
ndex.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1
/basetrf1.htm

© Copyright IBM Corp. 2012 Unit 2. Memory Management Fundamentals 2-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Course Quick View with Full TOC

SG24-7910 IBM AIX Version 7.1 Differences Guide Redbook

2-2 AIX Internals II © Copyright IBM Corp. 2012


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

Uempty Unit 3. Memory Management Framework

What this unit is about


This unit describes how AIX 7implements memory management. It
presents important information regarding memory management
mechanisms, algorithms and policies. This unit also explains the
concepts of memory affinity and storage protection keys.

What you should be able to do


After completing this unit, you should be able to:
• Describe the demand paging system implemented by AIX
• Describe the address resolution framework
• Explain key VMM algorithms and describe how they affect system
behavior
• Describe the mechanism for managing VMM by using tunable
parameters
• Explain the dynamic variable page size support
• Explain how affinity domains influence memory management
• Explain the storage protection keys mechanism

How you will check your progress


• Checkpoint questions
• Machine exercises

References
Bach, Maurice J., The Design of the UNIX Operating System
(ISBN-10: 0132017997)
IBM AIX Information Center for AIX 7.1
http://pic.dhe.ibm.com/infocenter/aix/v7r1
AIX 7.1 Manuals
http://publib.boulder.ibm.com/infocenter/pseries/v7r1/i
ndex.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1
/basetrf1.htm
SC24-7910 IBM AIX Version 7.1 Differences Guide Redbook

© Copyright IBM Corp. 2012 Unit 3. Memory Management Framework 3-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

Uempty Unit 4. Monitoring Memory Utilization

What this unit is about


This unit explains how to collect and interpret the output of several
memory utilization reports, and how the values shown relate to certain
fields in the output of other commands, such as vmstat and ipcs.
Collectively, theses reports can be used to fully understand how
memory is being used on a system.

What you should be able to do


After completing this unit, you should be able to:
• Identify the commands can be used to monitor memory utilization
• Determine the amount of memory in use on the system
• Introduce the svmon command which provides a more in-depth
analysis of memory usage
• Explain the relationship between svmon output and ipcs output
• Identify memory leaks

How you will check your progress


• Checkpoint questions
• Machine exercises

References
SC23-5253 AIX Performance Management
SG24-6478 AIX Practical Performance Tools and Tuning Guide, an
IBM Redbooks document
SG24-7910 IBM AIX Version 7.1 Differences Guide, an IBM
Redbooks document
AIX Version 7.1 Performance management
http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ib
m.aix.prftungd/doc/prftungd/prftungd_pdf.pdf
Performance Monitoring Tips and Techniques
http://www.ibm.com/developerworks/wikis/display/Wiki

© Copyright IBM Corp. 2012 Unit 4. Monitoring Memory Utilization 4-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Course Quick View with Full TOC

Ptype/Performance+Monitoring+Tips+and+Technique
s
Other Performance Tools
http://www.ibm.com/developerworks/wikis/display/Wiki
Ptype/Other+Performance+Tools

4-2 AIX Internals II © Copyright IBM Corp. 2012


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V7.0
Course Quick View with Full TOC

Uempty Unit 5. Memory Virtualization

What this unit is about


This unit describes the Advanced Memory Sharing (AMS) and Active
Memory Expansion (AME) memory virtualization features of the
PowerVM environment. For each feature, the unit explains the major
components, terminology, and architecture of the implementation,
along with the concepts involved in implementation and monitoring.

What you should be able to do


After completing this unit, you should be able to:
• List the reasons for using memory virtualization
• Describe the components and terminology of the Active Memory
Sharing (AMS) implementation
• Explain how to monitor an AIX partition configured for AMS
• Describe the components and terminology of the Active Memory
Expansion (AME) implementation
• Explain how to monitor an AIX partition configured for AME

How you will check your progress


• Checkpoint questions

References
The following IBM Redbooks publications are available from
http://www.redbooks.ibm.com
REDP-4470 IBM PowerVM Virtualization Active Memory Sharing
REDP-4827 Power Systems Memory Deduplication
SG24-7590 IBM PowerVM Virtualization Managing and Monitoring
Active Memory Expansion: Overview and Usage Guide
ftp://ftp.software.ibm.com/common/ssi/sa/wh/n/pow03
037usen/POW03037USEN.PDF

© Copyright IBM Corp. 2012 Unit 5. Memory Virtualization 5-1


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

Vous aimerez peut-être aussi