Configuring Performance Options (2 of 2) • Configuring virtual memory • Virtual memory - Disk storage used to expand the capacity of the physical RAM installed in the computer • Virtual memory works through a technique called paging - Whereby blocks of information, called pages, are moved from RAM into virtual memory on disk • The area of disk that is allocated for this purpose is called the paging file • Tips for placement of the paging file: • Server performance is better if the paging file is not placed on the boot partition • If there are multiple disks, performance can be improved by placing a paging file on each disk • In a mirrored set or volume, place the paging file on the main disk • Do not place the paging file on a stripe set, striped volume, stripe set with parity, or RAID-5 volume © 2018 Cengage. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use. 16
View full slide show




A list of the different modes of opening a file: wb+ Opens a file for both writing and reading in binary format. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing. a Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. ab Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. a+ Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing. ab+ Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
View full slide show




Chapter 1: Teaching Analogies  When teaching the difference between hard drive and RAM memory, compare an office space and a computer. The working person is like a CPU, the desk area is similar to RAM memory, a file cabinet is similar to the hard drive, and files stored on the hard drive compare with printed documents stored in the file cabinet. • The larger the desk area, the greater the number of documents that can be opened on it at the same time. If the desk is not large enough, the person (the CPU) must close a file and properly store it inside the file cabinet before searching and opening a new one. This process takes time.  The different types of memory that a computer uses, in order of fastest to slowest, are as follows: • memory inside CPU - L1 cache • memory in the processor housing - L2 cache • memory on the motherboard – RAM • hard drive space that is used as memory – virtual memory  An analogy is similar to getting a drink of water: (1) Having a glass of water sitting on your desk is similar to having L1 cache. (2) Having to go refill the glass from a faucet is similar to having L2 cache. (3) Having to get bottled water from a drink machine is similar to having RAM. (4) Having to go to a store and buy bottled water is similar to having hard drive storage that is used as RAM. Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 20
View full slide show




HDFS (Hadoop Distributed File System) is a distr file sys for commodity hdwr. Differences from other distr file sys are few but significant. HDFS is highly fault-tolerant and is designed to be deployed on low-cost hardware. HDFS provides hi thruput access to app data and is suitable for apps that have large data sets. HDFS relaxes a few POSIX requirements to enable streaming access to file system data. HDFS originally was infrastructure for Apache Nutch web search engine project, is part of Apache Hadoop Core http://hadoop.apache.org/core/ 2.1. Hardware Failure Hardware failure is the normal. An HDFS may consist of hundreds or thousands of server machines, each storing part of the file system’s data. There are many components and each component has a non-trivial prob of failure means that some component of HDFS is always non-functional. Detection of faults and quick, automatic recovery from them is core arch goal of HDFS. 2.2. Streaming Data Access Applications that run on HDFS need streaming access to their data sets. They are not general purpose applications that typically run on general purpose file systems. HDFS is designed more for batch processing rather than interactive use by users. The emphasis is on high throughput of data access rather than low latency of data access. POSIX imposes many hard requirements not needed for applications that are targeted for HDFS. POSIX semantics in a few key areas has been traded to increase data throughput rates. 2.3. Large Data Sets Apps on HDFS have large data sets, typically gigabytes to terabytes in size. Thus, HDFS is tuned to support large files. It provides high aggregate data bandwidth and scale to hundreds of nodes in a single cluster. It supports ~10 million files in a single instance. 2.4. Simple Coherency Model: HDFS apps need a write-once-read-many access model for files. A file once created, written, and closed need not be changed. This assumption simplifies data coherency issues and enables high throughput data access. A Map/Reduce application or a web crawler application fits perfectly with this model. There is a plan to support appending-writes to files in future [write once read many at file level] 2.5. “Moving Computation is Cheaper than Moving Data” A computation requested by an application is much more efficient if it is executed near the data it operates on. This is especially true when the size of the data set is huge. This minimizes network congestion and increases the overall throughput of the system. The assumption is that it is often better to migrate the computation closer to where the data is located rather than moving the data to where the app is running. HDFS provides interfaces for applications to move themselves closer to where the data is located. 2.6. Portability Across Heterogeneous Hardware and Software Platforms: HDFS has been designed to be easily portable from one platform to another. This facilitates widespread adoption of HDFS as a platform of choice for a large set of applications. 3. NameNode and DataNodes: HDFS has a master/slave architecture. An HDFS cluster consists of a single NameNode, a master server that manages the file system namespace and regulates access to files by clients. In addition, there are a number of DataNodes, usually one per node in the cluster, which manage storage attached to the nodes that they run on. HDFS exposes a file system namespace and allows user data to be stored in files. Internally, a file is 1 blocks stored in a set of DataNodes. The NameNode executes file system namespace operations like opening, closing, and renaming files and directories. It also determines the mapping of blocks to DataNodes. The DataNodes are responsible for serving read and write requests from the file system’s clients. The DataNodes also perform block creation, deletion, and replication upon instruction The NameNode and DataNode are pieces of software designed to run on commodity machines, typically run GNU/Linux operating system (OS). HDFS is built using the Java language; any machine that supports Java can run the NameNode or the DataNode software. Usage of the highly portable Java language means that HDFS can be deployed on a wide range of machines. A typical deployment has a dedicated machine that runs only the NameNode software. Each of the other machines in the cluster runs one instance of the DataNode software. The architecture does not preclude running multiple DataNodes on the same machine but in a real deployment that is rarely the case. The existence of a single NameNode in a cluster greatly simplifies the architecture of the system. The NameNode is the arbitrator and repository for all HDFS metadata. The system is designed in such a way that user data never flows through the NameNode. 4. The File System Namespace: HDFS supports a traditional hierarchical file organization. A user or an application can create directories and store files inside these directories. The file system namespace hierarchy is similar to most other existing file systems; one can create and remove files, move a file from one directory to another, or rename a file. HDFS does not yet implement user quotas or access permissions. HDFS does not support hard links or soft links. However, the HDFS architecture does not preclude implementing these features. The NameNode maintains the file system namespace. Any change to the file system namespace or its properties is recorded by the NameNode. An application can specify the number of replicas of a file that should be maintained by HDFS. The number of copies of a file is called the replication factor of that file. This info is stored by NameNode. 5. Data Replication: HDFS is designed to reliably store very large files across machines in a large cluster. It stores each file as a sequence of blocks; all blocks in a file except the last block are the same size. The blocks of a file are replicated for fault tolerance. The block size and replication factor are configurable per file. An application can specify the number of replicas of a file. The replication factor can be specified at file creation time and can be changed later. Files in HDFS are write-once and have strictly one writer at any time. The NameNode makes all decisions regarding replication of blocks. It periodically receives a Heartbeat and a Blockreport from each of the DataNodes in the cluster. Receipt of a Heartbeat implies that the DataNode is functioning properly. A Blockreport contains a list of all blocks on a DataNode
View full slide show




