Linux Kernel Module Programming

Total Page:16

File Type:pdf, Size:1020Kb

Linux Kernel Module Programming Linux Kernel Module Programming Amir H. Payberah [email protected] Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 1 / 46 Introduction Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 2 / 46 I They extend the functionality of the kernel without the need to reboot the system. I One type of module is the device driver. What Is A Kernel Module? I Pieces of code that can be loaded and unloaded into the kernel upon demand. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 3 / 46 I One type of module is the device driver. What Is A Kernel Module? I Pieces of code that can be loaded and unloaded into the kernel upon demand. I They extend the functionality of the kernel without the need to reboot the system. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 3 / 46 What Is A Kernel Module? I Pieces of code that can be loaded and unloaded into the kernel upon demand. I They extend the functionality of the kernel without the need to reboot the system. I One type of module is the device driver. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 3 / 46 Already Loaded Modules I You can see already loaded modules into kernel: lsmod I It gets its information by reading the file /proc/modules. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 4 / 46 I modprobe looks file /lib/modules/<version>/modules.dep. • Contains module dependencies • Created by depmod -a How Do Modules Get Into The Kernel? (1/2) I When the kernel needs a feature that is not resident in the kernel: I The kernel module daemon kmod execs modprobe to load the mod- ule in. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 5 / 46 How Do Modules Get Into The Kernel? (1/2) I When the kernel needs a feature that is not resident in the kernel: I The kernel module daemon kmod execs modprobe to load the mod- ule in. I modprobe looks file /lib/modules/<version>/modules.dep. • Contains module dependencies • Created by depmod -a Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 5 / 46 I insmod is dumb about the location of modules, whereas modprobe is aware of the default location of modules. I modprobe also knows how to figure out the dependencies and load the modules in the right order. How Do Modules Get Into The Kernel? (2/2) I modprobe uses insmod to load any prerequisite modules and the requested module into the kernel. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 6 / 46 I modprobe also knows how to figure out the dependencies and load the modules in the right order. How Do Modules Get Into The Kernel? (2/2) I modprobe uses insmod to load any prerequisite modules and the requested module into the kernel. I insmod is dumb about the location of modules, whereas modprobe is aware of the default location of modules. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 6 / 46 How Do Modules Get Into The Kernel? (2/2) I modprobe uses insmod to load any prerequisite modules and the requested module into the kernel. I insmod is dumb about the location of modules, whereas modprobe is aware of the default location of modules. I modprobe also knows how to figure out the dependencies and load the modules in the right order. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 6 / 46 I modprobe just takes the name, without any extension, and figures out all it needs to know. I For example: insmod /lib/modules/2.6.11/kernel/fs/fat/fat.ko insmod /lib/modules/2.6.11/kernel/fs/msdos/msdos.ko modprobe msdos insmod vs. modprobe I insmod requires you to pass it the full pathname and to insert the modules in the right order. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 7 / 46 I For example: insmod /lib/modules/2.6.11/kernel/fs/fat/fat.ko insmod /lib/modules/2.6.11/kernel/fs/msdos/msdos.ko modprobe msdos insmod vs. modprobe I insmod requires you to pass it the full pathname and to insert the modules in the right order. I modprobe just takes the name, without any extension, and figures out all it needs to know. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 7 / 46 insmod vs. modprobe I insmod requires you to pass it the full pathname and to insert the modules in the right order. I modprobe just takes the name, without any extension, and figures out all it needs to know. I For example: insmod /lib/modules/2.6.11/kernel/fs/fat/fat.ko insmod /lib/modules/2.6.11/kernel/fs/msdos/msdos.ko modprobe msdos Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 7 / 46 Hello World Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 8 / 46 Hello World #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_INFO */ int init_module(void){ printk(KERN_INFO "Hello world!\n"); // A non 0 return means init_module failed; module can't be loaded. return0; } void cleanup_module(void){ printk(KERN_INFO "Goodbye world!.\n"); } Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 9 / 46 I init module(): it is called when the module is insmoded into the kernel. • It registers a handler for something with the kernel. • or it replaces one of the kernel functions with its own code. I cleanup module(): it is called just before it is rmmoded. • It undos whatever init module() did, so the module can be unloaded safely Hello World Structure (1/2) I Two main functions of kernel modules: initialization and cleanup. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 10 / 46 I cleanup module(): it is called just before it is rmmoded. • It undos whatever init module() did, so the module can be unloaded safely Hello World Structure (1/2) I Two main functions of kernel modules: initialization and cleanup. I init module(): it is called when the module is insmoded into the kernel. • It registers a handler for something with the kernel. • or it replaces one of the kernel functions with its own code. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 10 / 46 Hello World Structure (1/2) I Two main functions of kernel modules: initialization and cleanup. I init module(): it is called when the module is insmoded into the kernel. • It registers a handler for something with the kernel. • or it replaces one of the kernel functions with its own code. I cleanup module(): it is called just before it is rmmoded. • It undos whatever init module() did, so the module can be unloaded safely Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 10 / 46 Hello World Structure (2/2) I Every kernel module needs linux/module.h. I It needs linux/kernel.h only for the macro expansion for the printk() log level, e.g., KERN INFO. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 11 / 46 I Each printk() statement comes with a priority. • Eight priority levels I Prints out the message in the kernel ring buffer. • Use dmesg to print the kernel ring buffer. I The message is appended to /var/log/messages, if syslogd is running. Introducing printk() I Logging mechanism for the kernel. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 12 / 46 I Prints out the message in the kernel ring buffer. • Use dmesg to print the kernel ring buffer. I The message is appended to /var/log/messages, if syslogd is running. Introducing printk() I Logging mechanism for the kernel. I Each printk() statement comes with a priority. • Eight priority levels Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 12 / 46 I The message is appended to /var/log/messages, if syslogd is running. Introducing printk() I Logging mechanism for the kernel. I Each printk() statement comes with a priority. • Eight priority levels I Prints out the message in the kernel ring buffer. • Use dmesg to print the kernel ring buffer. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 12 / 46 Introducing printk() I Logging mechanism for the kernel. I Each printk() statement comes with a priority. • Eight priority levels I Prints out the message in the kernel ring buffer. • Use dmesg to print the kernel ring buffer. I The message is appended to /var/log/messages, if syslogd is running. Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 12 / 46 I To compile and insert the module in the kernel: # to compile the module > make # to insert the module in the kernel > sudo insmod hello.ko # to see the module message > dmesg # to remove the module from the kernel > sudo insmod hello.ko Compiling Kernel Modules I A simple Makefile for compiling a module named hello.c. obj-m += hello.o all: make -C /lib/modules/$(shell uname -r)/buildM=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/buildM=$(PWD) clean Amir H. Payberah (Tehran Polytechnic) Linux Module Programming 1393/9/17 13 / 46 Compiling Kernel Modules I A simple Makefile for compiling a module named hello.c. obj-m += hello.o all: make -C /lib/modules/$(shell uname -r)/buildM=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/buildM=$(PWD) clean I To compile and insert the module in the kernel: # to compile the module > make # to insert the module in the kernel > sudo insmod hello.ko # to see the module message > dmesg # to remove the module from the kernel > sudo insmod hello.ko Amir H.
Recommended publications
  • The Linux Kernel Module Programming Guide
    The Linux Kernel Module Programming Guide Peter Jay Salzman Michael Burian Ori Pomerantz Copyright © 2001 Peter Jay Salzman 2007−05−18 ver 2.6.4 The Linux Kernel Module Programming Guide is a free book; you may reproduce and/or modify it under the terms of the Open Software License, version 1.1. You can obtain a copy of this license at http://opensource.org/licenses/osl.php. This book is distributed in the hope it will be useful, but without any warranty, without even the implied warranty of merchantability or fitness for a particular purpose. The author encourages wide distribution of this book for personal or commercial use, provided the above copyright notice remains intact and the method adheres to the provisions of the Open Software License. In summary, you may copy and distribute this book free of charge or for a profit. No explicit permission is required from the author for reproduction of this book in any medium, physical or electronic. Derivative works and translations of this document must be placed under the Open Software License, and the original copyright notice must remain intact. If you have contributed new material to this book, you must make the material and source code available for your revisions. Please make revisions and updates available directly to the document maintainer, Peter Jay Salzman <[email protected]>. This will allow for the merging of updates and provide consistent revisions to the Linux community. If you publish or distribute this book commercially, donations, royalties, and/or printed copies are greatly appreciated by the author and the Linux Documentation Project (LDP).
    [Show full text]
  • Absolute BSD—The Ultimate Guide to Freebsd Table of Contents Absolute BSD—The Ultimate Guide to Freebsd
    Absolute BSD—The Ultimate Guide to FreeBSD Table of Contents Absolute BSD—The Ultimate Guide to FreeBSD............................................................................1 Dedication..........................................................................................................................................3 Foreword............................................................................................................................................4 Introduction........................................................................................................................................5 What Is FreeBSD?...................................................................................................................5 How Did FreeBSD Get Here?..................................................................................................5 The BSD License: BSD Goes Public.......................................................................................6 The Birth of Modern FreeBSD.................................................................................................6 FreeBSD Development............................................................................................................7 Committers.........................................................................................................................7 Contributors........................................................................................................................8 Users..................................................................................................................................8
    [Show full text]
  • Daemon Threads
    Daemon threads Your operating system has various threads that provide services to user threads. That’s their sole purpose: to serve user threads. The term originated with the Unix operating system, but most operating systems have them in one form or another, with slightly differing properties. Examples are: • In Unix, crond is job scheduler, running jobs in the background. Line printer daemon lpd manages printer spooling. • In Windows systems, daemons are called Windows services. One such is Prefetch-and-Superfetch, which caches frequently used files and other components to RAM. The DNS Client resolves domain names to IP addresses. • In Java, the garbage collector is a daemon, continuously finding objects that cannot be reached from the Java program and putting the memory they occupy on a “free list” so the memory can be used for some other purpose. We won’t be writing Java programs that use daemon threads. (Look at the next page for a realistic use of a daemon thread.) Nevertheless, a basic understanding of daemons, including where the word came from, is useful. The basic property of a Java daemon thread In Java, suppose your main-program thread is named t. Suppose t creates and starts threads t1, t2, and t3. Suppose also that it has made t3 a daemon (we show how to do this later). Here is the basic difference be- tween t3 and the other threads: When thread t, t1, and t2 die (i.e. complete method run()), daemon thread t3 is killed. Thus, as long as one normal thread is alive, daemon threads stay alive.
    [Show full text]
  • Mengenal Sistim Operasi *BSD
    Mengenal Sistim Operasi *BSD Ada banyak sekali tulisan-tulisan yang membahas tentang BSD, baik tulisan mengenai sejarah, system administrasi, sampai penggunaan BSD kepada end-user sebagai desktop. Tulisan ini memperkenalkan BSD sebagai alternatif lain dari Linux untuk memenuhi kebutuhan akan UNIX-like operating system di Indonesia. Dalam tulisan ini pula, dibahas mengenai beberapa hal yang membedakan antara Linux dan BSD, namun tidak memutuskan mana yang paling baik, karena untuk menentukan mana operating system yang paling baik digunakan adalah Anda sendiri. Daftar Isi 1. Sejarah 2. Distribusi Varian BSD 3. Model Pengembangan 4. Integrasi System 5. Software-software di BSD 6. System Administrasi 7. File System 8. Lain-lain 9. Kesimpulan Sejarah Hampir semua orang telah mendengar Linux saat ini. Namun apa itu BSD? BSD adalah singkatan dari Berkeley Software Distribution. BSD pertama kali dibangun dan dikembangkan oleh Computer System Research Group (CSRG) di University of California at Berkeley (UCB), BSD pertama kali keluar pada akhir 1977 sebagai paket tambahan dan patch dari AT&T UNIX version 6, yang mana waktu itu beroperasi pada mesin PDP-11 minicomputer. BSD pada akhirnya banyak memberikan kontribusi berharga pada pengembangan UNIX secara umum. Ada banyak fitur yang pertama kali diperkenalkan oleh BSD dan beberapa diadopsi dari AT&T dan vendor-vendor lainnya. BSD dibuat, dikembangkan, dan digunakan secara BEBAS sebagai perlawanan terhadap lisensi UNIX yang dimiliki oleh AT&T dan oleh karena itu BSD mempunyai lisensi tersendiri yang memungkinkan setiap orang bebas melakukan pengembangan, dan menggunakan source code BSD. Pada tahun 1993, 4.4BSD dirilis sebagai sebuah Operating System yang utuh. Untuk sejarah lengkap BSD di CSRG, mulai sejarah dari jaman kuda, motivasi orang-orang yang pertama kali mengerjakannya, sampai perseteruan lisensi dan hak cipta dengan AT&T, saya mereferensikan Anda untuk membaca tulisan yang dibuat oleh Kirk McKusick, “Twenty Years of Berkeley Unix“.
    [Show full text]
  • Understanding the Linux Kernel, 3Rd Edition by Daniel P
    1 Understanding the Linux Kernel, 3rd Edition By Daniel P. Bovet, Marco Cesati ............................................... Publisher: O'Reilly Pub Date: November 2005 ISBN: 0-596-00565-2 Pages: 942 Table of Contents | Index In order to thoroughly understand what makes Linux tick and why it works so well on a wide variety of systems, you need to delve deep into the heart of the kernel. The kernel handles all interactions between the CPU and the external world, and determines which programs will share processor time, in what order. It manages limited memory so well that hundreds of processes can share the system efficiently, and expertly organizes data transfers so that the CPU isn't kept waiting any longer than necessary for the relatively slow disks. The third edition of Understanding the Linux Kernel takes you on a guided tour of the most significant data structures, algorithms, and programming tricks used in the kernel. Probing beyond superficial features, the authors offer valuable insights to people who want to know how things really work inside their machine. Important Intel-specific features are discussed. Relevant segments of code are dissected line by line. But the book covers more than just the functioning of the code; it explains the theoretical underpinnings of why Linux does things the way it does. This edition of the book covers Version 2.6, which has seen significant changes to nearly every kernel subsystem, particularly in the areas of memory management and block devices. The book focuses on the following topics: • Memory management, including file buffering, process swapping, and Direct memory Access (DMA) • The Virtual Filesystem layer and the Second and Third Extended Filesystems • Process creation and scheduling • Signals, interrupts, and the essential interfaces to device drivers • Timing • Synchronization within the kernel • Interprocess Communication (IPC) • Program execution Understanding the Linux Kernel will acquaint you with all the inner workings of Linux, but it's more than just an academic exercise.
    [Show full text]
  • Daemon Management Under Systemd ZBIGNIEWSYSADMIN JĘDRZEJEWSKI-SZMEK and JÓHANN B
    Daemon Management Under Systemd ZBIGNIEWSYSADMIN JĘDRZEJEWSKI-SZMEK AND JÓHANN B. GUÐMUNDSSON Zbigniew Jędrzejewski-Szmek he systemd project is the basic user-space building block used to works in a mixed experimental- construct a modern Linux OS. The main daemon, systemd, is the first computational neuroscience lab process started by the kernel, and it brings up the system and acts as and writes stochastic simulators T and programs for the analysis a service manager. This article shows how to start a daemon under systemd, of experimental data. In his free time he works describes the supervision and management capabilities that systemd pro- on systemd and the Fedora Linux distribution. vides, and shows how they can be applied to turn a simple application into [email protected] a robust and secure daemon. It is a common misconception that systemd is somehow limited to desktop distributions. This is hardly true; similarly to Jóhann B. Guðmundsson, the Linux kernel, systemd supports and is used on servers and desktops, but Penguin Farmer, IT Fireman, Archer, Enduro Rider, Viking- it is also in the cloud and extends all the way down to embedded devices. In Reenactor, and general general it tries to be as portable as the kernel. It is now the default on new insignificant being in an installations in Debian, Ubuntu, Fedora/RHEL/CentOS, OpenSUSE/SUSE, insignificant world, living in the middle of the Arch, Tizen, and various derivatives. North Atlantic on an erupting rock on top of the world who has done a thing or two in Systemd refers both to the system manager and to the project as a whole.
    [Show full text]
  • Intel® Command Line Interface Features and Benefits
    Intel® Command Line Interface User Guide IntelIntel®®®® CoCoCommandCo mmand Line Interface Version 3.03.03.0 Legal Information INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS FOR THE PURPOSE OF SUPPORTING INTEL DEVELOPED SERVER BOARDS AND SYSTEMS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS OTHERWISE AGREED IN WRITING BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.
    [Show full text]
  • Appendix D: Summary of Samba Daemons and Commands
    ,appd.28002 Page 359 Friday, November 19, 1999 3:31 PM Appendix D D Summary of Samba Daemons and Commands This appendix is a reference listing of command-line options and other informa- tion to help you use the executables that come with Samba distribution. Samba Distribution Programs The following sections provide information about the command-line parameters for Samba programs. smbd The smbd program provides Samba’s file and printer services, using one TCP/IP stream and one daemon per client. It is controlled from the default configuration file, samba_dir/lib/smb.conf, and can be overridden by command-line options. The configuration file is automatically re-evaluated every minute. If it has changed, most new options are immediately effective. You can force Samba to immediately reload the configuration file if you send a SIGHUP to smbd. Reloading the configu- ration file, however, will not affect any clients that are already connected. To escape this “grandfather” configuration, a client would need to disconnect and reconnect, or the server itself would have to be restarted, forcing all clients to reconnect. Other signals To shut down a smbd process, send it the termination signal SIGTERM (-15) which allows it to die gracefully instead of a SIGKILL (-9). To increment the debug log- ging level of smbd at runtime, send the program a SIGUSR1 signal. To decrement it at runtime, send the program a SIGUSR2 signal. 359 ,appd.28002 Page 360 Friday, November 19, 1999 3:31 PM 360 Appendix D: Summary of Samba Daemons and Commands Command-line options -D The smbd program is run as a daemon.
    [Show full text]
  • The Daemon's Dozen: Introducing Freebsd 12.0
    SEE TEXT ONLY By Michael W LUCAS The Daemon’s Dozen Introducing FreeBSD 12.0 We’ve all been eagerly awaiting FreeBSD 12.0 since about two hours after FreeBSD 11.0 escaped. Here I’ll take a few looks at some new features, removed features, and forthcoming changes, starting with storage. FS users are probably familiar with the beadm(8) package, the boot environment administration pro- gram. We’ve previously covered it in the FreeBSD Journal. FreeBSD now includes bectl(8), a boot envi- Zronment control program. It retains much of the beadm(8) syntax, letting you create, activate, list, and destroy boot environments. Additionally, it lets you mount unused boot environments and create jails from those boot environments. I’ve used jails to troubleshoot problematic boot environments, so this is a welcome addition to the base system. Many people have used GELI to encrypt disks. Doing hard drive encryption properly is tricky, but GELI • handily reduces the risk of exposing confidential data when your laptop gets stolen. GELI was painful to use on systems with many hard drives, though. Each disk needed to be configured separately. With FreeBSD 12.0, GELI can now configure multiple disks simultaneously so long as they use the same encryp- tion key, easing this annoyance for sysadmins who administer such machines. Also, in the GELI realm, the installer can now encrypt disks on hosts booting off of UEFI. FreeBSD’s GEOM system lets us stack storage transformations on top of one another in exactly the way you need for your application, hardware, and environment.
    [Show full text]
  • Processes and Daemons
    Summer 2009 Daemons and Other Processes Processes and Daemons + Fundamentally, kernels provide a few logical constructs that mediate access to either real or virtual resources. The two most important in Unix are processes and filesystems. + You can view the characteristics of processes on a Unix machine with a variety of programs, including ps, top, lsof, and even ls. CNT 4603 Summer 2009 Daemons and Other Processes What Unix/Linux system administrators see { ps [root@localhost root]# cat /etc/redhat-release Fedora release 8 (Werewolf) [root@localhost root]# ps -elf # This is SYSV; Berkeley = 'ps axlww' F S UID PID PPID C PRI NI TTY TIME CMD 4 S root 1 0 0 75 0 ? 00:00:08 init 4 S root 1573 1384 0 75 0 tty 00:00:00 -bash 5 S root 7492 1 0 75 0 ? 00:01:08 sendmail: accepting 1 S smmsp 7497 1 0 75 0 ? 00:00:00 sendmail: Queue run 5 S apache 25079 1321 0 75 0 ? 00:00:00 /usr/sbin/httpd 5 S apache 25080 1321 0 75 0 ? 00:00:00 /usr/sbin/httpd 5 S apache 25085 1321 0 75 0 ? 00:00:00 /usr/sbin/httpd 5 S apache 25086 1321 0 75 0 ? 00:00:00 /usr/sbin/httpd CNT 4603 Summer 2009 Daemons and Other Processes What system administrators see { ps 5 S root 13137 7492 0 76 0 ? 00:00:00 sendmail: server [10.1. 5 S root 16572 7492 0 75 0 ? 00:00:00 sendmail: k0CBPF4I01657 5 S root 18574 7492 0 75 0 ? 00:00:00 sendmail: k0CBcKUk01857 5 S root 20824 7492 0 75 0 ? 00:00:00 sendmail: k0CBs9CZ02082 5 S root 22950 7523 6 75 0 ? 00:04:14 /usr/bin/perl 5 S root 23050 7523 6 78 0 ? 00:03:58 /usr/bin/perl 5 S root 32112 1151 0 75 0 ? 00:00:00 sshd: root@pts/0 4 S root
    [Show full text]
  • Using the Linux Cpuplugd Daemon to Manage CPU and Memory Resources from Z/VM Linux Guests Figures
    Linux on System z Using the Linux cpuplugd Daemon to manageCPUandmemoryresourcesfrom z/VM Linux guests Linux on System z Using the Linux cpuplugd Daemon to manageCPUandmemoryresourcesfrom z/VM Linux guests Note Before using this information and the product it supports, read the information in “Notices” on page 63. Contents Figures ...............v Understanding the sizing charts ......22 cpuplugd configuration rules ........24 Tables ...............vii CPU plugging ............24 Memory plugging ...........27 Dynamic runs .............41 About this publication ........ix Setup tests and variations .........45 Scaling the cpuplugd update interval .....45 Chapter 1. Introduction ........1 Memory plugging and steal time ......47 Objectives ...............1 Executive summary ............2 Appendix A. Tuning scripts ......51 DB2 UDB tuning ............51 Chapter 2. Summary .........5 WebSphere tuning script ..........51 CPU plugging ..............5 Memory plugging ............7 Appendix B. cpuplugd configuration files ................53 Chapter 3. Hardware and software Recommended default configuration ......53 configuration ............11 CPU plugging via loadavg .........53 Server configuration ...........11 CPU plugging via real CPU load .......54 Client configuration ...........11 Memory plugging configuration 1 .......54 Memory plugging configuration 2 .......55 Chapter 4. Workload description....13 Memory plugging configuration 3 .......56 DayTrader ...............13 Memory plugging configuration 4 .......56 WebSphere Studio Workload
    [Show full text]
  • Linux Loadable Kernel Module HOWTO
    Linux Loadable Kernel Module HOWTO Bryan Henderson 2006−09−24 Revision History Revision v1.09 2006−09−24 Revised by: bjh Fix typos. Revision v1.08 2006−03−03 Revised by: bjh Add copyright information. Revision v1.07 2005−07−20 Revised by: bjh Add some 2.6 info and disclaimers. Update references to Linux Device Drivers book, Linux Kernel Module Programming Guide. Revision v1.06 2005−01−12 Revised by: bjh Cover Linux 2.6 briefly. Update hello.c and reference to Lkmpg. Add information about perils of unloading. Mention dmesg as way to see kernel messages. Revision v1.05 2004−01−05 Revised by: bjh Add information on module.h and −DMODULE. Fix tldb.org to tldp.org. Add information on kallsyms. Revision v1.04 2003−10−10 Revised by: bjh Fix typo: AHA154x should be AHA152x Add information on what module names the kernel module loader calls for. Add information on what an LKM does when you first load it. Add information on loop module. Change linuxdoc.org to tldp.org. Revision v1.03 2003−07−03 Revised by: bjh Update on kernels that don't load into vmalloc space. Add explanation of "deleted" state of an LKM. Explain GPLONLY. Revision v1.02 2002−05−21 Revised by: bjh Correct explanation of symbol versioning. Correct author of Linux Device Drivers. Add info about memory allocation penalty of LKM vs bound−in. Add LKM−to−LKM symbol matching requirement. Add open source licensing issue in LKM symbol resolution. Add SMP symbol versioning info. Revision v1.01 2001−08−18 Revised by: bjh Add material on various features created in the last few years: kernel module loader, ksymoops symbols, kernel−version−dependent LKM file location.
    [Show full text]