proc.txt
来自「Linux Kernel 2.6.9 for OMAP1710」· 文本 代码 · 共 1,564 行 · 第 1/5 页
TXT
1,564 行
> echo 1 > /proc/irq/prof_cpu_maskThis means that only the first CPU will handle the IRQ, but you can also echo 5wich means that only the first and fourth CPU can handle the IRQ.The way IRQs are routed is handled by the IO-APIC, and it's Round Robinbetween all the CPUs which are allowed to handle it. As usual the kernel hasmore info than you and does a better job than you, so the defaults are thebest choice for almost everyone.There are three more important subdirectories in /proc: net, scsi, and sys.The general rule is that the contents, or even the existence of thesedirectories, depend on your kernel configuration. If SCSI is not enabled, thedirectory scsi may not exist. The same is true with the net, which is thereonly when networking support is present in the running kernel.The slabinfo file gives information about memory usage at the slab level.Linux uses slab pools for memory management above page level in version 2.2.Commonly used objects have their own slab pool (such as network buffers,directory cache, and so on)...............................................................................> cat /proc/buddyinfoNode 0, zone DMA 0 4 5 4 4 3 ...Node 0, zone Normal 1 0 0 1 101 8 ...Node 0, zone HighMem 2 0 0 1 1 0 ...Memory fragmentation is a problem under some workloads, and buddyinfo is a useful tool for helping diagnose these problems. Buddyinfo will give you a clue as to how big an area you can safely allocate, or why a previousallocation failed.Each column represents the number of pages of a certain order which are available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE available in ZONE_NORMAL, etc... 1.3 IDE devices in /proc/ide----------------------------The subdirectory /proc/ide contains information about all IDE devices of whichthe kernel is aware. There is one subdirectory for each IDE controller, thefile drivers and a link for each IDE device, pointing to the device directoryin the controller specific subtree.The file drivers contains general information about the drivers used for theIDE devices: > cat /proc/ide/drivers ide-cdrom version 4.53 ide-disk version 1.08 ..............................................................................meminfo:Provides information about distribution and utilization of memory. Thisvaries by architecture and compile options. The following is from a16GB PIII, which has highmem enabled. You may not have all of these fields.> cat /proc/meminfoMemTotal: 16344972 kBMemFree: 13634064 kBBuffers: 3656 kBCached: 1195708 kBSwapCached: 0 kBActive: 891636 kBInactive: 1077224 kBHighTotal: 15597528 kBHighFree: 13629632 kBLowTotal: 747444 kBLowFree: 4432 kBSwapTotal: 0 kBSwapFree: 0 kBDirty: 968 kBWriteback: 0 kBMapped: 280372 kBSlab: 684068 kBCommitted_AS: 1576424 kBPageTables: 24448 kBReverseMaps: 1080904VmallocTotal: 112216 kBVmallocUsed: 428 kBVmallocChunk: 111088 kB MemTotal: Total usable ram (i.e. physical ram minus a few reserved bits and the kernel binary code) MemFree: The sum of LowFree+HighFree Buffers: Relatively temporary storage for raw disk blocks shouldn't get tremendously large (20MB or so) Cached: in-memory cache for files read from the disk (the pagecache). Doesn't include SwapCached SwapCached: Memory that once was swapped out, is swapped back in but still also is in the swapfile (if memory is needed it doesn't need to be swapped out AGAIN because it is already in the swapfile. This saves I/O) Active: Memory that has been used more recently and usually not reclaimed unless absolutely necessary. Inactive: Memory which has been less recently used. It is more eligible to be reclaimed for other purposes HighTotal: HighFree: Highmem is all memory above ~860MB of physical memory Highmem areas are for use by userspace programs, or for the pagecache. The kernel must use tricks to access this memory, making it slower to access than lowmem. LowTotal: LowFree: Lowmem is memory which can be used for everything that highmem can be used for, but it is also availble for the kernel's use for its own data structures. Among many other things, it is where everything from the Slab is allocated. Bad things happen when you're out of lowmem. SwapTotal: total amount of swap space available SwapFree: Memory which has been evicted from RAM, and is temporarily on the disk Dirty: Memory which is waiting to get written back to the disk Writeback: Memory which is actively being written back to the disk Mapped: files which have been mmaped, such as libraries Slab: in-kernel data structures cacheCommitted_AS: An estimate of how much RAM you would need to make a 99.99% guarantee that there never is OOM (out of memory) for this workload. Normally the kernel will overcommit memory. That means, say you do a 1GB malloc, nothing happens, really. Only when you start USING that malloc memory you will get real memory on demand, and just as much as you use. So you sort of take a mortgage and hope the bank doesn't go bust. Other cases might include when you mmap a file that's shared only when you write to it and you get a private copy of that data. While it normally is shared between processes. The Committed_AS is a guesstimate of how much RAM/swap you would need worst-case. PageTables: amount of memory dedicated to the lowest level of page tables. ReverseMaps: number of reverse mappings performedVmallocTotal: total size of vmalloc memory area VmallocUsed: amount of vmalloc area which is usedVmallocChunk: largest contigious block of vmalloc area which is freeMore detailed information can be found in the controller specificsubdirectories. These are named ide0, ide1 and so on. Each of thesedirectories contains the files shown in table 1-4.Table 1-4: IDE controller info in /proc/ide/ide? .............................................................................. File Content channel IDE channel (0 or 1) config Configuration (only for PCI/IDE bridge) mate Mate name model Type/Chipset of IDE controller ..............................................................................Each device connected to a controller has a separate subdirectory in thecontrollers directory. The files listed in table 1-5 are contained in thesedirectories.Table 1-5: IDE device information .............................................................................. File Content cache The cache capacity Capacity of the medium (in 512Byte blocks) driver driver and version geometry physical and logical geometry identify device identify block media media type model device identifier settings device setup smart_thresholds IDE disk management thresholds smart_values IDE disk management values ..............................................................................The most interesting file is settings. This file contains a nice overview ofthe drive parameters: # cat /proc/ide/ide0/hda/settings name value min max mode ---- ----- --- --- ---- bios_cyl 526 0 65535 rw bios_head 255 0 255 rw bios_sect 63 0 63 rw breada_readahead 4 0 127 rw bswap 0 0 1 r file_readahead 72 0 2097151 rw io_32bit 0 0 3 rw keepsettings 0 0 1 rw max_kb_per_request 122 1 127 rw multcount 0 0 8 rw nice1 1 0 1 rw nowerr 0 0 1 rw pio_mode write-only 0 255 w slow 0 0 1 rw unmaskirq 0 0 1 rw using_dma 0 0 1 rw 1.4 Networking info in /proc/net--------------------------------The subdirectory /proc/net follows the usual pattern. Table 1-6 shows theadditional values you get for IP version 6 if you configure the kernel tosupport this. Table 1-7 lists the files and their meaning.Table 1-6: IPv6 info in /proc/net .............................................................................. File Content udp6 UDP sockets (IPv6) tcp6 TCP sockets (IPv6) raw6 Raw device statistics (IPv6) igmp6 IP multicast addresses, which this host joined (IPv6) if_inet6 List of IPv6 interface addresses ipv6_route Kernel routing table for IPv6 rt6_stats Global IPv6 routing tables statistics sockstat6 Socket statistics (IPv6) snmp6 Snmp data (IPv6) ..............................................................................Table 1-7: Network info in /proc/net .............................................................................. File Content arp Kernel ARP table dev network devices with statistics dev_mcast the Layer2 multicast groups a device is listening too (interface index, label, number of references, number of bound addresses). dev_stat network device status ip_fwchains Firewall chain linkage ip_fwnames Firewall chain names ip_masq Directory containing the masquerading tables ip_masquerade Major masquerading table netstat Network statistics raw raw device statistics route Kernel routing table rpc Directory containing rpc info rt_cache Routing cache snmp SNMP data sockstat Socket statistics tcp TCP sockets tr_rif Token ring RIF routing table udp UDP sockets unix UNIX domain sockets wireless Wireless interface data (Wavelan etc) igmp IP multicast addresses, which this host joined psched Global packet scheduler parameters. netlink List of PF_NETLINK sockets ip_mr_vifs List of multicast virtual interfaces ip_mr_cache List of multicast routing cache ..............................................................................You can use this information to see which network devices are available inyour system and how much traffic was routed over those devices: > cat /proc/net/dev Inter-|Receive |[... face |bytes packets errs drop fifo frame compressed multicast|[... lo: 908188 5596 0 0 0 0 0 0 [... ppp0:15475140 20721 410 0 0 410 0 0 [... eth0: 614530 7085 0 0 0 0 0 1 [... ...] Transmit ...] bytes packets errs drop fifo colls carrier compressed ...] 908188 5596 0 0 0 0 0 0 ...] 1375103 17405 0 0 0 0 0 0 ...] 1703981 5535 0 0 0 3 0 0 In addition, each Channel Bond interface has it's own directory. Forexample, the bond0 device will have a directory called /proc/net/bond0/.It will contain information that is specific to that bond, such as thecurrent slaves of the bond, the link status of the slaves, and howmany times the slaves link has failed.1.5 SCSI info-------------If you have a SCSI host adapter in your system, you'll find a subdirectorynamed after the driver for this adapter in /proc/scsi. You'll also see a listof all recognized SCSI devices in /proc/scsi: >cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: IBM Model: DGHS09U Rev: 03E0 Type: Direct-Access ANSI SCSI revision: 03 Host: scsi0 Channel: 00 Id: 06 Lun: 00 Vendor: PIONEER Model: CD-ROM DR-U06S Rev: 1.04 Type: CD-ROM ANSI SCSI revision: 02 The directory named after the driver has one file for each adapter found inthe system. These files contain information about the controller, includingthe used IRQ and the IO address range. The amount of information shown isdependent on the adapter you use. The example shows the output for an AdaptecAHA-2940 SCSI adapter: > cat /proc/scsi/aic7xxx/0 Adaptec AIC7xxx driver version: 5.1.19/3.2.4 Compile Options: TCQ Enabled By Default : Disabled AIC7XXX_PROC_STATS : Disabled AIC7XXX_RESET_DELAY : 5 Adapter Configuration: SCSI Adapter: Adaptec AHA-294X Ultra SCSI host adapter Ultra Wide Controller PCI MMAPed I/O Base: 0xeb001000 Adapter SEEPROM Config: SEEPROM found and used.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?