6. The Persistence of File System Metadata: The HDFS namespace is stored by the NameNode. The NameNode uses a transaction log called the EditLog to persistently record every change that occurs to file system metadata. For example, creating a new file in HDFS causes the NameNode to insert a record into the EditLog indicating this. Similarly, changing the replication factor of a file causes a new record to be inserted into the EditLog. The NameNode uses a file in its local host OS file system to store the EditLog. The entire file system namespace, including the mapping of blocks to files and file system properties, is stored in a file called the FsImage. The FsImage is stored as a file in the NameNode’s local file system too. The NameNode keeps an image of the entire file system namespace and file Blockmap in memory. This key metadata item is designed to be compact, such that a NameNode with 4 GB of RAM is plenty to support a huge number of files and directories. When the NameNode starts up, it reads the FsImage and EditLog from disk, applies all the transactions from the EditLog to the in-memory representation of the FsImage, and flushes out this new version into a new FsImage on disk. It can then truncate the old EditLog because its transactions have been applied to the persistent FsImage. This process is called a checkpoint. In the current implementation, a checkpoint only occurs when the NameNode starts up. Work is in progress to support periodic checkpointing in the near future. The DataNode stores HDFS data in files in its local file system. The DataNode has no knowledge about HDFS files. It stores each block of HDFS data in a separate file in its local file system. The DataNode does not create all files in the same directory. Instead, it uses a heuristic to determine the optimal number of files per directory and creates subdirectories appropriately. It is not optimal to create all local files in the same directory because the local file system might not be able to efficiently support a huge number of files in a single directory. When a DataNode starts up, it scans through its local file system, generates a list of all HDFS data blocks that correspond to each of these local files and sends this report to the NameNode: this is the Blockreport. 7. The Communication Protocols: All HDFS communication protocols are layered on top of the TCP/IP protocol. A client establishes a connection to a configurable TCP port on the NameNode machine. It talks the ClientProtocol with the NameNode. The DataNodes talk to the NameNode using the DataNode Protocol. A Remote Procedure Call (RPC) abstraction wraps both the Client Protocol and the DataNode Protocol. By design, the NameNode never initiates any RPCs. Instead, it only responds to RPC requests issued by DataNodes or clients. 8. Robustness: The primary objective of HDFS is to store data reliably even in the presence of failures. The three common types of failures are NameNode failures, DataNode failures and network partitions. 8.1. Data Disk Failure, Heartbeats and Re-Replication: Each DataNode sends a Heartbeat message to the NameNode periodically. A network partition can cause a subset of DataNodes to lose connectivity with the NameNode. The NameNode detects this condition by the absence of a Heartbeat message. The NameNode marks DataNodes without recent Heartbeats as dead and does not forward any new IO requests to them. Any data that was registered to a dead DataNode is not available to HDFS any more. DataNode death may cause the replication factor of some blocks to fall below their specified value. The NameNode constantly tracks which blocks need to be replicated and initiates replication whenever necessary. The necessity for re-replication may arise due to many reasons: a DataNode may become unavailable, a replica may become corrupted, a hard disk on a DataNode may fail, or the replication factor of a file may be increased. 8.2. Cluster Rebalancing: HDFS arch is compatible with data rebalancing . A scheme might automatically move data from 1 DataNode to another if the free space on a DataNode falls below a certain threshold. In the event of a sudden high demand for a particular file, a scheme might dynamically create additional replicas and rebalance other data in the cluster. These types of data rebalancing schemes are not yet implemented. 8.3. Data Integrity: It is possible that a block of data fetched from a DataNode arrives corrupted. This corruption can occur because of faults in a storage device, network faults, or buggy software. The HDFS client software implements checksum checking on the contents of HDFS files. When a client creates an HDFS file, it computes a checksum of each block of the file and stores these checksums in a separate hidden file in the same HDFS namespace. When a client retrieves file contents it verifies that the data it received from each DataNode matches the checksum stored in the associated checksum file. If not, then the client can opt to retrieve that block from another DataNode that has a replica of that block.
View full slide show




