Suppose that your processor has 4MB data cache and its block size is 64B. Physic
ID: 3695797 • Letter: S
Question
Suppose that your processor has 4MB data cache and its block size is 64B. Physical address to access the memory is 50-bit wide (addr[49:0]). For each of the following cache structures, calculate TAG size and inted size.
(a) A direct-mapped cache implementation
(b) A 4-Way set associative cache implementation
(c) A fully associative cache implementation
Explanation / Answer
AIX: bootinfo -r lsattr -E -l mem0 lsattr -E -l sys0 -a realmem svmon -G vmstat -v vmo -L lparstat -i or use a tool as "topas" or "nmon" (these are utilities) Linux: cat /proc/meminfo dmesg | grep "Physical" free (the free command) HP: getmem print_manifest |grep –i memory dmesg | grep -i phys echo "selclass qualifier memory;info;wait;infolog"|cstm wc -c /dev/mem or us a tool as "glance", like entering "glance -m" from prompt (is a utility) Solaris: prtconf | grep "Memory size" # total memory prtmem memps -m Tru64: vmstat -P | grep "Total Physical Memory" uerf | grep memory Swap: ----- AIX: lsps -a lsps -s pstat -s HP: swapinfo -a Solaris: swap -l prtswap -l Linux: swapon -s cat /proc/swaps cat /proc/meminfo cpu: ---- HP: ioscan -kfnC processor getconf CPU_VERSION getconf CPU_CHIP_TYPE model AIX: lparstat (-i) prtconf | grep proc pmcycles -m lsattr -El procx (x is 0,2, etc..) lscfg | grep proc pstat -S mpstat Linux: cat /proc/cpuinfo Solaris: psrinfo -v prtconf psrset -p prtdiag OS version: ----------- HP: uname -a Linux: cat /proc/version Solaris: uname -a cat /etc/release (or other way to view that file, like "more /etc/release") Tru64: /usr/sbin/sizer -v AIX: oslevel -r (only high-level version) oslevel -s (shows Version, SP, TL level) oslevel -qs (shows complete history) lslpp -h bos.rte AIX Example: # oslevel -s 5300-08-03-0831 # oslevel -qs Known Service Packs ------------------- 5300-08-03-0831 5300-08-02-0822 5300-08-01-0819 5300-08-00-0000 5300-07-05-0831 5300-07-04-0818 5300-07-03-0811 5300-07-02-0806 5300-07-01-0748 5300-06-08-0831 5300-06-07-0818 5300-06-06-0811 5300-06-05-0806 5300-06-04-0748 5300-06-03-0732 5300-06-02-0727 5300-06-01-0722 5300-05-CSP-0000 5300-05-06-0000 5300-05-05-0000 5300-05-04-0000 5300-05-03-0000 5300-05-02-0000 5300-05-01-0000 5300-04-CSP-0000 5300-04-03-0000 5300-04-02-0000 5300-04-01-0000 5300-03-CSP-0000 AIX firmware: lsmcode -c display the system firmware level and service processor lsmcode -r -d scraid0 display the adapter microcode levels for a RAID adapter scraid0 lsmcode -A display the microcode level for all supported devices prtconf shows many setting including memory, firmware, serial# etc.. Notes about Power 4 or 5 lpars: ------------------------------- For AIX: The uname -L command identifies a partition on a system with multiple LPARS. The LPAR id can be useful for writing shell scripts that customize system settings such as IP address or hostname. The output of the command looks like: # uname -L 1 lpar01 The output of uname -L varies by maintenance level. For consistent output across maintenance levels, add a -s flag. For illustrate, the following command assigns the partition number to the variable "lpar_number" and partiton name to "lpar_name". For HP-UX: Use commands like "parstatus" or "getconf PARTITION_IDENT" to get npar information. patches: -------- AIX: Is a certain fix (APAR) installed? instfix -ik APAR_number instfix -a -ivk APAR_number To determine your platform firmware level, at the command prompt, type: lscfg -vp | grep -p Platform The last six digits of the ROM level represent the platform firmware date in the format, YYMMDD. HP: /usr/sbin/swlist -l patch swlist | grep patch Linux: rpm -qa Solaris: showrev -p pkginfo -i package_name Tru64: /usr/sbin/dupatch -track -type kit Netcards: --------- AIX: lsdev -Cc adapter lsdev -Cc adapter | grep ent lsdev -Cc if lsattr -E -l ent1 ifconfig -a Solaris: prtconf -D / prtconf -pv / prtconf | grep "card" prtdiag | grep "card" svcs -x ifconfig -a (up plumb) Quickly find out who is using most memory: ------------------------------------------ See section marked &&& (use find/search on &&&) Network sniffing: ----------------- Here are a few short descriptions, and examples, of usefull network trace / dump commands. -- Solaris: snoop command examples: For example, if we want to observe traffic between systems alpha and beta we can use the following command: # snoop alpha,beta To enable data captures from the snoop output without losing packets while writing to the screen, send the snoop output to a file. For example: # snoop -o /tmp/snooper -V 128.50.1.250 To snoop a specific port: # snoop -o port xxx -- AIX: tcpdump command examples: # tcpdump port 23 # tcpdump -i en0 A good way to use tcpdump is to save the network trace to a file with the -w flag and then analyze the trace by using different filtering options together with the -r flag. The following example show how to run a basic tcpdump network trace, saving the output in a file with the -w flag (on a Ethernet network interface): # tcpdump -w /tmp/tcpdump.en0 -i en0 To limit the number of traced packets, use the -c flag and specify the number, such as in the following example that traces the first 128 packets (on a token-ring network interface): # tcpdump -c 128 -w /tmp/tcpdump.tr0 -i tr0 iptrace command examples: To start the iptrace daemon with the System Resource Controller (SRC), # startsrc -s iptrace -a "/tmp/nettrace" To stop the iptrace daemon with SRC enter the following: # stopsrc -s iptrace To record packets coming in and going out to any host on every interface, enter the command in the following format: # iptrace /tmp/nettrace The recorded packets are received on and sent from the local host. All packet flow between the local host and all other hosts on any interface is recorded. The trace information is placed into the /tmp/nettrace file. To record packets received on an interface from a specific remote host, enter the command in the following format: # iptrace - i en0 -p telnet -s airmail /tmp/telnet.trace The packets to be recorded are received on the en0 interface, from remote hostairmail, over the telnet port. The trace information is placed into the /tmp/telnet.trace file. To record packets coming in and going out from a specific remote host, enter the command in the following format: # iptrace -i en0 -s airmail -b /tmp/telnet.trace The packets to be recorded are received on the en0 interface, from remote host airmail. The trace information is placed into the /tmp/telnet.trace file. -- HPUX: nettl command: Initialize the tracing/logging facility: # nettl -start Logging is enabled for all subsystems as determined by the /etc/nettlgen.conf file. Log messages are sent to a log file whose name is determined by adding the suffix .LOG000 to the log file name specified in the /etc/nettlgen.conf configuration file. To stop the tracing facility: # nettl -stop Turn on inbound and outbound PDU tracing for the transport and session (OTS/9000) subsystems and send binary trace messages to file /var/adm/trace.TRC000. # nettl -traceon pduin pduout -entity transport session -file /var/adm/trace Session using nettl and the formatter netfmt: 1. Capture packets nettl -tn all -e ns_ls_ip -tm 99999 -size 1024 -f some-raw-capture-file 2. Reproduce problem. 3. Turn off trace: nettl -tf -e all 4. Create formatter filter file. Example: filter tcp_sport 6699 filter tcp_dport 6699 5. Filter the packets: 5.1 "Long" display netfmt -Nlnc filter-file -f some-raw.capture > formatted.out 5.2 "One-liner" display netfmt -Nln1Tc filter-file -f some-raw.capture > one-liner.out -- Restart inetd, nfs: -- ------------------- Starting and stopping NFS: -------------------------- On all unixes, a number of daemons should be running in order for NFS to be functional, like for example the rpc.* processes, biod, nfsd and others. Once nfs is running, and in order to actually "share" or "export" your filesystem on your server, so remote clients are able to mount the nfs mount, in most cases you should edit the "/etc/exports" file. -- AIX: The following subsystems are part of the nfs group: nfsd, biod, rpc.lockd, rpc.statd, and rpc.mountd. The nfs subsystem (group) is under control of the "resource controller", so starting and stopping nfs is actually easy # startsrc -g nfs # stopsrc -g nfs Or use smitty. -- Redhat Linux: # /sbin/service nfs restart # /sbin/service nfs start # /sbin/service nfs stop -- On some other Linux distros # /etc/init.d/nfs start # /etc/init.d/nfs stop # /etc/init.d/nfs restart -- Solaris: If the nfs daemons aren't running, then you will need to run: # /etc/init.d/nfs.server start -- HP-UX: Issue the following command on the NFS server to start all the necessary NFS processes (HP): # /sbin/init.d/nfs.server start Or if your machine is only a client: # cd /sbin/init.d # ./nfs.client start
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.