Linux Kernel Conference 2004 Linux - / - info@devdrv.co.jp 2004/10/14 Device Drivers Limited 1
Device Drivers Limited 2
IF Device Drivers Limited 3
Linux Device Drivers Limited 4
2.6 2.6 2.6 Device Drivers Limited 5
(1) UP (Uni Processor) SMP (Symmetric Multi Processor) ASMP (Asymmetric Multiple Processor) SMT (Simultaneous Multi-Threading) Intel Hyper-Threading CMP (Chip Multi Processor) VLIW (Very Long Instruction Word) Device Drivers Limited 6
(2) UMA (uniformed memory access) NUMA (non- uniformed memory access) NORMA (no-remote memory access) shared nothing, cluster, grid computer memory cpu1 cpu2 memory cpu3 cpu4 cpu5 cpu6 memory cpu7 cpu8 memory Device Drivers Limited 7
CPU UP CMP!? VLIW Transmeta vs. Intel ia64 Device Drivers Limited 8
NUMA SMP SMT/HT CMP UP Device Drivers Limited 9
UP uop VLIW OS Device Drivers Limited 10
SATA PCI-Express 802.11x UWB (wireless USB) IO, Storage HotPlug PowerManagement Device Drivers Limited 11
2.6 2.6 2.6 Device Drivers Limited 12
2.6 2.6 CPU NUMA, O(1), IO IO uclinux, SELINUX, oprofiler, Device Drivers Limited 13
2.6 (2) 2.6 Linux Linux Device Drivers Limited 14
HZ(jiffies) jiffies 64bit USB,, IPV6, SYSFS VLM/dm, IPV6, Device Drivers Limited 15
HZ(Jiffies) HZ=100 1000: jiffies : 10ms 1ms CPU 2.4 LKML 2.6 Device Drivers Limited 16
sysfs procfs sysfs 2.6 Device Drivers Limited 17
2.6 CPU Device Drivers Limited 18
Linux Device Drivers Limited 19
2.6 2.6 sysfs / kobject / libsysfs / udev IO 2.6 Device Drivers Limited 20
2.6 *.o *.ko module_init_tools implementation problems initialization problems removal problems Device Drivers Limited 21
# Makefile(1) TARGET:= hello.ko all: ${TARGET} hello.ko: hello.c clean: make -C /usr/src/linux-`uname -r` M=`pwd` V=1 modules make -C /usr/src/linux-`uname -r` M=`pwd` V=1 clean obj-m:= hello.o KBUILD_VERBOSE 0 clean-files := *.o *.ko *.mod.[co] *~ make Device Drivers Limited 22
# Makefile(2) TARGET:= hello.ko all: ${TARGET} hello.ko: hello1.c hello2.c clean: make -C /usr/src/linux-`uname -r` M=`pwd` V=1 modules make -C /usr/src/linux-`uname -r` M=`pwd` V=1 clean obj-m:= hello.o hello-objs := hello1.o hello2.o clean-files := *.o *.ko *.mod.[co] *~ : Documentation/kbuild/*.txt hello.ko Device Drivers Limited 23
2.6 2.6 sysfs / kobject / libsysfs / udev IO Device Drivers Limited 24
tasklet task_queue SpinLock Atomic (SMP) HyperThreading(HT) Device Drivers Limited 25
A A B B C C D D Device Drivers Limited 26
2.6 softirq tasklet workqueue(schedule_task) task_queue 2.5 Device Drivers Limited 27
: tasklet softirq( (softirq) (SpinLock atomic Device Drivers Limited 28
workqueue : workqueue workqueue workqueue AIO, BlockIO, GPL Device Drivers Limited 29
: SpinLock CPU0 while (lock!= 0); lock=1; Critical Section lock=0; CPU1 while (lock!= 0); lock=1; Critical Section lock=0; Device Drivers Limited 30
SpinLock SpinLock 2.4 Intel HT HT while (lock!= 0) while (lock!= 0) while (lock!= 0) ; asm( PAUSE ); if (condition) schedule(); Device Drivers Limited 31
SpinLock Hyper Threading SpinLock Test and Set HyperThreading HT monior/mwait Device Drivers Limited 32
: Atomic CPU (Lock ) Atomic SMP UP SpinLock 2.6 SpinLock Device Drivers Limited 33
Atomic Atomic Atomic 0 True(1) Linux Device Drivers Limited 34
Atomic atomic_set atomic_read atomic_add atomic_sub atomic_inc atomic_dec Atomic 3 atomic_inc_and_test +1 atomic_dec_and_test -1 atomic_add_and_test atomic_sub_and_test atomic_test_and_inc atomic_test_and_dec! test_and_set_bit test_and_clear_bit Device Drivers Limited 35
SpinLock Atomic SpinLock Atomic Atomic SpinUnLock Device Drivers Limited 36
Device Drivers Limited 37
(2) # ps ax Device Drivers Limited 38
IO Hardware Hardware Hardware Hardware Device Drivers Limited 39
FIFO IO Device Drivers Limited 40
2.6 2.6 sysfs / kobject / libsysfs / udev IO Device Drivers Limited 41
sysfs sysfs / kobject / udev / libsysfs kobject sysfs udev devfs libsysfs sysfs udev Device Drivers Limited 42
IO IO elevator = as(anticipatory) ( ) elevator = deadline IO IO elevator = cfq (Complete Fair Queuing disk I/O scheduler ) elevator = noop IO Device Drivers Limited 43
before SpinLock Atomic lock asm() Device Drivers Limited 44
Linux Device Drivers Limited 45
http://www.devdrv.co.jp/download/lkc/ Device Drivers Limited 46
Linux Device Drivers Limited 47
2.7 Linus 2.7 2.6 ( 2.6 2.4 CMP Hack Device Drivers Limited 48
Device Drivers Limited 49