04EI Die unterschiedlichen Derivate der C166-Familie High-Integration * 16 MByte Adreßraum * 2/4 KByte RAM * 32 CAPCOM * 4 PWM * 2 Serielle Schnittstellen * 5 Timer * Chip Selects erleichtern die Systemerweiterung * Extensive I/O C167CS * 11KB RAM * 256K Flash * 2 CAN Module * 24 ADC * RTC & Power Managem. * PLL C167CR/SR C167 * 2KB RAM C167S * CAN (nur CR) * 4K RAM * PLL * 32K ROM * 2KB RAM * PLL General Purpose * Ausgewogene Peripherie für eine Großzahl von Applikationen * 1K / 2 KB RAM * ROM / Flash / OTP Low-Cost ES - Version 2.0 * Different RAM Size * 16 M Addr. Range * 3/5 16-bit Timers * Serial i/f SSP, SSC * Reduced Chip Selects * Wide Ext. Bus Support * 3 V Options * 25 MHz Option * CAPCOM * PWM * Serial Interfaces * Timer * 10-bit / 8bit ADC * Full Bus Support/ MUX Bus only C165 * 2KB RAM * 3V * P-MQFP-100 * P-TQFP-100 27.09.08 C164CI 8xC166 * 1KB RAM * 32KB ROM * 32KB Flash * P-MQFP-100 C163 * 1KB RAM * SSP * 3V * Red. Peripherals * P-TQFP-100 * 2KB RAM * 64KB OTP/ROM/Flash * Full-CAN 2.0B * Power Management / RTC * Motor Control Peripheral * P-MQFP-80 C161RI C161xx * Großes RAM * Großes Flash * 3KB RAM * Pwr. Man. / RTC * Pwr. Man. / RTC * I2C Schnittstelle * I2C Interface * CAPCOM * 16MHz CPU * ADC * 2 USARTs * 4 M Adreßraum * CAN / J1850 * 1-2KB RAM * ADC * P-MQFP-80 C161V/K/O Seite 6
View full slide show




04EI The different derivate of the C166-family (since 1993) High-Integration * 16 MByte Address space * 2/4 KByte RAM * 32 CAPCOM * 4 PWM * 2 Serial interfaces * 5 Timers • Chip Selects makes the extension of the system Easier * Extensive I/O C167CS * 11KB RAM * 256K Flash * 2 CAN Module * 24 ADC * RTC & Power Managem. * PLL C167CR/SR C167 * 2KB RAM C167S * CAN (nur CR) * 4K RAM * PLL * 32K ROM * 2KB RAM * PLL General Purpose * Balanced peripherial * CAPCOM devices for a great number * PWM of applications * Serial Interfaces * Timer * 10-bit / 8bit ADC * 1K / 2 KB RAM * Full Bus Support/ * ROM / Flash / OTP MUX Bus only Low-Cost ES - Version 2.0 * Different RAM Size * 16 M Addr. Range * 3/5 16-bit Timers * Serial i/f SSP, SSC * Reduced Chip Selects * Wide Ext. Bus Support * 3 V Options * 25 MHz Option C165 * 2KB RAM * 3V * P-MQFP-100 * P-TQFP-100 12.08.2013 C164CI 8xC166 * 1KB RAM * 32KB ROM * 32KB Flash * P-MQFP-100 C163 * 1KB RAM * SSP * 3V * Red. Peripherals * P-TQFP-100 * 2KB RAM * 64KB OTP/ROM/Flash * Full-CAN 2.0B * Power Management / RTC * Motor Control Peripheral * P-MQFP-80 C161RI C161xx * Großes RAM * Großes Flash * 3KB RAM * Pwr. Man. / RTC * Pwr. Man. / RTC * I2C Schnittstelle * I2C Interface * CAPCOM * 16MHz CPU * ADC * 2 USARTs * 4 M Adreßraum * CAN / J1850 * 1-2KB RAM * ADC * P-MQFP-80 C161V/K/O page 7
View full slide show




