Linux 2.6.28版本内核的几个改动

Changes in Linux Kernel 2.6.28

The GEM Memory Manager for GPU memory
长期以来显存管理代码分散在Kernel, Xorg和专有驱动里,相对比较混乱。社区一直在讨论是否要加入Tungsten Graphics的TTM内存管理器。
现在加入的GEM内存管理器是由Intel的Keith Packard提出的。相对于TTM,GEM简化了设计,更加轻量级。目前只支持Intel i915驱动。

Memory management for graphics processors
http://lwn.net/Articles/257417/
GEM v. TTM
http://lwn.net/Articles/283793/
GEM – the Graphics Execution Manager
http://lwn.net/Articles/283798/

Memory management Scalability improvements
主要的改动是加入了virtual memory scalability improvement patch和VM scalability patch。主要针对大容量内存的机器(如128G)在页面换出时在LRU list搜索时间过长的问题。
前一个patch把file-backed page和anonymous page分别存放在两个LRU list上,优先对前者做换出。
VM scalability patch,只在inactive list上维护一定百分比的anonymous page。当对anonymous page回收时,只检查inactive list上匿名页的引用情况,而避免对所有的匿名页做操作。

Memory management Scalability improvements
http://lwn.net/Articles/286472/

Disk Shock Protection
ATA/ATAPI-7规范定义了IDLE IMMEDIATE命令可以切换驱动器至idle模式并复位磁头。2.6.28为每个ATA设备添加了/sys/block/*/device/unload_heads接口,
向这个接口中写一个整数值n可以复位磁头并延时所有IO操作n毫秒。当这个时间结束,再恢复IO操作。最大允许的延时值为30000毫秒。
磁盘振动保护功能需要结合accelerometers驱动和应用软件才能发挥作用。2.6.28的这个feature只是提供了操作接口。

Boot tracer
主要来自Arjan van de Ven和Frédéric Weisbecker在Linux快速启动方面的工作。去年Arjan在Linux Plumbers Conference上展示了5秒启动上网本的demo。
然而fast boot patch暂时未被Linus接纳进mainline代码树。这次2.6.28加入的Boot tracer用于性能分析,可以更方便地让开发者跟踪kernel在各部分启动所耗费的时间,以便调优。

参考

http://kernelnewbies.org/LinuxChanges

Who’s who in Graphics / Linux / Xorg area

Alan Akin

  • DRI, Redhat

Adam Jackson (ajax)

  • Redhat

Alan Coopersmith

Andy Ritger

Behdad Esfahbod

Bertram Felgenhauer

  • pixman, cairo

Brian Paul

Dave Airlie (airelied)

David Dawes

David Reveman

Eric Anholt’s (anholt)

Gareth Hughes

  • DRI, Nvidia

James Jones

  • Nvidia

Jens Owen

Keith Packard (keithp)

Kevin E. Martin

Kristian Høgsberg (krh)

Mirco Müller, (macslow)

Rik, Faith

last updated: 2008-02-04 by unicell

SuSE – KDE

How To Configure the KDE 3.3 Menu manually (without KMenuEdit)

Main file (.menu file) detailing system-wide default menu structure is /etc/xdg/menus/applications.menu
Menu directories (.directory files) are stored in /usr/share/desktop-directories/
System-wide Menu entries (.desktop files) are stored in many places.
Gnome applications: /opt/gnome/share/applications
KDE applications: /opt/kde3/share/applications/kde
or /usr/share/applications/kde
Other Applications: /usr/share/applications

K Menu Icon Size for openSUSE desktop

  • Open your favorite text editor. Edit the file located at ~/.kde/share/config/kickerrc
  • Go to the [menus] section of this file.
  • Edit (or add, if it isn’t there) the “MenuEntryHeight=” variable to be the height, in pixels, that you wish the K Menu icons to appear.
  • Save and quit.
  • Restart the KDE Panels with this command: dcop kicker Panel restart
  • SUSE Style/KickOff Menu
    http://lists.opensuse.org/opensuse/2007-04/msg01161.html

    Kernel Crash Debug

    White Paper: Red Hat Crash Utility
    http://people.redhat.com/anderson/crash_whitepaper/usage.html

    How do I configure kexec/kdump on Red Hat Enterprise Linux 5?
    http://kbase.redhat.com/faq/FAQ_105_9036.shtm

    A quick overview of Linux kernel crash dump analysis
    http://www.redhatmagazine.com/2007/08/15/a-quick-overview-of-linux-kernel-crash-dump-analysis/

    LKCD
    http://lkcd.sourceforge.net/doc/index.html

    Linux-2.6.17/Documentation/kdump/kdump.txt
    http://www.gelato.unsw.edu.au/lxr/source/Documentation/kdump/kdump.txt

    No tags for this post.

    Debian笔记(5) - User Mode Linux

    make-kpkg –append-to-version=-skas –added-patches=skas kernel_image modules_image –initrd

    /usr/sbin/chroot sid-root /usr/bin/env -i HOME=/root TERM=”$TERM=”$TERM” PS1=’\u:\w\$ ‘ PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash –login +h

    apt-get install bridge-utils uml-utilities screen

    adduser user1 uml-net
    adduser user2 uml-net
    chgrp uml-net /dev/net/tun
    chmod 660 /dev/net/tun

    apt-get install user-mode-linux

    Package: user-mode-linux
    Priority: extra
    Section: misc
    Installed-Size: 61196
    Maintainer: User Mode Linux Maintainers <[email protected]>
    Architecture: i386
    Version: 2.6.17-1um-2
    Depends: uml-utilities (>= 20040406-1)
    Suggests: x-terminal-emulator, rootstrap, user-mode-linux-doc, slirp, kernel-patch-skas
    Filename: pool/main/u/user-mode-linux/user-mode-linux_2.6.17-1um-2_i386.deb
    Size: 24933278

    mv rootfs.i686.ext2 root_fs

    sudo ~/sid-root/usr/bin/linux.uml con1=pts umid=woody
    sudo screen /dev/pts/3

    linux rootfstype=hostfs rootflags=/ rw mem=48M init=/bin/sh LD_ASSUME_KERNEL=2.4.1 quiet

    Links:

    http://www.monkeyhelper.com/2006/06/installing_user_mode_linux_on.html
    http://uml.nagafix.co.uk/
    http://tavi.debian.org.tw/UserModeLinux

    http://www.landley.net/code/UML.html

    Debian笔记(4) - 内核编译

    传入编译所需变量
    % MAKEFLAGS=”CC=gcc-3.2″ make-kpkg …

    /etc/mkinitrd/mkinitrd.conf中更改initrd使用cramfs之外的其他fs
    $Get_Root make-kpkg –revision=custom.1.0 kernel_image
    $Get_Root make-kpkg –initrd –revision=custom.1.0 kernel_image

    make-kpkg clean
    make-kpkg -rootcmd fakeroot –append-to-version -custom.${VER} \
    –revision custom.${VER} kernel_image modules-image

    To create a source or header package, run
    % make-kpkg clean
    % $Get_Root make-kpkg –revision=custom.1.0 kernel_source
    % $Get_Root make-kpkg –revision=custom.1.0 kernel_headers

    Similarly, the documentation package is built by:
    % $Get_Root make-kpkg –revision=custom.1.0 kernel_doc

    Or if you want to generate the whole package,
    % $Get_Root make-kpkg –revision=custom.1.0 \
    –pgpsign=”Your pgp ID” buildpackage
    Note that this needs a pgp key.
    (Get_Root is whatever you need to become root — fakeroot or
    sudo are examples that come to mind).
    Here is a nice, practical example:
    % make-kpkg -rfakeroot –append-to-version $(hostname) \
    –revision $(date +’%Y%m%d’)

    /etc/kernel-pkg.conf

    摘自:
    http://debian.linuxsir.org/book/reference/lyoo/ch-kernel.html
    /usr/share/doc/kernel-package/README.gz

    Debian笔记(3) - chroot环境

    main # cd / ; mkdir /sid-root
    main # debootstrap sid /sid-root http://ftp.debian.org/debian/
    … watch it download the whole system
    main # echo “proc-sid /sid-root/proc proc none 0 0” >> /etc/fstab
    main # mount proc-sid /sid-root/proc -t proc
    main # cp /etc/hosts /sid-root/etc/hosts
    main # chroot /sid-root /bin/bash
    chroot # apt-setup # set-up /etc/apt/sources.list
    chroot # vi /etc/apt/sources.list # point the source to unstable
    chroot # dselect # you may use aptitude, install mc and vim 🙂

    从sarge安装chroot环境中的sid时
    debootstrap –exclude=base-config,ipchains,libnewt0.51,libsigc++-1.2-5c102,slang1a-utf8 sid /sid-root http://debian.cn99.com/debian/
    最终在如下步骤失败,尚未找到解决方案
    I: Extracting libstdc++5…
    mount: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory
    W: Failure trying to run: chroot /home/qiuyu/sid-root mount -t proc proc /proc
    umount: /home/qiuyu/sid-root/dev/pts: not mounted
    umount: /home/qiuyu/sid-root/dev/shm: not mounted
    umount: /home/qiuyu/sid-root/proc/bus/usb: not found
    umount: /home/qiuyu/sid-root/proc: not mounted

    http://www.backports.org/更新debootstrap版本后继续
    参考:
    http://www.debianhelp.org/node/1169
    http://forums.debian.net/viewtopic.php?t=7840&sid=ce51f774b45788eb465ce71f771f1e90

    sarge安装另一个chroot环境的sarge没有问题
    可通过chroot sarge-root /usr/bin/env -i HOME=/root TERM=”$TERM” PS1=’\u:\w\$ ‘ PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash –login +h 登录消除环境变量影响

    远程登陆x桌面

    服务器上操作:
    ------------------------
    1. 修改 /etc/X11/xdm/Xaccess,将下面的行:
    #* # any host can get a login window
    改为:
    * # any host can get a login window
    ------------------------
    2. 修改/etc/X11/gdm/gdm.conf,找到下面的信息:
    [xdmcp]
    Enable=0 或Enable=false
    修改为:
    [xdmcp]
    Enable=1 或Enable=true
    并确保以下信息存在:
    Port=177
    ------------------------
    3: 修改/etc/inittab,将
    id:3:initdefault:
    修改为:
    id:5:initdefault:
    并将最后一行改为:
    x:5:respawn:/usr/bin/gdm
    -------------------------
    4: 确保/etc/X11/xdm/Xservers的属性为444,/etc/X11/xdm/Xsetup_0的属性为755。
    -------------------------

    配置SSH客户端

    对于SecureCRT,在Session Option -> X11,将Forward X11 Packets打上勾即可;
    对于PieTTY,Change Settings… -> X11,将Enable X11 forwarding打上勾,然后选择XDM-Authorization-1;

    DISPLAY=”192.168.1.100:0.0″
    export DISPLAY

    /etc/ssh/sshd_config
    添加X11Forwarding yes并重启sshd

    摘自http://blog.51766.com/page/zsc?entry=1148649782784

    http://x.cygwin.com/docs/faq/cygwin-x-faq.html#xdmcp

    Technorati : ,

    Debian下的X配置

    apt-get install discover — 硬件识别系统
    apt-get install mdetect — 鼠标自动侦测工具
    apt-get install read-edid — VESA PnP监视器硬件信息收集工具

    apt-get install x-window-system

    安装完的配置中ps2鼠标使用/dev/psaux

    重新配置XF4服务器
    # dpkg-reconfigure –priority=low xserver-common
    # dpkg-reconfigure –priority=low xserver-xfree86

    使用aptitude安装(推荐):
    gnome
    gnome-session

    Ref.
    ====
    http://debian.linuxsir.org/book/reference/lyoo/ch-tune.html#s-x

    vmware下将RH9内核升级至2.6

    虚拟机版本vmware:4.5.1 build-7568
    原内核版本Redhat 9 linux-2.4.20-8
    待升级版本linux-2.6.11.7

    下载内核linux-2.6.11.7.tar.bz2至/usr/src并解压
    ln -s linux-2.6.11.7 linux-2.6
    在/usr/src/linux/Documentation/Changes查看相应软件的版本要求

    下载并安装module-init-tools-3.1.tar.bz2
    # configure –prefix=/
    # make moveold
    # make all install
    # ./generate-modprobe.conf /etc/modprobe.conf
    下载并安装device-mapper-1.00.19-2.i386.rpm
    下载并安装lvm2-2.00.25-1.01.i386.rpm,用rpm -ivph –nodeps –force
    下载并安装mkinitrd-4.1.18-2.i386.rpm

    在/usr/src/linux-2.6下make mrproper(如果之前未编译过,此步骤可省)
    make menuconfig,选择编译的模块。
    Device Drivers
    Block devices
    Default RAM disk size 改为8192
    USB support
    UHCI HCD 选中(或OHCI,EHCI单独无法工作)
    其余模块根据实际情况选择
    make all
    make modules_install
    make install
    /etc/modprobe.conf中相应部分更改为
    alias usbfs usbcore
    alias usb-controller uhci-hcd
    鼠标键盘部分(hid, mousedev, keybdev)等部分酌情修改
    /etc/rc.sysinit中
    usbdevfs改为usbfs
    hid改为usbhid
    mousedev和keybdev酌情修改(分别改为usbmouse和usbkeybd或注释掉)
    /etc/grub.conf中
    更改default
    2.6内核部分加一句elevator=deadline
    reboot

    学习总结
    openssl+openssh的设置,配合PuTTY的使用
    /etc/inetd.conf增加ssh stream tcp nowait root /usr/sbin/tcpd sshd -i
    密钥对的生成ssh-keygen(Linux/Win)
    公钥拷贝至~/.ssh/authorized_keys,密钥在客户端使用
    grep -rnH “pattern” *
    find ./ -name ‘*name*’ -print
    vim
    set foldmethod=indent
    zf%; zi; zo; zO; .,$ d
    dmesg
    cat /proc/version
    insmod; lsmod; modprobe -l | grep usb
    useradd -s /bin/bash -g lfs -m -k /dev/null lfs

    cat > ~/.bash_profile << “EOF”
    exec env -i HOME=$HOME TERM=$TERM PS1=’u:w$ ‘ /bin/bash
    EOF

    cat > ~/.bashrc << “EOF”
    set +h
    umask 022
    LFS=/mnt/lfs
    LC_ALL=POSIX
    PATH=/tools/bin:/bin:/usr/bin
    export LFS LC_ALL PATH
    EOF

    readelf -l filename | grep interpreter
    ld –verbose | grep SEARCH