A list of the different modes of opening a file: Modes Description r Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode. rb Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode. r+ Opens a file for both reading and writing. The file pointer will be at the beginning of the file. rb+ Opens a file for both reading and writing in binary format. The file pointer will be at the beginning of the file. w Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. wb Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. w+ Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.
View full slide show




Move the Virtual Memory Paging File • Virtual memory: a file used to enhance the amount of RAM in a system • To save space you can move virtual memory paging file – Pagefile.sys • Hidden file stored in C drive root directory – Move to another partition on the same or different drive • New drive speed should be equal to or greater than existing drive and should have plenty of free space (at least three times the amount of installed RAM) A+ Guide to Managing & Maintaining Your PC, 8th Edition © Cengage Learning 2014 17
View full slide show




Memory • Virtual memory can boost total memory available • Physical memory: RAM chips – Physical memory required by server varies • Task dependent • Virtual memory: stored on hard drive – Page file (paging file, swap file) • Managed by operating system – Paging • Moving blocks (pages) from RAM into virtual memory Network+ Guide to Networks, 5th Edition 29
View full slide show




Memory Virtualization Basics  In ESX, the address translation between guest physical memory and host physical memory is maintained by the hypervisor using a physical memory mapping data structure, or pmap, for each virtual machine.  The shadow page tables maintain consistency with the guest virtual to guest physical address mapping in the guest page tables and the guest physical to host physical address mapping in the pmap data structure.  This approach removes the virtualization overhead for the virtual machine’s normal memory accesses because the hardware TLB will cache the direct guest virtual to host physical memory address translations read from the shadow page tables.  The hypervisor intercepts the virtual machine’s memory accesses and allocates host physical memory for the virtual machine on its first access to the memory. In order to avoid information leaking among virtual machines, the hypervisor always writes zeroes to the host physical memory before assigning it to a virtual machine.  The hypervisor knows when to allocate host physical memory for a virtual machine because the first memory access from the virtual machine to a host physical memory will cause a page fault that can be easily captured by the hypervisor.
View full slide show




Memory Virtualization Basics  The virtual memory space, that is the guest’s memory space, is divided into blocks, typically 4KB, called pages. The physical memory, that is the host’s memory, is also divided into blocks, also typically 4KB (ESX/ESXi also provides support for large pages of 2 MB)  When host physical memory is full, the data for virtual pages that are not present in host physical memory are stored on disk.  When running a virtual machine, the hypervisor creates a contiguous addressable memory space for the virtual machine. This allows the hypervisor to run multiple virtual machines simultaneously while protecting the memory of each virtual machine from being accessed by others.  From the view of the application running inside the virtual machine, the hypervisor adds an extra level of address translation that maps the guest physical address to the host physical address. As a result, there are three virtual memory layers in ESX: guest virtual memory, guest physical memory, and host physical memory.
View full slide show




8.4. Metadata Disk Failure: The FsImage and EditLog are central data structures. A corruption of these files can cause the HDFS instance to be non-functional. For this reason, the NameNode can be configured to support maintaining multiple copies of the FsImage and EditLog. Any update to either the FsImage or EditLog causes each of the FsImages and EditLogs to get updated synchronously. This synchronous updating of multiple copies of the FsImage and EditLog may degrade the rate of namespace transactions per second that a NameNode can support. However, this degradation is acceptable because even though HDFS applications are very data intensive in nature, they are not metadata intensive. When a NameNode restarts, it selects the latest consistent FsImage and EditLog to use. The NameNode machine is a single point of failure for an HDFS cluster. If the NameNode machine fails, manual intervention is necessary. Currently, automatic restart and failover of the NameNode software to another machine is not supported. 8.5. Snapshots: Snapshots support storing a copy of data at a particular instant of time. One usage of the snapshot feature may be to roll back a corrupted HDFS instance to a previously known good point in time. HDFS does not currently support snapshots but will in a future release. 9. Data Organization 9.1. Data Blocks: HDFS is designed to support very large files. Applications that are compatible with HDFS are those that deal with large data sets. These applications write their data only once but they read it one or more times and require these reads to be satisfied at streaming speeds. HDFS supports write-once-read-many semantics on files. A typical block size used by HDFS is 64 MB. Thus, an HDFS file is chopped up into 64 MB chunks, and if possible, each chunk will reside on a different DataNode. 9.2. Staging: A client request to create a file does not reach the NameNode immediately. In fact, initially the HDFS client caches the file data into a temporary local file. Application writes are transparently redirected to this temporary local file. When the local file accumulates data worth over one HDFS block size, the client contacts the NameNode. The NameNode inserts the file name into the file system hierarchy and allocates a data block for it. The NameNode responds to the client request with the identity of the DataNode and the destination data block. Then the client flushes the block of data from the local temporary file to the specified DataNode. When a file is closed, the remaining un-flushed data in the temporary local file is transferred to the DataNode. The client then tells the NameNode that the file is closed. At this point, the NameNode commits the file creation operation into a persistent store. If the NameNode dies before the file is closed, the file is lost. The above approach has been adopted after careful consideration of target applications that run on HDFS. These applications need streaming writes to files. If a client writes to a remote file directly without any client side buffering, the network speed and the congestion in the network impacts throughput considerably. This approach is not without precedent. Earlier distributed file systems, e.g. AFS, have used client side caching to improve performance. A POSIX requirement has been relaxed to achieve higher performance of data uploads. 9.3. Replication Pipelining: When a client is writing data to an HDFS file, its data is first written to a local file as explained in the previous section. Suppose the HDFS file has a replication factor of three. When the local file accumulates a full block of user data, the client retrieves a list of DataNodes from the NameNode. This list contains the DataNodes that will host a replica of that block. The client then flushes the data block to the first DataNode. The first DataNode starts receiving the data in small portions (4 KB), writes each portion to its local repository and transfers that portion to the second DataNode in the list. The second DataNode, in turn starts receiving each portion of the data block, writes that portion to its repository and then flushes that portion to the third DataNode. Finally, the third DataNode writes the data to its local repository. Thus, a DataNode can be receiving data from the previous one in the pipeline and at the same time forwarding data to the next one in the pipeline. Thus, the data is pipelined from one DataNode to the next.
View full slide show




Reclaiming Memory  If ballooning is not sufficient to reclaim memory or the host free memory drops towards the hard threshold, the hypervisor starts to use swapping in addition to using ballooning. During swapping, memory compression is activated as well. With host swapping and memory compression, the hypervisor should be able to quickly reclaim memory and bring the host memory state back to the soft state.  In a rare case where host free memory drops below the low threshold, the hypervisor continues to reclaim memory through swapping and memory compression, and additionally blocks the execution of all virtual machines that consume more memory than their target memory allocations.  In certain scenarios, host memory reclamation happens regardless of the current host free memory state. For example, even if host free memory is in the high state, memory reclamation is still mandatory when a virtual machine’s memory usage exceeds its specified memory limit. If this happens, the hypervisor will employ ballooning and, if necessary, swapping and memory compression to reclaim memory from the virtual machine until the virtual machine’s host memory usage falls back to its specified limit.
View full slide show




Identifying Your System Configuration Different system configurations:  One hard disk drive, one CD-ROM drive, and one floppy disk drive  One hard disk drive, one CD-ROM drive, one floppy disk drive, and one Zip drive  Two hard disk drives, one CD-ROM drive, and one floppy disk drive  One hard disk drive, one CD-ROM drive, one readwrite CD-ROM drive, and one floppy disk drive Ch1 26
View full slide show




Sample Code class Equipment { class FloppyDisk : public Equipment { public: public: virtual ~Equipment( ); FloppyDisk(const char*); const char* name( ) { return _name; } virtual ~FloppyDisk( ); virtual Watt Power( ); virtual Watt Power( ); virtual Currency NetPrice( ); virtual Currency NetPrice( ); virtual Currency DiscountPrice( ); virtual Currency DiscountPrice( ); virtual void Add(Equipment *); virtual void Remove(Equipment *); } class Chassis : public CompositeEquipment{ virtual Iterator * CreateIterator( ); public: protected: Chassis (const char* ); Equipment (const char * ); virtual ~Chassis( ); private: virtual Watt Power( ); const char * _name; virtual Currency NetPrice( ); } virtual Currency DiscountPrice( ); }
View full slide show




Virtual Memory       Every CPU family today uses virtual memory, in which disk pretends to be a bigger RAM. Virtual memory capability can’t be turned off (though you can turn off the ability to swap to disk). RAM is split up into pages, typically 4 KB each. Each page is either in RAM or out on disk. To keep track of the pages, a page table notes whether each table is in RAM, where it is in RAM (that is, physical address and virtual address are different), and some other information. So, a 4 GB physical RAM would need over a million page table entries – and a 32 GB physical RAM as on Schooner would need over 32M page table entries. Supercomputing in Plain English: Multicore Tue Apr 3 2018 69
View full slide show




Virtual Memory       Every CPU family today uses virtual memory, in which disk pretends to be a bigger RAM. Virtual memory capability can’t be turned off (though you can turn off the ability to swap to disk). RAM is split up into pages, typically 4 KB each. Each page is either in RAM or out on disk. To keep track of the pages, a page table notes whether each table is in RAM, where it is in RAM (that is, physical address and virtual address are different), and some other information. So, a 4 GB physical RAM would need over a million page table entries – and a 32 GB physical RAM as on Boomer would need over 32M page table entries. Supercomputing in Plain English: Multicore Tue March 12 2013 69
View full slide show




Virtual Memory       Every CPU family today uses virtual memory, in which disk pretends to be a bigger RAM. Virtual memory capability can’t be turned off (though you can turn off the ability to swap to disk). RAM is split up into pages, typically 4 KB each. Each page is either in RAM or out on disk. To keep track of the pages, a page table notes whether each table is in RAM, where it is in RAM (that is, physical address and virtual address are different), and some other information. So, a 4 GB physical RAM would need over a million page table entries – and a 32 GB physical RAM as on Boomer would need over 32M page table entries. Supercomputing in Plain English: Multicore Tue March 31 2015 71
View full slide show




Memory How do program instructions transfer in and out of RAM? Step 1. When you start the computer, certain RAM Operating system instructions Operating system interface operating system files are loaded into RAM from the hard disk. The operating system displays the user interface on the screen. Step 2. When you start a Web browser, the Web browser instructions Web browser window program’s instructions are loaded into RAM from the hard disk. The Web browser window is displayed on the screen. Step 3. When you start a paint program, the Paint program instructions Paint program window program’s instructions are loaded into RAM from the hard disk. The paint program, along with the Web Browser and certain operating system instructions are in RAM. The paint program window is displayed on the screen. RAM Step 4. When you quit a program, such as the Web browser, its program instructions are removed from RAM. The Web browser is no longer displayed on the screen. p. 198 Fig. 4-17 Web browser program instructions are removed from RAM Web browser window is no longer displayed on desktop Next
View full slide show




Memory How do program instructions transfer in and out of RAM? Step 1. When you start the computer, certain RAM Operating system instructions Operating system interface operating system files are loaded into RAM from the hard disk. The operating system displays the user interface on the screen. Step 2. When you start a Web browser, the Web browser instructions Web browser window program’s instructions are loaded into RAM from the hard disk. The Web browser window is displayed on the screen. Step 3. When you start a word processing Word processing program instructions Word processing program window program, the program’s instructions are loaded into RAM from the hard disk. The word processing program, along with the Web Browser and certain operating system instructions are in RAM. The word processing program window is displayed on the screen. RAM Step 4. When you quit a program, such as the Web browser, its program instructions are removed from RAM. The Web browser is no longer displayed on the screen. p. 143 Fig. 4-12 Web browser program instructions are removed from RAM Web browser window is no longer displayed on desktop 18 Next
View full slide show




Ballooning: Inflating the balloon in a virtual machine  If any of these pages are re-accessed by the virtual machine for some reason, the hypervisor will treat it as a normal virtual machine memory allocation and allocate a new host physical page for the virtual machine.  When the hypervisor decides to deflate the balloon—by setting a smaller target balloon size—the balloon driver deallocates the pinned guest physical memory, which releases it for the guest’s applications.  By inflating the balloon, a virtual machine consumes less physical memory on the host, but more physical memory inside the guest. As a result, the hypervisor offloads some of its memory overload to the guest operating system while slightly loading the virtual machine. That is, the hypervisor transfers the memory pressure from the host to the virtual machine.  Ballooning induces guest memory pressure. In response, the balloon driver allocates and pins guest physical memory. The guest operating system determines if it needs to page out guest physical memory to satisfy the balloon driver’s allocation requests.  If the virtual machine has plenty of free guest physical memory, inflating the balloon will induce no paging and will not impact guest performance.
View full slide show




Event Reconstruction - Reconstruction of deleted files.  In most file systems file deletion does not erase the information stored in the file. Instead, the file entry and the data blocks used by the file are marked as unallocated, so that they can be reused later for another file. Thus, unless the data blocks and the deleted file entry have been reallocated to another file, the deleted file can usually be recovered by restoring its file entry and data blocks to active status.  Even if the file entry and some of the data blocks have been re-allocated, it may still be possible to reconstruct parts of the file. The lazarus tool for example, uses several heuristics to find and piece together blocks that (could have) once belonged to a file. Lazarus uses heuristics about file systems and common file formats.  In most file systems, a file begins at the beginning of a disk block; Most file systems write file into contiguous blocks, if possible; Most file formats have a distinguishing pattern of bytes near the beginning of the le; For most file formats, same type of data is stored in all blocks of a file.
View full slide show




How do program instructions transfer in and out of RAM? Step 1. When you start the computer, certain RAM Operating system instructions Operating system interface operating system files are loaded into RAM from the hard disk. The operating system displays the user interface on the screen. Step 2. When you start a Web browser, the Web browser instructions Web browser window program’s instructions are loaded into RAM from the hard disk. The Web browser window is displayed on the screen. Step 3. When you start a paint program, the Paint program instructions Paint program window program’s instructions are loaded into RAM from the hard disk. The paint program, along with the Web Browser and certain operating system instructions are in RAM. The paint program window is displayed on the screen. RAM Step 4. When you quit a program, such as the Web browser, its program instructions are removed from RAM. The Web browser is no longer displayed on the screen. Web browser program instructions are removed from RAM Web browser window is no longer displayed on desktop
View full slide show




Universality of the RAM (cont.)   RAMs can simulate FSMs  Another “universality” result: RAMs can execute RAM programs Since RAM components (CPU and bounded random-accessmemory) are themselves FSMs, a RAM can simulate any other RAM  Two “flavors” of RAM to execute RAM programs:    RAM program is stored in registers specially allocated to the RAM program (loaded onto CPU) RAM program is stored in registers of the random-access-memory (RASP model) For later discussion (if time permits)
View full slide show




  If XP does not have enough RAM to open applications (multitasking), a special system file is created on the hard disk called a paging file or swap file. XP swaps from RAM into the paging file —Pagefile.sys. – Page is usually 4 KB – Pagefile.sys stored in the top-level folder of the volume where Windows is installed. – Default size is 1.5 times the amount of RAM on your machine. Size increased/decreased depending upon need. – Paging file automatically created at bootup.
View full slide show




Operation on Files  Typical file operations include:          OPEN: Readies the file for access, and associates a pointer that will refer to a current file record at each point in time. FIND: Searches for the first file record that satisfies a certain condition, and makes it the current file record. FINDNEXT: Searches for the next file record (from the current record) that satisfies a certain condition, and makes it the current file record. READ: Reads the current file record into a program variable. INSERT: Inserts a new record into the file & makes it the current file record. DELETE: Removes the current file record from the file, usually by marking the record to indicate that it is no longer valid. MODIFY: Changes the values of some fields of the current file record. CLOSE: Terminates access to the file. REORGANIZE: Reorganizes the file records.   For example, the records marked deleted are physically removed from the file or a new organization of the file records is created. READ_ORDERED: Read the file blocks in order of a specific field of the file. Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 13- 14
View full slide show




Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Instr cache Reg file ALU Data cache Reg file Instr cache Reg file ALU Data cache Reg file Reg file ALU Data cache Instr 3 Instr 5 Instr 4 Instr cache Cycle 7 Cycle 8 Cycle 9 Cycle 2 Cycle 3 Writes into $8 Bubble Reg file Task dimension Cycle 4 ALU Bubble Instr cache Reg file Cycle 5 Cycle 6 Reg file Data cache Reg file ALU Data cache Reg file Cycle 8 Cycle 9 Cycle 7 Without data forwarding, three bubbles are needed to resolve a read-after-write data dependency Reads from $8 Time dimension Instr cache Instr 3 Instr 2 Instr 1 Bubble Instr cache Cycle 1 ALU Data cache Reg file Instr cache Reg file ALU Data cache Reg file ALU Data cache Reg file Reg file ALU Data cache Reg file Instr cache Reg file ALU Data cache Bubble Reg file Instr cache Task dimension Writes into $8 Reg file Instr cache Instr 4 Instr 5 Cycle 6 Time dimension Instr 2 Instr 1 Inserting Bubbles in a Pipeline Bubble Two bubbles, if we assume that a register can be updated and read from in one cycle Reads from $8 Reg file Computer Architecture, Data Path and Control Slide 48
View full slide show




Memory Reclamation in ESX  Motivation: Memory Overcommitment  Host memory is overcommitted when the total amount of guest physical memory of the running virtual machines is larger than the amount of actual host memory. ESX supports memory overcommitment due to two important benefits it provides:  Higher memory utilization: With memory overcommitment, ESX ensures that host memory is consumed by active guest memory as much as possible. Memory overcommitment allows the hypervisor to use memory reclamation techniques to take the inactive or unused host physical memory away from the idle virtual machines and give it to other virtual machines that will actively use it.  Higher consolidation ratio: With memory overcommitment, each virtual machine has a smaller footprint in host memory usage, making it possible to fit more virtual machines on the host while still achieving good performance for all virtual machines.
View full slide show




MEMORY & I/O SYSTEMS Virtual Memory • Virtual addresses – – – – Programs use virtual addresses Entire virtual address space stored on a hard drive Subset of virtual address data in DRAM CPU translates virtual addresses into physical addresses (DRAM addresses) – Data not in DRAM fetched from hard drive • Memory Protection – – – – Each program has own virtual to physical mapping Two programs can use same virtual address for different data Programs don’t need to be aware others are running One program (or virus) can’t corrupt memory used by another Chapter 8 <47>
View full slide show




VIRTUAL MEMORY Other Issues Memory Mapped IO • Allows file I/O to be treated as routine memory access by mapping a disk block to a page in memory • A file is initially read using demand paging. Multiple page-sized portions of the file are read from the file system into physical pages. Subsequent reads/writes to/from the file are treated as ordinary memory accesses. • Simplifies file access by treating file I/O through memory rather than read() write() system calls • Also allows several processes to map the same file allowing the pages in memory to be shared 9: Virtual Memory 25
View full slide show




The NameNode and DataNode are pieces of software designed to run on commodity machines, typically run GNU/Linux operating system (OS). HDFS is built using the Java language; any machine that supports Java can run the NameNode or the DataNode software. Usage of the highly portable Java language means that HDFS can be deployed on a wide range of machines. A typical deployment has a dedicated machine that runs only the NameNode software. Each of the other machines in the cluster runs one instance of the DataNode software. The architecture does not preclude running multiple DataNodes on the same machine but in a real deployment that is rarely the case. The existence of a single NameNode in a cluster greatly simplifies the architecture of the system. The NameNode is the arbitrator and repository for all HDFS metadata. The system is designed in such a way that user data never flows through the NameNode. 4. The File System Namespace: HDFS supports a traditional hierarchical file organization. A user or an application can create directories and store files inside these directories. The file system namespace hierarchy is similar to most other existing file systems; one can create and remove files, move a file from one directory to another, or rename a file. HDFS does not yet implement user quotas or access permissions. HDFS does not support hard links or soft links. However, the HDFS architecture does not preclude implementing these features. The NameNode maintains the file system namespace. Any change to the file system namespace or its properties is recorded by the NameNode. An application can specify the number of replicas of a file that should be maintained by HDFS. The number of copies of a file is called the replication factor of that file. This info is stored by NameNode. 5. Data Replication: HDFS is designed to reliably store very large files across machines in a large cluster. It stores each file as a sequence of blocks; all blocks in a file except the last block are the same size. The blocks of a file are replicated for fault tolerance. The block size and replication factor are configurable per file. An application can specify the number of replicas of a file. The replication factor can be specified at file creation time and can be changed later. Files in HDFS are write-once and have strictly one writer at any time. The NameNode makes all decisions regarding replication of blocks. It periodically receives a Heartbeat and a Blockreport from each of the DataNodes in the cluster. Receipt of a Heartbeat implies that the DataNode is functioning properly. A Blockreport contains a list of all blocks on a DataNode
View full slide show




Static vs. Dynamic Binding Example Class Attributes Shape Methods - virtual computeArea - virtual computeVolume - pure virtual printShapeName - pure virtual print Point x y - virtual printShapeName - virtual print - constructor - setPoint - getX - getY Circle radius - virtual printShapeName - virtual print - virtual computeArea - setRadius - getRadius - constructor Cylinder height - virtual printShapeName - virtual print - virtual computeArea - virtual computeVolume - setHeight - getHeight - constructor CMSC 202 5
View full slide show




Impact of VMs on Virtual Memory • Virtualization of virtual memory if each guest OS in every VM manages its own set of page tables? • VMM separates real and physical memory – Makes real memory a separate, intermediate level between virtual memory and physical memory – Some use the terms virtual memory, physical memory, and machine memory to name the 3 levels – Guest OS maps virtual memory to real memory via its page tables, and VMM page tables map real memory to physical memory • VMM maintains a shadow page table that maps directly from the guest virtual address space to the physical address space of HW – Rather than pay extra level of indirection on every memory access – VMM must trap any attempt by guest OS to change its page table or to access the page table pointer 03/24/19 37
View full slide show