<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tafatah</id>
	<title>Soma-notes - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tafatah"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php/Special:Contributions/Tafatah"/>
	<updated>2026-05-01T15:25:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6631</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6631"/>
		<updated>2010-12-03T01:58:35Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Implementation and Statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these definitions, along with the underlying motivation for their existence, than to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are switching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implement an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [22], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
===Implementation and Statistics===&lt;br /&gt;
Up until this point, we have discussed and illustrated the theory behind FlexSC&#039;s logic patterns. However, it is also as important to demonstrate the practical and statistical results during implementation. FlexSC&#039;s implementation has shown a very large leap from today&#039;s synchronous system call method currently in use. &lt;br /&gt;
Firstly, demonstration of the current synchronous systems statistics will be discussed. The data collected by the researchers show that the System Calls cause a large delay in the User IPC(Interprocess Communication) between 20% and 60%. To get a general idea of how many instructions are executed in one system call, we name a few with their corresponding number of instructions. According to the researchers of this paper, pread(), pwrite(), open+close() require 3739, 5689 and 6631 instructions respectively. Therefore, these system calls, are not minuscule lines of code, that can be overlooked, they consume a large amount of time, hence FlexSC&#039;s attempt to lower this overall value by methods mentioned above in the paper such as system call batching.  &lt;br /&gt;
&lt;br /&gt;
On a single core, the System-Less Batching produces an improved time from 55 nanoseconds to about 35 nanoseconds once 15 or more batch requests have been utilized. Moreover, the throughput(requests/sec) shows a dramatic increase of 10,000 and more in Apache throughput of Linux. This throughput increases with the more cores implemented in the system. This demonstrates the theory of how the FlexSC&#039;s main application improvements in systems implementing multiple cores.   &lt;br /&gt;
&lt;br /&gt;
Furthermore, on a 4 core system, 14% of the original 50% idle time is being used in the User Space now. Latency as well is decreased by half of the original time on 1,2 and 4 core implementations. Also very interesting test case the researchers investigated was the idea of having numerous requests occurring at once in the system. They chose to execute 256 synchronous requests in the system and what they came to find is that FlexSC&#039;s method is 60ms faster than the current synchronous method and continually increases with the more cores in use.   &lt;br /&gt;
&lt;br /&gt;
Through the different methods being executed by the FlexSC&#039;s concepts, the statistics taken of the system demonstrates that their theory does hold in practice. This illustrates that we can being implementing this system into our computers we use every day and begin to see immediate results.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ HTML]&lt;br /&gt;
&lt;br /&gt;
[22] McCracken, Dave. &amp;lt;i&amp;gt;POSIX Threads and the Linux Kernel&amp;lt;/i&amp;gt;, IBM Linux Technology Center, Austin, TX. In Proceedings of the Ottawa Linux Symposium, 2002. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.2.8887&amp;amp;rep=rep1&amp;amp;type=pdf#page=330 PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6477</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6477"/>
		<updated>2010-12-02T18:37:17Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* FlexSC Threads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these definitions, along with the underlying motivation for their existence, than to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are switching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implement an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [22], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ HTML]&lt;br /&gt;
&lt;br /&gt;
[22] McCracken, Dave. &amp;lt;i&amp;gt;POSIX Threads and the Linux Kernel&amp;lt;/i&amp;gt;, IBM Linux Technology Center, Austin, TX. In Proceedings of the Ottawa Linux Symposium, 2002. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.2.8887&amp;amp;rep=rep1&amp;amp;type=pdf#page=330 PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6473</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6473"/>
		<updated>2010-12-02T18:33:40Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Background Concepts: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these definitions, along with the underlying motivation for their existence, than to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are switching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implements an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [22], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ HTML]&lt;br /&gt;
&lt;br /&gt;
[22] McCracken, Dave. &amp;lt;i&amp;gt;POSIX Threads and the Linux Kernel&amp;lt;/i&amp;gt;, IBM Linux Technology Center, Austin, TX. In Proceedings of the Ottawa Linux Symposium, 2002. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.2.8887&amp;amp;rep=rep1&amp;amp;type=pdf#page=330 PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6470</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6470"/>
		<updated>2010-12-02T18:28:25Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implements an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [22], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ HTML]&lt;br /&gt;
&lt;br /&gt;
[22] McCracken, Dave. &amp;lt;i&amp;gt;POSIX Threads and the Linux Kernel&amp;lt;/i&amp;gt;, IBM Linux Technology Center, Austin, TX. In Proceedings of the Ottawa Linux Symposium, 2002. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.2.8887&amp;amp;rep=rep1&amp;amp;type=pdf#page=330 PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6468</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6468"/>
		<updated>2010-12-02T18:27:35Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implements an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [22], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;br /&gt;
&lt;br /&gt;
[22] McCracken, Dave. &amp;lt;i&amp;gt;POSIX Threads and the Linux Kernel&amp;lt;/i&amp;gt;, IBM Linux Technology Center, Austin, TX. In Proceedings of the Ottawa Linux Symposium, 2002. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.2.8887&amp;amp;rep=rep1&amp;amp;type=pdf#page=330 PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6465</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6465"/>
		<updated>2010-12-02T18:18:53Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* FlexSC Threads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implements an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [22], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6464</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6464"/>
		<updated>2010-12-02T18:18:15Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* FlexSC Threads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pipeline Flushing===&lt;br /&gt;
The regular operation of a CPU has multiple instructions being fetched, decoded and executed at the same time.  The parallel processing of instructions provides a significant speed advantage in processing.  During a mode switch, however, instructions in the  user-mode pipeline are flushed and removed from the processor registers.[1]  These lost instructions are part of the cost of a mode switch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FlexSC Threads implements an M-on-N threading model, where M is the number of user based threads and N is the number of syscall threads, M being greater than N [1]. This is similar to one of the common styles of implementing threads, referred to as M:N model [21], where M represents user space threads, and N represents Kernel threads. The M-on-N model however uses FlexSC’s exception-less system call mechanism (transparently), i.e. its inner workings differ, from the otherwise typical M:N model. The M-on-N model takes advantage of maximizing the number of user space threads switching. In other words, as long as a user space thread is ready, work will continue in user space, minimizing thus the time spent on blocking.&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=6233</id>
		<title>Talk:COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=6233"/>
		<updated>2010-12-02T06:38:55Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Who is working on what ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Group 3 Essay=&lt;br /&gt;
&lt;br /&gt;
Hello everyone, please post your contact information here:&lt;br /&gt;
&lt;br /&gt;
Ben Robson [mailto:brobson@connect.carleton.ca brobson@connect.carleton.ca]&lt;br /&gt;
&lt;br /&gt;
Rey Arteaga: rarteaga@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
Corey Faibish: [mailto:corey.faibish@gmail.com corey.faibish@gmail.com]&lt;br /&gt;
&lt;br /&gt;
Tawfic Abdul-Fatah: [mailto:tfatah@gmail.com tfatah@gmail.com]&lt;br /&gt;
&lt;br /&gt;
Fangchen Sun: [mailto:sfangche@connect.carleton.ca sfangche@connect.carleton.ca]&lt;br /&gt;
&lt;br /&gt;
Mike Preston: [mailto:michaelapreston@gmail.com michaelapreston@gmail.com]&lt;br /&gt;
&lt;br /&gt;
Wesley L. Lawrence: [mailto:wlawrenc@connect.carleton.ca wlawrenc@connect.carleton.ca]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Can&#039;t access the video without a login as we found out in class, but you can listen to the speech and follow with the slides pretty easily, I just went through it and it&#039;s not too bad. Rarteaga&lt;br /&gt;
&lt;br /&gt;
==Question 3 Group==&lt;br /&gt;
*Abdul-Fatah Tawfic tafatah&lt;br /&gt;
*Arteaga Reynaldo rarteaga&lt;br /&gt;
*Faibish Corey   cfaibish&lt;br /&gt;
*Lawrence Wesley wlawrenc&lt;br /&gt;
*Preston Mike    mpreston&lt;br /&gt;
*Robson  Benjamin brobson&lt;br /&gt;
*Sun     Fangchen sfangche&lt;br /&gt;
&lt;br /&gt;
==Who is working on what ?==&lt;br /&gt;
Just to keep track of who&#039;s doing what --[[User:Tafatah|Tafatah]] 01:37, 15 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Hey everyone, I have taken the liberty of trying to provide a good first start on our paper. I have provided many resources and filled in information for all of the sections. This is not complete, but it should make the rest of the work a lot easier. Please go through and add in pieces that I am missing (specifically in the Critique section) and then we can put this essay to bed. Also, please note that below I have included my notes on the paper so that if anyone feels they do not have time to read the paper, they can read my notes instead and still find additional materials to contribute with.&lt;br /&gt;
--[[User:Mike Preston|Mike Preston]] 18:22, 20 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Man, Mike: you did a nice job! I&#039;m reading through it now very thorough :) Since you pretty much turned all of your bulleted points from the discussion page into that on the main page, what else needs to be done? Just expanding on each topic and sub-topic? Or are there untouched concepts/topics that we should be addressing?&lt;br /&gt;
Oh and question two: Should we turn the Q&amp;amp;A from the end of the video of the presentation into information for the &#039;&#039;Critique&#039;&#039; section?&lt;br /&gt;
--[[User:CFaibish|CFaibish]] 20:34, 22 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Mike, thnx for the great job! I basically finished the part of related work based on your draft.&lt;br /&gt;
--[[User:sfangchen|Fangchen Sun]] 17:40, 24 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
No problem, And great additions. &lt;br /&gt;
In terms of what needs to be done, I do believe that adding some detail to the critique is where we really need some focus. Using the Q&amp;amp;A from the video is probably a great source of inspiration, maybe just take a look at the topics presented, see if additional material from other sources can be obtain and use those sources to address any pros or cons to this artical. Remember, the critique section can be agreeing or disagreeing with what is presented in the actual paper.&lt;br /&gt;
--[[User:Mike Preston|Mike Preston]] 15:12, 28 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I noticied we needed some work in the Critique section, so I listened to the Q&amp;amp;A session at the end of the FlexSC mp3 talk, and took some quick notes. There seems to be 3 good ones (of the 9) that I picked out. I&#039;ll summarize them and add to the Critique section, specifically questions 3, 6, and 7. If anyone else wants to have listen to a specific question, and maybe try to do some more &#039;critiquing&#039; here is a list of what time the questions each take place, and a very general statement on what the question is about, and the very general answer:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;1 - 22:30 &amp;lt;br&amp;gt;Q: Did the paper consider Upstream patches(?) &amp;lt;br&amp;gt;A:No&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;2 - 23:00 &amp;lt;br&amp;gt;Q: Security issues with the pages &amp;lt;br&amp;gt;A:Pages pre-processor, no issue&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;3 - 24:10 &amp;lt;br&amp;gt;Q: What about blocking calls (read/write)? &amp;lt;br&amp;gt;A: Not handled&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;4 - 25:50 &amp;lt;br&amp;gt;Q: ? &amp;lt;br&amp;gt;A: Not a problem? (Personally didn&#039;t understand question, don&#039;t believe it&#039;s important, but anyone whose willing should double check)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;5 - 28:00 &amp;lt;br&amp;gt;Q: Compare pollution between user thread switching to user-kernel thread switching? &amp;lt;br&amp;gt;A: No, only looked at and measured pollution when switching user-to-kernel.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;6 - 29:30 &amp;lt;br&amp;gt;Q: Scheduling problems of what cores are &#039;system&#039; core, and what cores are &#039;user&#039; cores &amp;lt;br&amp;gt;A: Very simple algorithm, but not tested when running multiple apps, would need to be &amp;quot;fine-tuned&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;7 - 31:00 &amp;lt;br&amp;gt;Q: Situations where FlexSC is bad, when running less or equal threads to the number of cores, such as &amp;quot;Scientific programs&amp;quot;, mostly in userspace where one thread has 100% CPU resource &amp;lt;br&amp;gt;A: Agrees, FlexSC is not to be used for such situations&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;8 - 33:00 &amp;lt;br&amp;gt;Q: Problems with un-related threads demanding service, how does it scale? Issue with frequency of polling could cause sys calls to take time to preform &amp;lt;br&amp;gt;A: (Would be answered offline)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;9 - 34:30 &amp;lt;br&amp;gt;Q: Backwards compatability and robustness &amp;lt;br&amp;gt;A: Only an issue with getTID (Thread ID), needed a small patch.&lt;br /&gt;
&lt;br /&gt;
--[[User:Wlawrence|Wesley Lawrence]] 20:31, 29 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wrote information in Critique for questions 3, 6 and 7 (Blocking Calls, Core Scheduling Issues, and When There Are Not More Threads Then Cores). If you feel any additions need to be made, please feel free to add them. Most importantly, I&#039;m not sure how to cite these. All information as obtained from the mp3 of the presentation, could some one let me know how to go about citing this?&lt;br /&gt;
&lt;br /&gt;
--[[User:Wlawrence|Wesley Lawrence]] 21:05, 29 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to run through the whole paper, and just make sure everything makes sense, and fill in the holes where needed. I&#039;ll also add my own thoughts along the way. Feel free to do the same.-Rarteaga&lt;br /&gt;
&lt;br /&gt;
Added 3 sections to the critique, definitions for the remaining terms (thanks Corey for taking care of some of these) and did some editing. My plan is to add some more flesh to the FlexSC-Threads section.&lt;br /&gt;
I&#039;ll do that sometime before 3PM on Thursday. I&#039;ll also go over the paper at that time in case something needs some editing. --[[User:Tafatah|Tafatah]] 06:38, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
==Paper Summary==&lt;br /&gt;
I am not sure if everyone has taken the time to examine the paper closely, so I thought I would provide my notes on the paper so that anyone who has not read it could have a view of the high points.&lt;br /&gt;
&lt;br /&gt;
Abstract:&lt;br /&gt;
   - System calls are the accepted way to request services from the OS kernel, historical implementation.&lt;br /&gt;
   - System calls almost always synchronous &lt;br /&gt;
   - Aim to demonstrate how synchronous system calls negatively affect performance due mainly to pipeline flushing and pollution of key processor structures (TLB, data and instruction caches, etc.)&lt;br /&gt;
        o TLB is translation lookaside buffer which is uses pages (data and code pages) to speed up virtual translation speed.&lt;br /&gt;
   - Propose exception-less system calls to improve the current system call process.&lt;br /&gt;
        o Improve processor efficiency via enabling flexible scheduling of OS work which in turn reduces size of execution both in kernel and user space thus reducing pollution effects on processor structures.&lt;br /&gt;
   - Exception-less system calls especially effective on multi-core systems running multi-threaded applications.&lt;br /&gt;
   - FlexSC is an implementation of exception-less system calls in the Linux kernel with accompanying user-mode threads from FlexSC-Threads package.&lt;br /&gt;
        o Flex-SC-Threads convert legacy system calls into exception-less system calls.&lt;br /&gt;
Introduction:&lt;br /&gt;
   - Synchronous system calls have a negative impact on system performance due to:&lt;br /&gt;
        o Direct costs – mode switching&lt;br /&gt;
        o Indirect costs – pollution of important processor structures &lt;br /&gt;
   - Traditional system calls:&lt;br /&gt;
        o Involve writing arguments to appropriate registers as well as issuing a special machine instruction which raises a synchronous exception.&lt;br /&gt;
        o A processor exception is used to communicate with the kernel.&lt;br /&gt;
        o Synchronous execution is enforced as the application expects the completion of the system call before user-mode execution resumes.&lt;br /&gt;
   - Moore’s Law has provided large increases to performance potential of software while at the same time widening the gap between the performance of efficient and inefficient software.&lt;br /&gt;
        o This gap is mainly caused by disparity of accessing different processor resources (registers, caches, memory)&lt;br /&gt;
   - Server and system-intensive workloads are known to perform well below processor potential throughput.&lt;br /&gt;
        o These are the items the researchers are mostly interested in.&lt;br /&gt;
        o The cause is often described as due to the lack of locality.&lt;br /&gt;
        o The researchers state this lack of locality is in part a result of the current synchronous system calls.&lt;br /&gt;
   - When a synchronous system call, like pwrite, is called, the instruction per cycle level drops significantly and it takes many (in the example 14,000) cycles of execution for the instruction per cycle rate&lt;br /&gt;
 to return to the level it was at before the system (pwrite) call.&lt;br /&gt;
   - Exception-less System Call:&lt;br /&gt;
        o Request for kernel services that does not require the use of synchronous processor exceptions.&lt;br /&gt;
        o System calls are written to a reserved syscall page.&lt;br /&gt;
        o Execution of system calls is performed asynchronously by special kernel level syscall threads. The result of the execution is stored on the syscall page after execution.&lt;br /&gt;
   - By separating system call execution from system call invocation, the system can now have flexible system call scheduling.&lt;br /&gt;
        o This allows system calls to be executed in batches, increasing the temporal locality of execution.&lt;br /&gt;
        o Also provides a way to execute system calls on a separate core, in parallel to user-mode thread execution. This provides spatial per-core locality.&lt;br /&gt;
        o An additional side effect is that now a multi-core system can have individual cores designated to run either user-mode or kernel mode execution dynamically depending on the current system load.&lt;br /&gt;
   - In order to implement the exception-less system calls, the research team suggests adding a new M-on-N threading package.&lt;br /&gt;
        o M user-mode threads executing on N kernel-visible threads.&lt;br /&gt;
        o This would allow the threading package to harvest independent system calls, by switching threads, in user-mode, whenever a thread invokes a system call.&lt;br /&gt;
The (Real) Cost of System Calls&lt;br /&gt;
   - Traditional way to measure the performance cost of system calls is the mode switch time. This is the time necessary to execute the system call instruction in user-mode, resume execution in kernel mode and&lt;br /&gt;
 then return execution back to the user-mode.&lt;br /&gt;
   - Mode switch in modern processors is a processor exception.&lt;br /&gt;
        o Flush the user-mode pipeline, save registers onto the kernel stack, change the protection domain and redirect execution to the proper exception handler.&lt;br /&gt;
   - Another measure of the performance of a system call is the state pollution caused by the system call.&lt;br /&gt;
        o State pollution is the measure of how much user-mode data is overwritten in places like the TLB, cache (L1, L2, L3), branch prediction tables with kernel leel execution instructions for the system call. &lt;br /&gt;
        o This data must be re-populated upon the return to user-mode.&lt;br /&gt;
   - Potentially the most significant measure of cost of system calls is the performance impact on a running application.&lt;br /&gt;
        o Ideally, user-mode instructions per cycle should not decrease as a result of a system call.&lt;br /&gt;
        o Synchronous system calls do cause a drop in user-mode IPC  due to; direct overhead -  the processor exception associated with the system call which flushes the processor pipeline; and indirect overhead&lt;br /&gt;
 – system call pollution on processors structures.&lt;br /&gt;
Exception-less System calls:&lt;br /&gt;
   - System call batching&lt;br /&gt;
        o By delaying a series of system calls and executing them in batches you can minimize the frequency of mode switches between user and kernel mode.&lt;br /&gt;
        o Improves both the direct and indirect cost of system calls.&lt;br /&gt;
   - Core specialization&lt;br /&gt;
        o A system call can be scheduled on a different core then the core on which it was invoked, only for exception-less system calls.&lt;br /&gt;
        o Provides ability to designate a core to run all system calls.&lt;br /&gt;
   - Exception-less Syscall Interface&lt;br /&gt;
        o Set of memory pages shared between user and kernel modes. Referred to as Syscall pages.&lt;br /&gt;
        o User-space threads find a free entry in a syscall page and place a request for a system call. The user-space thread can then continue executing without interruption and must then return to the syscall&lt;br /&gt;
 page to get the return value from the system call.&lt;br /&gt;
        o Neither issuing the system call (via the syscall page) nor getting the return value generate an exception.&lt;br /&gt;
   - Syscall pages&lt;br /&gt;
        o Each page is a table of syscall entries.&lt;br /&gt;
        o Each syscall entre has a state:&lt;br /&gt;
                 Free – means a syscall can be added her&lt;br /&gt;
                 Submitted – means the kernel can proceed to invoke the appropriate system call operations.&lt;br /&gt;
                 Done – means the kernel is finished and has provided the return value to the syscall entry. User space thread must return and get the return value from the page.&lt;br /&gt;
   - Decoupling Execution from Invocation&lt;br /&gt;
        o To separate these two concepts a special kernel thread, syscall thread, is used.&lt;br /&gt;
        o Sole purpose is to pull requests from syscall pages and execute them always in kernel mode.&lt;br /&gt;
        o Syscall threads provide the ability to schedule the system calls on specific cores.&lt;br /&gt;
System Calls Galore – FlexSC-Threads&lt;br /&gt;
   - Programming for exception-less system calls requires a different and more complex way of interacting with the kernel for OS functionality.&lt;br /&gt;
        o The researchers describe working with exception-less system calls as being similar to event-driven programming in that you do not get the same sequential execution of code as you do with synchronous&lt;br /&gt;
 system calls.&lt;br /&gt;
        o In event-driven servers, the researchers suggest using a hybrid of both exception-less system calls (for performance critical paths) and regular synchronous system calls (for less critical system calls).&lt;br /&gt;
FlexSC-Threads&lt;br /&gt;
   - Threading package which transforms synchronous system calls into exception-less system calls.&lt;br /&gt;
   - Intended use is with server-type applications with which have many user-mode threads (like Apache or MySQL).&lt;br /&gt;
   - Compatible with both POSIX threads and the default Linux thread library.&lt;br /&gt;
        o As a result, multi-threaded Linux programs are immediately compatible with FlexSC threads without modification.&lt;br /&gt;
   - For multi-core systems, a single kernel level thread is created for each core of the system. Multiple user-mode threads are multiplexed onto each kernel level thread via interactions with the syscall pages.&lt;br /&gt;
        o The syscall pages are private to each kernel level thread, this means each core of a system has a syscall page from which it will receive system calls.&lt;br /&gt;
Overhead:&lt;br /&gt;
   - When running a single exception-less system call against a single synchronous system call, the exception-less call was slower.&lt;br /&gt;
   - When running a batch of exception-less system calls compared to a bunch of synchronous system calls, the exception-less system calls were much faster.&lt;br /&gt;
   - The same is true for a remote server situation, one synchronous call is much faster than one exception-less system call but a batch of exception-less system calls is faster than the same number&lt;br /&gt;
 of synchronous system calls.&lt;br /&gt;
Related Work:&lt;br /&gt;
   - System Call Batching&lt;br /&gt;
        o Operating systems have a concept called multi-calls which involves collecting multiple system calls and submitting them as a single system call.&lt;br /&gt;
        o The Cassyopia compiler has an additional process called a looped multi-call where the result of one system call can be fed as an argument to another system call in the same multi-call.&lt;br /&gt;
        o Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls do.&lt;br /&gt;
                 Multi-call system calls are executed sequentially, each one must complete before the next may start.&lt;br /&gt;
   - Locality of Execution and Multicores&lt;br /&gt;
        o Other techniques include Soft Timers and Lazy Receiver Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to&lt;br /&gt;
 limit processor interference associated with interrupt handling without affecting the latency of servicing requests.&lt;br /&gt;
        o Computation Spreading is another locality process which is similar to FlexSC.&lt;br /&gt;
                 Processor modifications that allow hardware migration of threads and migration to specialized cores.&lt;br /&gt;
                 Did not model TLBs and on current hardware synchronous thread migration is a costly interprocessor interrupt.&lt;br /&gt;
        o Also have proposals for dedicating CPU cores to specific operating system functionality.&lt;br /&gt;
                 These solutions require a microkernel system.&lt;br /&gt;
                 Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically.&lt;br /&gt;
   - Non-blocking Execution&lt;br /&gt;
        o Past research on improving system call performance has focused on blocking versus non-blocking behaviour.&lt;br /&gt;
                 Typically researchers used threading, event-based (non-blocking) and hybrid systems to obtain high performance on server applications.&lt;br /&gt;
        o Main difference between past research and FlexSC is that none of the past proposals have decoupled system call execution from system call invocation.&lt;br /&gt;
--[[User:Mike Preston|Mike Preston]] 04:03, 20 November 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6232</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6232"/>
		<updated>2010-12-02T06:28:09Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Producer-Consumer Problem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6231</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6231"/>
		<updated>2010-12-02T06:27:53Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Instructions Per Cycle (IPC) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6230</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6230"/>
		<updated>2010-12-02T06:26:12Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Inter-Process Interrupt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6229</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6229"/>
		<updated>2010-12-02T06:25:25Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Syscall Threads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
Syscall threads is FlexSC&#039;s method to allow exception-less system calls. A syscall thread shares its process virtual address space [1].&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6226</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6226"/>
		<updated>2010-12-02T06:15:29Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Syscall Page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value [1].&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6225</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6225"/>
		<updated>2010-12-02T06:14:55Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Syscall Page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay. It is essential for one to comprehend the basic concepts of the language that is spoken in the paper in order to fully understand the ideas that are being discussed. The most important notions discussed in the FlexSC paper that are at the core of it all, are System calls[21], and Sychronous systems. These base definitons along with numerous other helpful ideas can be understood through the section of the paper to follow. &lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. It is more vital to the reader to understand the core ideas of these defintions along with the underlying motivation for there existance, then to understand the miniscule details of their processes. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
A syscall page is a collection of syscall entries. In turn, a sysentry is a 64-byte data structure, which includes information such as syscall number, number of arguments,&lt;br /&gt;
the arguments, status, and return value.&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[21] DeveloperWorks, Kernel Command using Linux System Calls IBM,2010.[http://www.ibm.com/developerworks/linux/library/l-system-calls/ ]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6160</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6160"/>
		<updated>2010-12-02T03:58:07Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Regular Store Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
A store instruction simply refers to a typical assembly language instruction, where, usually, there are two arguments. A value, and a memory location, where that value should be stored.&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86, and other binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6125</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6125"/>
		<updated>2010-12-02T03:22:19Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Lack of Locality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
As per paper, locality refers to both types of locality, i.e. temporal and spatial, defined above. Thus, lack of locality here means data and instructions needed most frequently by the application continues to be switched back and forth (from registers and caches) due to system calls, attributing hence, to performance degradation.&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86 binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes. System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized by Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6047</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6047"/>
		<updated>2010-12-02T00:53:46Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86 binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized in Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/ HTML] and Linux application page. [http://www.linux.org/apps/AppId_8088.html HTML]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf HTML]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6045</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6045"/>
		<updated>2010-12-02T00:51:02Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86 binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized in Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498 HTML]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/] and Linux application page. [http://www.linux.org/apps/AppId_8088.html]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6040</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6040"/>
		<updated>2010-12-02T00:44:28Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Critique: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86 binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by disparity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized in Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the FlexSC scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/] and Linux application page. [http://www.linux.org/apps/AppId_8088.html]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6033</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6033"/>
		<updated>2010-12-02T00:35:36Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Not Done Yet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I did some of these, some I don&#039;t think I can adequately explain, or just have no idea what they are, so I left them. --[[User:CFaibish|CFaibish]] 00:31, 2 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
===Translation Look-Aside Buffer (TLB)===&lt;br /&gt;
A TLB is a table used in a virtual memory system that lists the physical address page number associated with each virtual address page number. A TLB is used in conjunction with a cache whose tags are based on virtual addresses. The virtual address is presented simultaneously to the TLB and to the cache so that cache access and the virtual-to-physical address translation can proceed in parallel. If the requested address is not cached then the physical address is used to locate the data in main memory. &lt;br /&gt;
&lt;br /&gt;
The TLB is the reason context switches can have such large performance penalties. Every time the OS switches context, the entire buffer is flushed. When the process resumes, it must be rebuilt from scratch. Too many context switches will therefore cause an increase in cache misses and degrade performance.[17]&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux Application Binary Interface (ABI)===&lt;br /&gt;
The ABI is a patch to the kernel that allows you to run SCO, Xenix, Solaris ix86 binaries on Linux.[18]&lt;br /&gt;
&lt;br /&gt;
===Native POSIX Thread Library (NPTL)===&lt;br /&gt;
NPTL is a software component that allows the Linux kernel to run applications optimized for POSIX Thread efficiency.[19]&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
Latency is a measure of the time delay between the start of an action and its completion in a system.[20]&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===IO === &lt;br /&gt;
FlexSC is not suited for data intensive, IO centric applications, as realized in Vijay Vasudevan [16]. Vijay&#039;s research aims to reduce the energy footprint in data centers. FlexSC&amp;lt;br&amp;gt;&lt;br /&gt;
was considered. It was found that FlexSC&#039;s reduction of mode switches, via the use of shared memory pages between user space and kernel space is useful for reducing the impact&amp;lt;br&amp;gt;&lt;br /&gt;
of system calls. That technique however was not useful for IO intensive work since it did not remove the requirement of data copying and did not reduce the overheads associated&amp;lt;br&amp;gt;&lt;br /&gt;
with interrupts in IO intensive tasks.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Some Kernel Changes Are Required===&lt;br /&gt;
Though most of the work is done transparently. i.e. there is no need for application&#039;s code modification, there remains a need for small kernel change (3 lines of code), as per section 3.2 of the paper [1].&amp;lt;br&amp;gt;&lt;br /&gt;
That means adopters, and after each update of the kernel, would have to add/modify the referenced lines and then recompile the kernel.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Multicore Systems ===&lt;br /&gt;
For a multicore system, the Flex scheduler will attempt to choose a subset of the available cores and specialize them for running system call threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for system call threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work. On a related note, scalability with increased cores is ambiguous. It is not that clear how scalable the&amp;lt;br&amp;gt;&lt;br /&gt;
scheduler is. One gets the impression that it is very scalable due to the fact that each core spawns a system call thread. Thus, as many threads as there are cores could be running&amp;lt;br&amp;gt;&lt;br /&gt;
concurrently, for one or more processes [1]. More explicit results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis&amp;lt;br&amp;gt;&lt;br /&gt;
of the results. Understandable, however, it would be nice to know if these threads (2 per core) would actually be treated as a core when turned on ? I.e. would the scheduler then realize&amp;lt;br&amp;gt;&lt;br /&gt;
that it can use eight cores ? Does that also mean the predefined static cores list would need to be modified, to list eight instead of four ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Along the same reasoning, and given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
outcome when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example. Would FlexSC&#039;s scheduler be able to take advantage of the additional cores, and hence use them for&amp;lt;br&amp;gt;&lt;br /&gt;
specialized purposes ?&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[17] Patricia J. Teller &amp;lt;i&amp;gt;Translation-Lookaside Buffer Consistency&amp;lt;/i&amp;gt;, Journal Volume 23 Issue 6, IBM T. J. Watson Research Center, Yorktown Heights, NY, June 1990. [http://dx.doi.org/10.1109/2.55498]&lt;br /&gt;
&lt;br /&gt;
[18] Linux ABI sourceforge page. [http://linux-abi.sourceforge.net/] and Linux application page. [http://www.linux.org/apps/AppId_8088.html]&lt;br /&gt;
&lt;br /&gt;
[19] DREPPER, U., AND MOLNAR , I. &amp;lt;i&amp;gt;The Native POSIX Thread Library for Linux&amp;lt;/i&amp;gt;. Tech. rep., RedHat Inc, 2003. [http://people.redhat.com/drepper/nptl-design.pdf]&lt;br /&gt;
&lt;br /&gt;
[20] M. Brian Blake, &amp;lt;i&amp;gt;Coordinating Multiple Agents for Workflow-Oriented Process Orchestration&amp;lt;/i&amp;gt;. Information Systems and e-Business Management Journal, Springer-Verlag, December 2003. [http://www.cs.georgetown.edu/~blakeb/pubs/blake_ISEB2003.pdf]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6006</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6006"/>
		<updated>2010-12-01T23:51:11Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===Not Done Yet===&lt;br /&gt;
The following will be finalized on Wed. --[[User:Tafatah|Tafatah]] 02:26, 1 December 2010 (UTC)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; START &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Good&amp;lt;br&amp;gt;&lt;br /&gt;
Most of the work is done transparently. i.e. there is no need for application&amp;lt;br&amp;gt;&lt;br /&gt;
code modification.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Not for IO intensive tasks&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Small kernel change (3 lines of code as per section 3.2). That means adopters, and&amp;lt;br&amp;gt;&lt;br /&gt;
after each update of the kernel, would have to add/modify the referenced lines and&amp;lt;br&amp;gt;&lt;br /&gt;
then recompile the kernel&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a multicore system (section 3, mostly 3.5), the Flex scheduler will attempt to choose a subset of the available cores and specialize them for running syscall threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for syscall threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scaling with increased cores is ambiguous&amp;lt;br&amp;gt;&lt;br /&gt;
Further, it is not that clear how scalable the scheduler is. One gets the impression that it is very scalable due to the fact that each core&amp;lt;br&amp;gt;&lt;br /&gt;
spawns a syscall thread. Thus, as many threads as there are cores could be running concurrently, including for the same process. More explicit&amp;lt;br&amp;gt;&lt;br /&gt;
results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis of the results.&amp;lt;br&amp;gt;&lt;br /&gt;
Understandable, however, it would be nice to know if these threads ( 2 per core ) would actually be treated as a core when turned on ? I.e. would&amp;lt;br&amp;gt;&lt;br /&gt;
the scheduler then realize that it can use eight cores ? Does that also mean the predefined static cores list would have to be modified ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
No testing with GPU&amp;lt;br&amp;gt;&lt;br /&gt;
Given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve 	been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
effects when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; END &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. &amp;lt;i&amp;gt;Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes&amp;lt;/i&amp;gt;, Thesis Proposal, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010.[http://www.cs.cmu.edu/~vrv/proposal/vijay_thesis_proposal.pdf PDF]&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6004</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6004"/>
		<updated>2010-12-01T23:48:17Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===Not Done Yet===&lt;br /&gt;
The following will be finalized on Wed. --[[User:Tafatah|Tafatah]] 02:26, 1 December 2010 (UTC)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; START &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Good&amp;lt;br&amp;gt;&lt;br /&gt;
Most of the work is done transparently. i.e. there is no need for application&amp;lt;br&amp;gt;&lt;br /&gt;
code modification.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Not for IO intensive tasks&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Small kernel change (3 lines of code as per section 3.2). That means adopters, and&amp;lt;br&amp;gt;&lt;br /&gt;
after each update of the kernel, would have to add/modify the referenced lines and&amp;lt;br&amp;gt;&lt;br /&gt;
then recompile the kernel&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a multicore system (section 3, mostly 3.5), the Flex scheduler will attempt to choose a subset of the available cores and specialize them for running syscall threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for syscall threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scaling with increased cores is ambiguous&amp;lt;br&amp;gt;&lt;br /&gt;
Further, it is not that clear how scalable the scheduler is. One gets the impression that it is very scalable due to the fact that each core&amp;lt;br&amp;gt;&lt;br /&gt;
spawns a syscall thread. Thus, as many threads as there are cores could be running concurrently, including for the same process. More explicit&amp;lt;br&amp;gt;&lt;br /&gt;
results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis of the results.&amp;lt;br&amp;gt;&lt;br /&gt;
Understandable, however, it would be nice to know if these threads ( 2 per core ) would actually be treated as a core when turned on ? I.e. would&amp;lt;br&amp;gt;&lt;br /&gt;
the scheduler then realize that it can use eight cores ? Does that also mean the predefined static cores list would have to be modified ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
No testing with GPU&amp;lt;br&amp;gt;&lt;br /&gt;
Given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve 	been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
effects when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; END &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes. THESIS PROPOSAL, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, October 12, 2010, P 19.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6003</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=6003"/>
		<updated>2010-12-01T23:46:30Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===Not Done Yet===&lt;br /&gt;
The following will be finalized on Wed. --[[User:Tafatah|Tafatah]] 02:26, 1 December 2010 (UTC)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; START &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Good&amp;lt;br&amp;gt;&lt;br /&gt;
Most of the work is done transparently. i.e. there is no need for application&amp;lt;br&amp;gt;&lt;br /&gt;
code modification.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Not for IO intensive tasks&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Small kernel change (3 lines of code as per section 3.2). That means adopters, and&amp;lt;br&amp;gt;&lt;br /&gt;
after each update of the kernel, would have to add/modify the referenced lines and&amp;lt;br&amp;gt;&lt;br /&gt;
then recompile the kernel&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a multicore system (section 3, mostly 3.5), the Flex scheduler will attempt to choose a subset of the available cores and specialize them for running syscall threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for syscall threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scaling with increased cores is ambiguous&amp;lt;br&amp;gt;&lt;br /&gt;
Further, it is not that clear how scalable the scheduler is. One gets the impression that it is very scalable due to the fact that each core&amp;lt;br&amp;gt;&lt;br /&gt;
spawns a syscall thread. Thus, as many threads as there are cores could be running concurrently, including for the same process. More explicit&amp;lt;br&amp;gt;&lt;br /&gt;
results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis of the results.&amp;lt;br&amp;gt;&lt;br /&gt;
Understandable, however, it would be nice to know if these threads ( 2 per core ) would actually be treated as a core when turned on ? I.e. would&amp;lt;br&amp;gt;&lt;br /&gt;
the scheduler then realize that it can use eight cores ? Does that also mean the predefined static cores list would have to be modified ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
No testing with GPU&amp;lt;br&amp;gt;&lt;br /&gt;
Given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve 	been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
effects when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; END &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;br /&gt;
&lt;br /&gt;
[16] Vasudevan, Vijay. Improving Datacenter Energy Efficiency Using a Fast Array of Wimpy Nodes. THESIS PROPOSAL, October 12, 2010, Computer Science Department, Carnegie Mellon University, Pittsburgh, PA.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5881</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5881"/>
		<updated>2010-12-01T02:26:55Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Critique: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
===Not Done Yet===&lt;br /&gt;
The following will be finalized on Wed. --[[User:Tafatah|Tafatah]] 02:26, 1 December 2010 (UTC)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; START &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Good&amp;lt;br&amp;gt;&lt;br /&gt;
Most of the work is done transparently. i.e. there is no need for application&amp;lt;br&amp;gt;&lt;br /&gt;
code modification.&amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Not for IO intensive tasks&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Small kernel change (3 lines of code as per section 3.2). That means adopters, and&amp;lt;br&amp;gt;&lt;br /&gt;
after each update of the kernel, would have to add/modify the referenced lines and&amp;lt;br&amp;gt;&lt;br /&gt;
then recompile the kernel&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a multicore system (section 3, mostly 3.5), the Flex scheduler will attempt to choose a subset of the available cores and specialize them for running syscall threads. It is unclear how the dynamic&amp;lt;br&amp;gt;&lt;br /&gt;
allocation is done. It is mentioned that decisions are made based on the workload requirements, which doesn&#039;t exactly clarify the mechanism.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further, the paper mentions that a predefined, static list of cores is used for syscall threads assignments. It is unclear when that list is created. Is it at installation time,&amp;lt;br&amp;gt;&lt;br /&gt;
is it generated initially, or does the installer have to do any manual work.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scaling with increased cores is ambiguous&amp;lt;br&amp;gt;&lt;br /&gt;
Further, it is not that clear how scalable the scheduler is. One gets the impression that it is very scalable due to the fact that each core&amp;lt;br&amp;gt;&lt;br /&gt;
spawns a syscall thread. Thus, as many threads as there are cores could be running concurrently, including for the same process. More explicit&amp;lt;br&amp;gt;&lt;br /&gt;
results however would&#039;ve been beneficial. Further, the paper mentions that hyper-threading was turned off to ease the analysis of the results.&amp;lt;br&amp;gt;&lt;br /&gt;
Understandable, however, it would be nice to know if these threads ( 2 per core ) would actually be treated as a core when turned on ? I.e. would&amp;lt;br&amp;gt;&lt;br /&gt;
the scheduler then realize that it can use eight cores ? Does that also mean the predefined static cores list would have to be modified ?&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
No testing with GPU&amp;lt;br&amp;gt;&lt;br /&gt;
Given the growing popularity of GPU&#039;s use for general programming, it would&#039;ve 	been useful to at-least hypothesize on the possible performance&amp;lt;br&amp;gt;&lt;br /&gt;
effects when using specialized GPUs, like NVIDIA&#039;s Tesla GPUs for example.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; END &amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5790</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5790"/>
		<updated>2010-11-30T19:26:59Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Throughput */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
Is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2. P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5789</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5789"/>
		<updated>2010-11-30T19:25:34Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Throughput */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
is an indication of how much work is done during a unit of time. E.g. n transactions per hour. The higher n is, the better. [2 P151]&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5743</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5743"/>
		<updated>2010-11-30T16:34:20Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Background Concepts: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
===Producer-Consumer Problem ===&lt;br /&gt;
Note: explain the relationship &lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5742</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5742"/>
		<updated>2010-11-30T16:31:10Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Background Concepts: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
===Inter-Process Interrupt ===&lt;br /&gt;
&lt;br /&gt;
===Latency ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5738</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5738"/>
		<updated>2010-11-30T16:20:15Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Background Concepts: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode switch which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation look-aside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpectedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendency for the same set of data to be accessed repeatedly over a brief time period. There are two important forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
===Linux ABI ===&lt;br /&gt;
&lt;br /&gt;
===NPTL ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Page ===&lt;br /&gt;
&lt;br /&gt;
===Syscall Threads ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5733</id>
		<title>COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_2_2010_Question_3&amp;diff=5733"/>
		<updated>2010-11-30T16:13:18Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Background Concepts: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3.FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
The Title of the paper we will be analyzing is named &amp;quot;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;quot;. The authors of this paper consist of Livio Stores and Michael Stumm, both of which are from the University of Toronto. The paper can be viewed here, [http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf] for further details on specifics of the essay.&lt;br /&gt;
== Background Concepts: ==&lt;br /&gt;
&lt;br /&gt;
In order to fully understand the FlexSC paper, it is essential to understand the key concepts that are discussed within the paper. Here listed below, are the main concepts required to fully comprehend the paper. &lt;br /&gt;
&lt;br /&gt;
===System Call===&lt;br /&gt;
A &amp;lt;b&amp;gt;System Call&amp;lt;/b&amp;gt; is the gateway between the User Space and the Kernel Space. The User Space is not given direct access to the Kernel&#039;s services, for several reasons (one being security), hence System calls are the messengers between the User and Kernel Space.[1][4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Mode Switch===&lt;br /&gt;
&amp;lt;b&amp;gt;Mode Switches&amp;lt;/b&amp;gt; speak of moving from one medium to another. Specifically moving from the User Space mode to the Kernel mode or Kernel mode to User Space. It does not matter which direction or which modes we are swtiching from, this is simply a general term. Crucial to mode switching is the &amp;lt;b&amp;gt;mode switch time&amp;lt;/b&amp;gt; which is the time necessary to execute a system call instruction in user-mode, perform the kernel mode execution of the system call, and finally return the execution back to user-mode.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Synchronous System Call===&lt;br /&gt;
&amp;lt;b&amp;gt;Synchronous Execution Model(System call Interface)&amp;lt;/b&amp;gt; refers to the structure in which system calls specifically are managed in a serialized manner. Moreover, the synchronous model completes one system call at a time, and does not move onto the next system call until the previous system call is finished executing. This form of system call is blocking, meaning the process which initiates the system call is blocked until the system call returns. Traditionally, operating system calls are mostly synchronous system calls.[1][2]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Asynchronous System Call===&lt;br /&gt;
An &amp;lt;b&amp;gt;asynchronous system call&amp;lt;/b&amp;gt; is a system call which does not block upon invocation; control of execution is returned to the calling process immediately. Asynchronous system calls do not necessarily execute in order and can be compared to event driven programming.[2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Pollution===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Pollution&amp;lt;/b&amp;gt; is a more sophisticated manner of referring to wasteful or un-necessary delay in the system caused by system calls. This pollution is in direct correlation with the fact that the system call invokes a mode swtich which is not a costless task. The &amp;quot;pollution&amp;quot; involved takes the form of data over-written in critical processor structures like the TLB (translation lookaside buffer - table which reduces the frequency of main memory access for page table entries), branch prediction tables, and the cache (L1, L2, L3).[1][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Processor Exceptions===&lt;br /&gt;
&amp;lt;b&amp;gt;Processor exceptions&amp;lt;/b&amp;gt; are situations which cause the processor to stop current execution unexpetedly in order to handle the issue. There are many situations which generate processor exceptions including undefined instructions and software interrupts(system calls).[5]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&amp;lt;b&amp;gt;System Call Batching&amp;lt;/b&amp;gt; is the concept of collecting system calls together to be executed in a group instead of executing them immediately after they are called.[6]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temporal and Spatial Locality===&lt;br /&gt;
Locality is the concept that during execution there will be a tendancy for the same set of data to be accessed repeatedly over a brief time period. There are two imprtant forms of locality; &amp;lt;b&amp;gt; spatial locality&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;temporal locality&amp;lt;/b&amp;gt;. Spatial locality refers to the pattern that memory locations in close physical proximity will be referenced close together in a short period of time. Temporal locality, on the other hand, is the tendency of recently requested memory locations to be requested again.[7][8]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Instructions Per Cycle (IPC)===&lt;br /&gt;
&amp;lt;b&amp;gt;Instructions per cycle&amp;lt;/b&amp;gt; is the amount of instructions a processor can execute in a single clock cycle.[9]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will add the following terms.&amp;lt;br&amp;gt;&lt;br /&gt;
TODO-Start --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
===TLB ===&lt;br /&gt;
&lt;br /&gt;
===Lack of Locality ===&lt;br /&gt;
&lt;br /&gt;
===Throughput ===&lt;br /&gt;
&lt;br /&gt;
===Regular Store Instructions ===&lt;br /&gt;
&lt;br /&gt;
TODO End --[[User:Tafatah|Tafatah]] 16:13, 30 November 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Research Problem: ==&lt;br /&gt;
System calls provide an interface for user-mode applications to request services from the operating system. Traditionally, the system call interface has been implemented using synchronous system calls, which block the calling user-space process when the system call is initiated. The benefit of using synchronous system calls comes from the easy to program nature of having sequential operation. However, this ease of use also comes with undesireable side effects which can slow down the instructions per cycle (IPC) of the processor.[9] In &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, Soares and Stumm attempt to provide a new form of system call which minimizes the negative effects of synchronous system calls while still remaining easy to implement for application programmers.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The negative effects of synchronous system calls have been researched heavily, it is accepted that although easy to use, they are not optimal. Previous research includes work into &amp;lt;b&amp;gt;system call batching&amp;lt;/b&amp;gt; such as multi-calls[6], &amp;lt;b&amp;gt;locality of execution with multicore systems&amp;lt;/b&amp;gt;[7][8], and &amp;lt;b&amp;gt;non-blocking execution&amp;lt;/b&amp;gt;. System call batching shares great similarity with FlexSC as multiple system calls are grouped together to reduce the amount of mode switches required of the system.[6] The difference is multi-calls do not make use of parallel execution of system calls nor do they manage the blocking aspect of synchronous system calls. FlexSC describes methods to handle both of these situations as described in the &amp;lt;b&amp;gt;Contribution&amp;lt;/b&amp;gt; section of this document.[1] Previous research into locality of execution and multicore systems has focused on managing device interrupts and limiting processor interference associated with interrupt handling.[7][8] However, these solutions require a microkernel solution and although they can dedicate certain execution to specific cores of a system, they can not dynamically adapt to the proportion of cores used by the kernel and the cores shared between the kernel and the user like FlexSC can.[1] Non-blocking execution research has focused on threading, event-based (non-blocking) and hybrid solutions. However, FlexSC provides a mechanism to separate system call execution from system call invocation. This is a key difference between FlexSC and previous research.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contribution: ==&lt;br /&gt;
&lt;br /&gt;
===Exception-Less System Calls===&lt;br /&gt;
Exception-less system calls are the research team&#039;s attempt to provide an alternative to synchronous systems calls. The downside to synchronous system calls includes the cumulative mode switch time of multiple system calls each called independently, state pollution of key processor structures (TLB, cache, etc.)[1][3], and, potentially the most crucial, the performance impact on the user-mode application during a system call. Exception-less system calls attempt to resolve these three issues through:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
1. &amp;lt;u&amp;gt;System Call Batching:&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Instead of having each system call run as soon as it is called, FlexSC instead groups together system calls into batches. These batches can then be executed at one time thus minimizing the     frequency of mode switches bewteen user and kernel modes. Batching provides a benefit both in terms of the direct cost of mode switching as well as the indirect cost, pollution of critical processor structures, associated with switching modes.[1] System call batching works by first requesting as many system calls as possible, then switching to kernel mode, and then executing each of them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2. &amp;lt;u&amp;gt;Core Specialization&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
On a multi-core system, FlexSC can provide the ability to designate a single core to run all system calls. The reason this is possible is that for an exception-less system call, the system call execution is decoupled from the system call invocation. This is described further in &amp;lt;b&amp;gt;Decoupling Execution from Invocation&amp;lt;/b&amp;gt; section below.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
3. &amp;lt;u&amp;gt;Exception-less System Call Interface&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To provide an asynchronous interface to the kernel, FlexSC uses &amp;lt;b&amp;gt;syscall pages&amp;lt;/b&amp;gt;. Syscall pages are a set of memory pages shared between user-mode and kernel-mode. User-space threads interact with syscall pages in order to make a request (system call) for kernel-mode procedures. A user-mode thread may make a system call request on a free entry of a syscall page, the syscall page will then run once the batch condition is met and store the return value on the syscall page. The user-mode thread can then return to the syscall page to obtain the return value. Neither issuing the system call via the syscall page nor getting the return value from the syscall page generate a processor exception. Each syscall page is a table of syscall entries. These entries may have one of three states: &amp;lt;b&amp;gt;Free&amp;lt;/b&amp;gt; - meaning a syscall can be added to the entry; &amp;lt;b&amp;gt;Submitted&amp;lt;/b&amp;gt; - meaning the kernel can proceed to invoke the appropriate system call operations; and &amp;lt;b&amp;gt;Done&amp;lt;/b&amp;gt; - meaning the kernel is finished and the return value is ready for the user-mode thread to retrieve it.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
4. &amp;lt;u&amp;gt;Decoupling Execution from Invocation&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to separate a system call invocation from the execution of the system call, &amp;lt;b&amp;gt;syscall threads&amp;lt;/b&amp;gt; were created. The sole purpose of syscall threads is to pull requests from syscall pages and execute the request, always in kernel mode. This is the mechanic that allows exception-less system calls to provide the ability for a user-mode thread to issue a request and continue to run while the kernel level system call is being executed. In addition, since the system call invocation is separate from execution, a process running on one core may request a system call yet the execution of the system call may be completed on an entirely different core. This allows exception-less system calls the unique capability of having all system call execution delegated to a specific core while other cores maintain user-mode execution.[1]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FlexSC Threads===&lt;br /&gt;
As mentioned above, FlexSC threads are a key component of the exception-less system call interface. FlexSC threads transform regular, synchronous system calls into exception-less system calls and are compatible with both the POSIX and default Linux thread libraries. This means that FlexSC Threads are immediately capable of running multi-threaded Linux applications with no modifications. The intended use of these threads is with server-type applications which contain many user-mode threads. In order to accomodate multiple user-mode threads, the FlexSC interface provides a syscall page for each core of a system. In this manner, multiple user-mode threads can be multiplexed onto a single syscall page which in turn has a single kernel level thread to facilitate execution of the system calls. Programming with FlexSC threads can be compared to event-driven programming as interactions are not guaranteed to be sequential. This does increase the complexity of programming for an exception-less system call interface as compared to the relatively simple synchronous system call interface.[1][2][3]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Critique: ==&lt;br /&gt;
&lt;br /&gt;
===Moore&#039;s Law===&lt;br /&gt;
One interesting aspect of this paper is how the research relates to Moore&#039;s Law. Moore&#039;s Law states that the number of transistors on a chip doubles every 18 months.[10]. This has lead to very large increases in the performance potential of software but at the same time has opened a large gap between the actual performance of efficient and inefficient software. This paper claims that the gap is mainly caused by dispairity of accessing different processor resources such as registers, cache and memory.[1] In this manner, the FlexSC interface is not just an attempt to increase the efficiency of current system calls, but it is actually an attempt to change the way we view software. It is not simply enough to continue to build more powerful machines if the code we currently run will not speed up (become more efficient) along with the gain of power. Instead we need to focus on appropriate allocation and usage of the power as failure to do so is the origination of the gap between our potential and our performance.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Performance of FlexSC===&lt;br /&gt;
It is of particular interest to note that exception-less system calls only outperformed synchronous system calls when the system was running multiple system calls. For an individual system call, the overhead of the FlexSC interface was greater than a synchronous call. The real benefit of FlexSC comes when there are many system calls which can be in turn batched before execution. In this situation the FlexSC system far outperformed the traditional synchronous system calls.[1] This is why the research paper&#039;s focus is on server-like applications as server must handle many user requests efficiently to be useful. Thus, for a general case it appears that a hybrid solution of synchronous calls below some threshold and execption-less system calls above the same threshold would be most efficient.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blocking Calls===&lt;br /&gt;
FlexSC relies on the fact that web and database servers have a lot of concurrency and independent parallelism. FlexSC can &#039;harvest&#039; enough independent work so that it doesn&#039;t need to track dependencies between system calls. However, this could be a problem in other situations. Since FlexSC system calls are &#039;inherently asynchronous&#039;, if they need to block, FlexSC would jump to the next system call and execute that one. This can cause a problem for system calls such as reading and writing, where the write call has an outstanding dependency on the read call. However, this could be resolved by using some kind of combined system call, that is, multiple system calls executed as one single call. Unfortunately, FlexSC does not have any current handling for such an implementation.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Core Scheduling Issues===&lt;br /&gt;
In a system with X cores, FlexSC needs to dedicate some subset of cores for system calls. Currently, FlexSC first wakes up core X to run a system call thread, and when another batch comes in, if core X is still busy, it will then try core X-1, and so on. Of all the algorithms they tested, it turned out that this, the simplest algorithm, was the most efficient algorithm for FlexSC scheduling. However, this was only tested with FlexSC running a single application at a time. FlexSC&#039;s scheduling algorithm would need to be fine-tuned for running multiple applications.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===When There Are Not More Threads Then Cores===&lt;br /&gt;
In situations where there is a single thread using 100% of a CPU, and acting primarily in user-space, such as &#039;Scientific Programs&#039;, FlexSC causes more overhead then performance gains. As a result, FlexSC is not an optimal implementation for cases such as this.&lt;br /&gt;
&lt;br /&gt;
== Related Work: ==&lt;br /&gt;
&lt;br /&gt;
===System Call Batching===&lt;br /&gt;
&lt;br /&gt;
Muti-calls is a concept which involves collecting multiple system calls and submitting them as a single system call. It is used both in operating systems and paravirtualized hypervisors. The Cassyopia compiler has a special technique name a looped multi-call, which is an additional process where the result of one system call can be fed as an argument to another system call in the same multi-call.[11] There is a significant difference between multi-calls and exception-less system calls. Multi-calls do not investigate parallel execution of system calls, nor do they address the blocking of system calls like exception-less system calls. Multi-call system calls are executed sequentially, each one must complete before the next may start. On the other hand, exception-less system calls can be executed in parallel, and in the presence of blocking, the next call can execute immediately.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Locality of Execution and Multicores===&lt;br /&gt;
&lt;br /&gt;
Several techniques addressed the issue of locality of execution. Larus and Parkes proposed Cohort Scheduling to efficiently execute staged computations.[12] Other techniques include Soft Timers[13] and Lazy Receiver[14] Processing which try to tackle the issue of locality of execution by handling device interrupts. They both try to limit processor interference associated with interrupt handling without affecting the latency of servicing requests. Another technique name Computation Spreading[15] is most similar to the multicore execution of FlexSC. Processor modifications that allow hardware migration of threads and migration to specialized cores. However, they did not model TLBs on current hardware synchronous thread migration is a costly interprocessor interrupt. Another solution has 2 difference between FlexSC. They require a micro-kernel. Also FlexSC can dynamically adapt the proportion of cores used by the kernel or cores shared by user and kernel execution dynamically. While all these solutions rely on expensive inter-processor interrupts to offload system calls, FlexSC could provide a more efficient, and flexible mechanism.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Non-blocking Execution===&lt;br /&gt;
&lt;br /&gt;
Past research on improving system call performance has focused extensively on blocking versus non-blocking behavior. Typically researchers used threading, event-based, which is non-blocking and hybrid systems to obtain high performance on server applications. The main difference between many of the proposals for non-blocking execution and FlexSC is that none of the non-blocking system calls have decoupled the system call invocation from its execution.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References: ==&lt;br /&gt;
[1] Soares, Livio and Michael Stumm, &amp;lt;i&amp;gt;FlexSC: Flexible System Call Scheduling with Exception-Less System Calls&amp;lt;/i&amp;gt;, University of Toronto, 2010.[http://www.usenix.org/events/osdi10/tech/full_papers/Soares.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[2] Tanenbaum, Andrew S., &amp;lt;i&amp;gt;Modern Operating Systems: 3rd Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2008.&lt;br /&gt;
&lt;br /&gt;
[3] Stallings, William, &amp;lt;i&amp;gt;Operating Systems: Internals and Design Principles - 6th Edition&amp;lt;/i&amp;gt;, Pearson/Prentice Hall, New Jersey, 2009.&lt;br /&gt;
&lt;br /&gt;
[4] Garfinkel, Tim, &amp;lt;i&amp;gt;Traps and Pitfalls: Practical Problems in System Call Interposition Based Security Tools&amp;lt;/i&amp;gt;, Computer Science Department - Stanford University.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2695&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[5] Yoo, Sunjoo &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Automatic Generation of Fast Timed Simulation Models for Operating Systems in SoC Design&amp;lt;/i&amp;gt;, SLS Group, TIMA Laboratory, Grenoble, 2002.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.1148&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[6] Rajagopalan, Mohan &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Cassyopia: Compiler Assisted System Optimization&amp;lt;/i&amp;gt;, Poceedings of HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, Lihue, Hawaii, 2003.[https://www.usenix.org/events/hotos03/tech/full_papers/rajagopalan/rajagopalan.pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[7] Kumar, Sanjeev and Christopher Wilkerson, &amp;lt;i&amp;gt;Exploiting Spatial Locality in Data Caches using Spatial Footprints&amp;lt;/i&amp;gt;, Princeton University and Microcomputer Research Labs (Oregon), 1998.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.1550&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[8] Jin, Shudong and Azer Bestavros, &amp;lt;i&amp;gt;Sources and Characteristics of Web Temporal Locality&amp;lt;/i&amp;gt;, Computer Science Depratment - Boston University, Boston. [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.5941&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[9] Agarwal, Vikas &amp;lt;i&amp;gt;et al.&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Clock Rate versus IPS: The End of the Road for Conventional Microarhitechtures&amp;lt;/i&amp;gt;, University of Texas, Austin, 2000.[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.3694&amp;amp;rep=rep1&amp;amp;type=pdf PDF]&lt;br /&gt;
&lt;br /&gt;
[10] Tuomi, Ilkka, &amp;lt;i&amp;gt;The Lives and Death of Moore&#039;s Law&amp;lt;/i&amp;gt;, 2002.[http://131.193.153.231/www/issues/issue7_11/tuomi/ HTML]&lt;br /&gt;
&lt;br /&gt;
[11] BARHAM, P., DRAGOVIC, B., FRASER, K., HAND, S., HARRIS, T., HO, A., NEUGEBAUER, R., PRATT, I., AND WARFIELD, A. Xen and the art of virtualization. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP) (2003), pp. 164–177.&lt;br /&gt;
&lt;br /&gt;
[12] LARUS, J., AND PARKES, M. Using Cohort-Scheduling to Enhance Server Performance. In Proceedings of the annual conference on USENIX Annual Technical Conference (ATEC) (2002), pp. 103–114.&lt;br /&gt;
&lt;br /&gt;
[13] ARON, M., AND DRUSCHEL, P. Soft timers: efficient microsecond software timer support for network processing. ACM Trans. Comput. Syst. (TOCS) 18, 3 (2000), 197–228.&lt;br /&gt;
&lt;br /&gt;
[14] DRUSCHEL, P., AND BANGA, G. Lazy receiver processing (LRP): a network subsystem architecture for server systems. In Proceedings of the 2nd USENIX Symposium on Operating Systems Design and Implementation (OSDI) (1996), pp. 261–275.&lt;br /&gt;
&lt;br /&gt;
[15] CHAKRABORTY, K., WELLS, P. M., AND SOHI, G. S. Computation Spreading: Employing Hardware Migration to Specialize CMP Cores On-the-fly. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2006), pp. 283–292.&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=4958</id>
		<title>Talk:COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=4958"/>
		<updated>2010-11-15T01:37:02Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Who is working on what ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Group 3 Essay=&lt;br /&gt;
&lt;br /&gt;
Hello everyone, please post your contact information here:&lt;br /&gt;
&lt;br /&gt;
Ben Robson [mailto:brobson@connect.carleton.ca brobson@connect.carleton.ca]&lt;br /&gt;
&lt;br /&gt;
Rey Arteaga: rarteaga@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
Corey Faibish: corey.faibish@gmail.com&lt;br /&gt;
&lt;br /&gt;
Tawfic Abdul-Fatah: [mailto:tfatah@gmail.com tfatah@gmail.com]&lt;br /&gt;
 &lt;br /&gt;
Can&#039;t access the video without a login as we found out in class, but you can listen to the speech and follow with the slides pretty easily, I just went through it and it&#039;s not too bad. Rarteaga&lt;br /&gt;
&lt;br /&gt;
==Question 3 Group==&lt;br /&gt;
*Abdul-Fatah Tawfic tafatah&lt;br /&gt;
*Arteaga Reynaldo rarteaga&lt;br /&gt;
*Faibish Corey   cfaibish&lt;br /&gt;
*Lawrence Wesley wlawrenc&lt;br /&gt;
*Preston Mike    mpreston&lt;br /&gt;
*Robson  Benjamin brobson&lt;br /&gt;
*Sun     Fangchen sfangche&lt;br /&gt;
&lt;br /&gt;
==Who is working on what ?==&lt;br /&gt;
Just to keep track of who&#039;s doing what --[[User:Tafatah|Tafatah]] 01:37, 15 November 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=4957</id>
		<title>Talk:COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=4957"/>
		<updated>2010-11-15T01:36:44Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Question 3 Group */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Group 3 Essay=&lt;br /&gt;
&lt;br /&gt;
Hello everyone, please post your contact information here:&lt;br /&gt;
&lt;br /&gt;
Ben Robson [mailto:brobson@connect.carleton.ca brobson@connect.carleton.ca]&lt;br /&gt;
&lt;br /&gt;
Rey Arteaga: rarteaga@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
Corey Faibish: corey.faibish@gmail.com&lt;br /&gt;
&lt;br /&gt;
Tawfic Abdul-Fatah: [mailto:tfatah@gmail.com tfatah@gmail.com]&lt;br /&gt;
 &lt;br /&gt;
Can&#039;t access the video without a login as we found out in class, but you can listen to the speech and follow with the slides pretty easily, I just went through it and it&#039;s not too bad. Rarteaga&lt;br /&gt;
&lt;br /&gt;
==Question 3 Group==&lt;br /&gt;
*Abdul-Fatah Tawfic tafatah&lt;br /&gt;
*Arteaga Reynaldo rarteaga&lt;br /&gt;
*Faibish Corey   cfaibish&lt;br /&gt;
*Lawrence Wesley wlawrenc&lt;br /&gt;
*Preston Mike    mpreston&lt;br /&gt;
*Robson  Benjamin brobson&lt;br /&gt;
*Sun     Fangchen sfangche&lt;br /&gt;
&lt;br /&gt;
==Who is working on what ?==&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=4956</id>
		<title>Talk:COMP 3000 Essay 2 2010 Question 3</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_2_2010_Question_3&amp;diff=4956"/>
		<updated>2010-11-15T01:36:08Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Group 3 Essay */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Group 3 Essay=&lt;br /&gt;
&lt;br /&gt;
Hello everyone, please post your contact information here:&lt;br /&gt;
&lt;br /&gt;
Ben Robson [mailto:brobson@connect.carleton.ca brobson@connect.carleton.ca]&lt;br /&gt;
&lt;br /&gt;
Rey Arteaga: rarteaga@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
Corey Faibish: corey.faibish@gmail.com&lt;br /&gt;
&lt;br /&gt;
Tawfic Abdul-Fatah: [mailto:tfatah@gmail.com tfatah@gmail.com]&lt;br /&gt;
 &lt;br /&gt;
Can&#039;t access the video without a login as we found out in class, but you can listen to the speech and follow with the slides pretty easily, I just went through it and it&#039;s not too bad. Rarteaga&lt;br /&gt;
&lt;br /&gt;
==Question 3 Group==&lt;br /&gt;
*Abdul-Fatah Tawfic tafatah&lt;br /&gt;
*Arteaga Reynaldo rarteaga&lt;br /&gt;
*Faibish Corey   cfaibish&lt;br /&gt;
*Lawrence Wesley wlawrenc&lt;br /&gt;
*Preston Mike    mpreston&lt;br /&gt;
*Robson  Benjamin brobson&lt;br /&gt;
*Sun     Fangchen sfangche&lt;br /&gt;
&lt;br /&gt;
Just to keep track of who&#039;s doing what --[[User:Tafatah|Tafatah]] 01:36, 15 November 2010 (UTC)&lt;br /&gt;
==Who is working on what ?==&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4625</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4625"/>
		<updated>2010-10-15T08:01:29Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2] &lt;br /&gt;
The growing needs of file storage are currently best met by the ZFS file system as the requirements that this system satisfies are not fully implemented by any other one system.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. To understand the implementation of these requirements of ZFS, it is important to note that ZFS is made up of the following subsystems: SPA (Storage Pool Allocator), DSL (Data Set and snapshot Layer), DMU (Data Management Unit), ZAP (ZFS Attributes Processor), ZPL (ZFS POSIX Layer), ZIL (ZFS Intent Log) and ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system, that is, via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality. As a consequence, the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, it can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of APIs used for allocating and freeing blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). However, instead of memory allocation, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller. ZFS uses DVAs to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices abstract virtual device drivers. A virtual device can be thought of as a node with possible children. Each child can be another virtual device or a device driver. The SPA also handles the traditional volume manager tasks such as mirroring. It accomplishes such tasks via the use of virtual devices. Each one implements a specific task. In this case, if SPA needed to handle mirroring, a virtual device would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. This is a significantly large amount of information which allows for a larger storage limit.&lt;br /&gt;
 &lt;br /&gt;
ZFS also uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one or more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, which in turn is a collection of blocks. Such levels of abstraction increase ZFS&#039;s flexibility and simplifies its management. Lastly, with respect to flexibility, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. Its main strategies are checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency is therefore assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock. Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption. If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. Lastly, the DMU uses copy-on-write for all blocks in order to implement self-healing. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
In order to determine the needs and basic requirements of a file system, it is necessary to consider legacy file systems and how they have influenced the developed of current file systems and how they compare to a system such as ZFS.&lt;br /&gt;
&lt;br /&gt;
One such legacy file system is FAT32, and another is ext2. These file systems were designed for users who had much fewer and much smaller storage devices and storage needs than the average use today.The average user at the time would not have many files stored on their hard drive, and because the small amounts of data were not accessed that often, the file systems did not need to worry much about the procedures for ensuring data integrity(repairing the file system and relocating files).&lt;br /&gt;
 &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file. The first file on a new device will use all sequential clusters. Therefore, the first cluster will point to the second, which will point to the third and so on. The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file and the file is accessed the file system must find all clusters that go together that make up the file. This process takes long if the clusters are not organized. When files are deleted, the clusters are modified as well and leave empty clusters available for new data. Because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a de-fragmentation system, but all of the recent Windows OS’s come with a defragmentation tool for users to use. De-fragmentation allows for the storage device to organize the fragments of a file (clusters) so that they are near each other. This decreases the time it takes to access a file from the file system. Since this is not a default function in the FAT32 system, looking for empty space to store a file requires a linear search through all the clusters. Therefore, the lack of efficiency, the lack of sufficient storage space and the lack of data integrity preservation are all major drawbacks of FAT32. However, one feature of FAT32 is that the first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group. Files in ext2 are represented by inodes. Inodes are a structure that contains the description of the file, the file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32, the file allocation table was used to define the organization of how file fragments were, and it was important to have duplicate copies of this FAT in case of a crash. For similar functionality, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group. Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. These backup copies are used when the system fails or  shuts down suddenly and therefore requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
In general, when observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, while the ZFS contains 2^58 ZB -- an amount which isis incomparably larger. Also, ZFS has the ability to find and replace any bad data while the system is running which means that fsck is not used in ZFS, very much unlike the ext2 system. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, whereas the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. It is easy to see that although these legacy file systems fulfill the basic role of storing an retrieving data they cannot be reasonably compared to ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Current file systems, on the other hand, are much more comparable to ZFS and actually do fulfill some of the same requirements. However, despite their current popularity and usage, they do not provide all of the functionality possible using ZFS.&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
One system that is currently in widespread use is NTFS, the New Technology File System. This system was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The way it implements storage is that it creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. &lt;br /&gt;
&lt;br /&gt;
The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally, the Master File Table Copy is a copy of the MFT which ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. Therefore, the main advantages to NTFS is that it provides data recovery, data integrity and protection of data in case of interruption during writing.&lt;br /&gt;
&lt;br /&gt;
Another advantage is that it allows for compression of files to save disk space However, this has a negative effect on performance because in order to move compressed files they must first be decompressed then transferred and recompressed. Another disadvantage is that NTFS does have certain volume and size constraints. In particular, NTFS is a 64-bit file system which allows for a maximum of 2^64 bytes of storage. It is also capped at a maximum file size of 16TB and a maximum volume size of 256TB. This is significantly less than the storage capability provided by ZFS.&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
The newest file systems quickly closing in on ZFS.  The forerunner of the pack is currently Btrfs.  Designed with similar motivation as ZFS Btrfs provides a similarly rich feature set that is ideally suited for modern computing needs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of efficiency, integrity and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs was designed with efficiency, integrity and maintainability.  Btrfs efficiently uses space with tight packing of small files, on the fly compression, and very fast search capability. To improve integrity Bdfs has checksums for writes and snapshots.  Maintainability is supported with efficient incremental backups, live defragmentation, dynamic expansion of the file system to incorporate new devices, and it supports massive amounts of data.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  These trees are composed of three data types keys, items and block headers.  The data type of these trees are referred to as items and all are sorted on a 136-bit key.  The key is divided into three chucks the fist is a 64-bit object id followed by 8-bits denoting the item’s type and finally the last 64 bits have distinct uses depending on the type.  The unique key helps with quick searches using hash tables and is necessary for the sorting algorithms that help keep the tree balanced.  The items contain a key and information on the size and location of the items data.   Block headers contain various information about blocks such as checksum, level in the tree, generation number, owner, block number, flags, tree id and chunk id as well as a couple others.&lt;br /&gt;
&lt;br /&gt;
The trees are constructed of these primitive with interior nodes containing on keys to identify the node and block pointers that point to the child of the node.  Leaves contain multiple items and their data&lt;br /&gt;
. &lt;br /&gt;
As a minimum the Btrfs filesystem will contain three trees a tree that has contains a other tree roots. A subvolumes which holds file and directories.  An extents volume that contains the information about all the allocated extents files. Outside of the trees will be the extents, and a superblock.  The superblock is a data structure that points to the root of roots.  Btrfs can have additional trees are added to support other features such as logs, chunks and data relocation.&lt;br /&gt;
&lt;br /&gt;
The copy on write method of the system is a pivotal piece of a number of features of the Bdfs.  Writes never occur on the same blocks.  A transaction log is created and writes are cached the file system allocates sufficient blocks for the new data and the new data is written there.  All subvolumes are updated to the new blocks.  The old blocks are then removed and freed at the discretion of the filesystem.  This copy on write combined with the internal generation number allows the system to create snapshots of the data to be made.  After each copy the checksum is also recalculated on a per block basis and a duplicate is made to another chunk.  These actions combine to provide exceptional data integrity.&lt;br /&gt;
&lt;br /&gt;
Bdfs provides a very simple underlying implementation ( algorithms non-withstanding ) and provides a number of features that help future proof this file system.&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features that ZFS does have.  Btrfs doesn&#039;t have the self-healing capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs] ZFS does have three more years of development than Btrfs so Btrfs may very well catch up.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Conclusion&#039;&#039;&#039; ==&lt;br /&gt;
ZFS is a vast improvement over traditional file systems. It&#039;s modularization, administrative simplicity, self-healing, use of storage pool, and POSIX&lt;br /&gt;
compliance make it a viable file system replacement. Simplicity and administrative ease is perhaps one of its more important features. In fact, that was the most attractive feature to PPPL (Princeton Plasma Physics Laboratory). PPPL collects data from plasma experiments [Z5].&lt;br /&gt;
&lt;br /&gt;
The laboratory systems administrators were having problems with their ufs (Unix file system). Given the increasingly growing needs for  additional and larger disks and the problems with administrators continuously switching disks, performing partitions, copying old data to the new larger disks there was a significant amount of user downtime. Therefore, the administrators were attracted to the storage pool concept, and to the added flexibility provided by ZFS.&lt;br /&gt;
&lt;br /&gt;
Lastly, given the increasing demands not only on vast amounts of storage, but on the continuous availability of that storage, whether accessed via a smart-phone or a server, time wasted on partitions, disk swapping, and any similar activities, any inefficiency in traditional file systems will soon, if it hasn&#039;t already, become extremely intolerable.&lt;br /&gt;
&lt;br /&gt;
Therefore, ZFS should be seriously considered as a smart file system solution for today and for the foreseeable future.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
* S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
* Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
* Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
* Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
* Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
* ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
* Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
* Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*Microsoft- TechNet.(March 28, 2003) &amp;quot;How NTFS Works&amp;quot; [http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx].&lt;br /&gt;
&lt;br /&gt;
*Microsoft-TechNet. &amp;quot;File Systems&amp;quot; [http://technet.microsoft.com/en-us/library/cc938919.aspx].&lt;br /&gt;
&lt;br /&gt;
*Microsoft-TechNet. ( Sept. 3, 2009) &amp;quot;Best practices for NTFS compression in Windows&amp;quot; [http://support.microsoft.com/kb/251186].&lt;br /&gt;
&lt;br /&gt;
* Mathur, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;br /&gt;
&lt;br /&gt;
* Chris Mason, (2007), [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-ukuug.pdf &amp;quot;The Btrfs Filesystem&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4621</id>
		<title>Talk:COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4621"/>
		<updated>2010-10-15T07:52:36Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Who is doing what */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Contacts / If interested ==&lt;br /&gt;
Tawfic : tfatah@gmail.com&lt;br /&gt;
&lt;br /&gt;
Andy Zemancik: andy.zemancik@gmail.com&lt;br /&gt;
&lt;br /&gt;
Lester Mundt: lmundt@gmail.com&lt;br /&gt;
&lt;br /&gt;
Matthew Chou : mateh.cc@gmail.com (this is mchou2)&lt;br /&gt;
&lt;br /&gt;
Nisrin Abou-Seido: naseido@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
== Suggested References Format ==&lt;br /&gt;
Author, publisher/university, Name of the article&lt;br /&gt;
&lt;br /&gt;
== Who is doing what ==&lt;br /&gt;
Suggestion: In order to avoid duplication. Please state what section/item you&#039;re currently working on.&lt;br /&gt;
&lt;br /&gt;
Azemanci: Currently working on Section Three Current File Systems.&lt;br /&gt;
&lt;br /&gt;
Nisrin (naseido): Working on intro, conclusion and editing&lt;br /&gt;
&lt;br /&gt;
Lester: Working on section 3 BTRFS and WinFS&lt;br /&gt;
&lt;br /&gt;
Tawfic: added a conclusion. Not planning to add anything else. It&#039;s sleep time !!&lt;br /&gt;
&lt;br /&gt;
KEY ISSUE: We need a thesis statement. Please suggest ideas.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 01:38, 15 October 2010 (UTC) I think the thesis statement is implied in the current intro, i.e. &amp;quot;.. of avoiding some of the major problems associated&lt;br /&gt;
with traditional file systems . . &amp;quot; suggests that it&#039;s unacceptable anymore to tolerate problems in today&#039;s IT environment. If&lt;br /&gt;
you&#039;d like to expand on it, you could mention the continuous need for flexibility vis-a-vis using data. Example: there&#039;s a growing&lt;br /&gt;
trend with cloud computing (the marketable name for distributed computing). Users who will opt for that option will have to trust&lt;br /&gt;
the host companies with their data. It won&#039;t be acceptable to them to be told that a file here or a directory there was lost. The&lt;br /&gt;
issue with the growth of smart phones and yet to proliferate tablets also increases the demands for flexibility ( need to be able&lt;br /&gt;
to add/shrink/manage storage on the fly and avoid manual intervention when problems arise) . . etc. Hope that helps.&lt;br /&gt;
&lt;br /&gt;
The conclusion would have to assert the main points regarding ZFS, i.e. it&#039;s modularization and administrative simplicity, it&#039;s&lt;br /&gt;
virtualization of storage via the use of SPA and DMU, and it&#039;s self healing abilities. I am currently working on the section&lt;br /&gt;
that talks ( briefly ) about ZFS&#039;s self-healing ( for lack of better words ). So I&#039;ll be online for sometime. The info on SPA&lt;br /&gt;
amd DMU is already there. If it&#039;s not clear enough, please let me know&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 03:05, 15 October 2010 (UTC) I agree completely with the thesis and mentioned this at the bottom of the page.  &lt;br /&gt;
&lt;br /&gt;
Something along the lines of &amp;quot;ZFS is a file system designed to support the changing requirements of computing&amp;quot; as I had mentioned before &amp;quot;server needs was of particular attention&amp;quot; then continue to expand by describing the environment that is causing these changes &amp;quot;more companies with distributed large scale data storage &amp;quot;the cloud&amp;quot; &amp;quot; as Tawfic has suggested this establishes motivation.&lt;br /&gt;
&lt;br /&gt;
Then we mention the goals that were desired extensibility( accomplished through modularization ), reliability ( checksums, copy on write ) and maintainability ( administrative simplicity)&lt;br /&gt;
&lt;br /&gt;
In the intro to ZFS we talk about how it&#039;s feature set supports the design goals.  Tawfic has then done most of the feature descriptions.&lt;br /&gt;
&lt;br /&gt;
The section on legacy filesystems should have a mini-intro talking about the state of the enivronment they were designed for and there goals of the time&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Describe then which has been done.&lt;br /&gt;
&lt;br /&gt;
Small contrast and compare with ZFS generally summarizing along the lines of &amp;quot;gee that sure is better&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Repeat for the other two sections current and future with each contrast/compare getting larger since they more comparable and with different conclusions.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 07:34, 15 October 2010 (UTC) Personally I am not certain if an example should be in the conclusion....  I like the opening lines though.  Kind of disregarding the rest of the essay though I think.&lt;br /&gt;
&lt;br /&gt;
== Deadline ==&lt;br /&gt;
Suggestion: Adding content should stop on Thursday, October 14&#039;th at 3:00 PM. Any work after that&lt;br /&gt;
should go into formatting, spelling, and grammar checking.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:00, 14 October 2010 (UTC)&lt;br /&gt;
- I will definitely be adding content after this time probably late, late into the evening.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:25, 14 October 2010 (UTC) No problem. Forget about the suggested deadline. I thought we&#039;d have to be done by 11:00Pm.&lt;br /&gt;
I am still adding stuff myself. I think Anil will lock the Wiki around 7:00 Am or so. So anytime&lt;br /&gt;
before that is Ok.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 07:22, 15 October 2010 (UTC)&lt;br /&gt;
I wish I could have got this started earlier but 4104 had a crazy assignment that destroyed me since Saturday.&lt;br /&gt;
&lt;br /&gt;
== Essay Format Take 2 ==&lt;br /&gt;
Hello. I am suggesting the following format instead. If you agree, I&#039;ll take care of merging the existing info into this new format. My feeling is that this format is&lt;br /&gt;
more flexible and will (hopefully) allow individuals to take a section or a sub-section and work on it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Abstract&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: Main point. Current File Systems are neither versatile enough nor intelligent to handle the rapidly&lt;br /&gt;
 growing needs of dynamic storage.&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the WHYS as to the need for versatile storage (e.g. cloud computing, mobile environments, shifting consumer&lt;br /&gt;
 demand . . etc )&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the need for intelligence (just statements, the body will take care of expanding on these ). E.g. more&lt;br /&gt;
 intelligent FS’s can include Metadata to help crime investigators, smart FS’s could be self healing . . .etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Limitations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Zettabyte File System&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Dissected&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: List the seven components of ZFS and basically what makes a ZFS&lt;br /&gt;
 E.g. interface, various parts, and external needed libraries . . etc.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Features Beyond Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Possible Real-Life Scenarios / Examples&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: 2-3 examples where ZFS was/could/is being considered for use.&lt;br /&gt;
&lt;br /&gt;
 TO-DO : One to two paragraphs stressing / reiterating the main points made in the abstract&lt;br /&gt;
         thesis statement).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Alternatives to ZFS&#039;&#039;&#039;&lt;br /&gt;
 one example is good enough.&lt;br /&gt;
 TO-DO: a brief description of the alternative.&lt;br /&gt;
 Main argument for it’s viability.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Pros/Cons&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: just a list of pluses and minuses&lt;br /&gt;
&lt;br /&gt;
 TO-DO : two to three paragraphs summarizing (this is the conclusion) the main points outlined in the abstract and the body, restating why traditional&lt;br /&gt;
 FS’s are no longer viable, and  stressing once more that ZFS is a valid alternative.&lt;br /&gt;
&lt;br /&gt;
== Essay Format ==&lt;br /&gt;
&lt;br /&gt;
I started working on the main page.  The bullets are to be expanded. Other group are are working in their respective discussion pages but I think it&#039;s all right to put our work in progress on the front page.  Thoughts?--[[User:Lmundt|Lmundt]] 16:14, 6 October 2010 (UTC)&lt;br /&gt;
* [[User:Gbint|Gbint]] 02:03, 7 October 2010 (UTC) Lmundt;  what do you think of listing the capacities of the file system under major features?  I was thinking that we could overview the features in brief, then delve into each one individually.&lt;br /&gt;
* --[[User:Lmundt|Lmundt]] 14:31, 7 October 2010 (UTC) I was thinking about the major structure... I like what your suggesting in one section. So here is the structure I am thinking of.&lt;br /&gt;
&lt;br /&gt;
* Intro &lt;br /&gt;
* Section One ZFS&lt;br /&gt;
** Major feature 1&lt;br /&gt;
** Major feature 2&lt;br /&gt;
** Major feature 3 &lt;br /&gt;
* Section Two Legacy File Systems&lt;br /&gt;
** Legacy File System1( FAT32 ) - what it does&lt;br /&gt;
** Legacy File System2( ext2 ) - what it does&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Three Current File Systems&lt;br /&gt;
** NTFS?&lt;br /&gt;
** ext4?&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Four future file Systems&lt;br /&gt;
** BTRFS&lt;br /&gt;
** WinFS or ??&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Conclusion&lt;br /&gt;
&lt;br /&gt;
What does everyone think of this format?   While everyone should contribute to section one we could divvy up the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 16:29, 9 October 2010 (UTC) The layout looks good; I filled out the data dedup section. I think it has reasonable coverage while staying away from becoming it&#039;s own essay just on deduplication.&lt;br /&gt;
&lt;br /&gt;
The legacy file systems are really not even in the same world as ZFS, so I think the contrasting section should cover a lot of how storage needs have changed.&lt;br /&gt;
&lt;br /&gt;
The current file systems are capable of being expanded into large pools of storage with good redundancy and even advanced features like data deduplication, but they are only a component in a chain of tools (like ext4 + lvm + mdraid + opendedup) rather than an full end-to-end solution.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 23:35, 9 October 2010 (UTC)  The section on deduplication looks good I agree it looks like the right amount of coverage for a portion of a single section.  Your also right about the old file systems not being able to hold a candle to ZFS and the conclusion section should talk about how storage needs and computers changed.  And intro to that section could set the stage for that period as well.  Non-multi-threaded, single processor system with much smaller RAM, even the applications were radically different the Internet was just single webpages without the high performance needs of web commerce and online banking for example.  I have another assignment so won&#039;t be contributing too much until Monday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 23:54, 10 October 2010 (UTC)&lt;br /&gt;
Please take a look at suggested essay format #2 and let me know soon. Time is running out Gents and Ladies :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:35, 11 October 2010 (UTC)&lt;br /&gt;
I think I prefer the outline I proposed only because it&#039;s a very regimented contrast/compare essay format and should get us any marks for format.  Most proper essays don&#039;t usually have a dedicated pros cons list.  Heading more towards a report format I think.  It&#039;s really what everyone agrees on.  I won&#039;t be touching the essay until tomorrow though.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 17:32, 11 October 2010 (UTC)&lt;br /&gt;
I like Lmundt&#039;s outline.  How would you like to divide up the work?  Also can everyone post the contact information so we know exactly who is in our group.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:03, 11 October 2010 (UTC)&lt;br /&gt;
No problem, I&#039;ll go with the current format. One issue to keep in mind is that this is an essay, not a report. I.E. the intro/thesis has to include&lt;br /&gt;
a reasonable suggestion towards using ZFS as a reliable FS. The body and the conclusion would have to assert that. The current format satisfies that&lt;br /&gt;
if we keep these points in mind. I started looking into the &amp;quot;dissect subsection&amp;quot; in the format I suggested, which is related to the ZFS features&lt;br /&gt;
section one in the current format. I&#039;ll continue to look into that part (above section, who is doing what will be updated accordingly), i.e. I&#039;ll&lt;br /&gt;
take care of section one since I&#039;ve already done some work on it. I suggest that each member of the group picks two items from one of the other&lt;br /&gt;
sections, except the contrasting part. Content in section one can then be used to finalize the comparisons in each of sections 2-4. The Intro/Abstract&lt;br /&gt;
and conclusion sections can be left to the end, and can be done collaboratively. I.E. once we have a very clear picture of all the&lt;br /&gt;
different pieces.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:18, 12 October 2010 (UTC)&lt;br /&gt;
I will begin working on section three current File Systems unless someone else has already begun working on it.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 20:29, 12 October 2010 (UTC)&lt;br /&gt;
I am going to start researching for section 2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:15, 13 October 2010 (UTC)  Alright so all the sections are being taken care of so we should be good to go for Thursday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:35, 13 October 2010 (UTC) &#039;&#039;&#039;No one is assigned to section four&#039;&#039;&#039; ? Also, for those who haven&#039;t picked any section or subsection, please help out with the sections you&#039;re&lt;br /&gt;
more familiar with.&lt;br /&gt;
&lt;br /&gt;
Finally, if you were in class today (well, technically yesterday), then you&#039;ve heard Anil talk about plagiarism. I know this is common knowledge, so forgive&lt;br /&gt;
the annoying reminder. Please never copy and paste, and make sure to cite your info. As Anil mentioned, if anyone plagiarises, we are ALL responsible. It is&lt;br /&gt;
simply impossible for the rest of the group to check whether every member&#039;s sentence is genuine or not. So use your own words/phrases ( doesn&#039;t&lt;br /&gt;
have to be fancy or sophisticated ). If you&#039;re not sure, please check with the rest of the group.&lt;br /&gt;
&lt;br /&gt;
Good luck, and good night.&lt;br /&gt;
--Tawfic&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 14:55, 13 October 2010 (UTC)  My bad I misread something I thought you were doing current file systems section 3.  I&#039;ll take section 3 but then someone needs to do section 4.  There are 4 of us so this should not be a problem.&lt;br /&gt;
&lt;br /&gt;
--[[User:Naseido|Naseido]] 13 October 2010  Sorry I haven&#039;t contributed till now. The outline looks great and I think we can spend most of the day tomorrow editing to make sure all the sections fit together like an essay. I&#039;ll be doing section 4.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 16:11, 13 October 2010 (UTC) Hi. In section 4 the most important one is BTRFS. More info on that and less info on the others is Ok.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:00, 14 October 2010 (UTC)&lt;br /&gt;
I have done what I can for the legacy file systems, if someone who doesn&#039;t have any particular job wouldn&#039;t mind going over it and correcting any errors they see. I am also not familiar with how to edit/format these wiki pages so I tried my best and if you want to change the layout then please do, I would assume after we complete our sections and collaborate them into 1 essay that the formatting will change. I simply put headings on each section just so it is easier to read.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:55, 14 October 2010 (UTC) A reference for wiki editing http://meta.wikimedia.org/wiki/Help:Editing&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:42, 14 October 2010 (UTC)  I&#039;m not going to have my info posted by 3:00.  Also how and where are we supposed to cite our sources?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:28, 14 October 2010 (UTC) No worries. You have till 7:00 Am ( or till Anil locks the Wiki down, though I wouldn&#039;t count on more than 7) Friday, Oct 15. For citing, I am using&lt;br /&gt;
this convention. Bla.....Bla [Z1. P3] means I am using info from page 3 of article labeled as Z1 in references section.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 20:48, 14 October 2010 (UTC) Citation reference looks good.  I think in each section we should talk about the motivation behind the design. A small into for each section.  For example in the legacy area fat32 and ext, we could talk about computing becoming commonplace for the average worker so most development was for single users with a relatively small hardrive, not too many files.  It will in-turn lead to justify/explanation for the design decission for each vintage of OS. &lt;br /&gt;
The main intro should about the motivations behind the design.  Intended for servers with a focus or expandability, reliability and self maintenance.  This is the motivation behind all those cool features we are detailing.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
Not from your group. Found a file which goes to the heart of your problem&lt;br /&gt;
[http://www.oracle.com/technetwork/server-storage/solaris/overview/zfs-14990&lt;br /&gt;
2.pdf ZFSDatasheet]&lt;br /&gt;
[[User:Gautam|Gautam]] 22:50, 5 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Thanks will take a look at that.--[[User:Lmundt|Lmundt]] 16:12, 6 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 01:45, 7 October 2010 (UTC) paper from Sun engineers explaining why they came to build ZFS, the problems they wanted to solve:  &lt;br /&gt;
* PDF:  http://www.timwort.org/classp/200_HTML/docs/zfs_wp.pdf&lt;br /&gt;
* HTML: http://74.125.155.132/scholar?q=cache:6Ex3KbFo4lYJ:scholar.google.com/+zettabyte+file+system&amp;amp;hl=en&amp;amp;as_sdt=2000&lt;br /&gt;
&lt;br /&gt;
Excellent article.[[User:Lmundt|Lmundt]] 14:24, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Not too exciting but it looks like an easy read http://arstechnica.com/hardware/news/2008/03/past-present-future-file-systems.ars [[User:Lmundt|Lmundt]] 14:40, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
the [http://en.wikipedia.org/wiki/Comparison_of_file_systems wikipedia comparison] has some good tables, and if you click the various categories you can learn quite a bit about the various important features //not your group. [[User:Rift|Rift]] 18:56, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Hey, I&#039;m not from your group but I found this slideshow that was really handy in the assignment! http://www.slideshare.net/Clogeny/zfs-the-last-word-in-filesystems - nshires&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hey there. I&#039;m not a member of your group. But you guys might want to look at this Wiki-page from the SolarisInternals website. I used it today for our assignment, a lot of interesting and in-depth breakdown of the ZFS file system: http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#ZFS_Performance_Considerations&lt;br /&gt;
&lt;br /&gt;
-- Munther&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:56, 13 October 2010 (UTC) Good intro to understanding FAT FS&lt;br /&gt;
http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:49, 14 October 2010 (UTC)&lt;br /&gt;
Abit late but I found a comparison of current file systems including ZFS:&lt;br /&gt;
http://www.idt.mdh.se/kurser/ct3340/ht09/ADMINISTRATION/IRCSE09-submissions/ircse09_submission_16.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4617</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4617"/>
		<updated>2010-10-15T07:46:13Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2] &lt;br /&gt;
The growing needs of file storage are currently best met by the ZFS file system as the requirements that this system satisfies are not fully implemented by any other one system.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. To understand the implementation of these requirements of ZFS, it is important to note that ZFS is made up of the following subsystems: SPA (Storage Pool Allocator), DSL (Data Set and snapshot Layer), DMU (Data Management Unit), ZAP (ZFS Attributes Processor), ZPL (ZFS POSIX Layer), ZIL (ZFS Intent Log) and ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system, that is, via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality. As a consequence, the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, it can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of APIs used for allocating and freeing blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). However, instead of memory allocation, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller. ZFS uses DVAs to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices abstract virtual device drivers. A virtual device can be thought of as a node with possible children. Each child can be another virtual device or a device driver. The SPA also handles the traditional volume manager tasks such as mirroring. It accomplishes such tasks via the use of virtual devices. Each one implements a specific task. In this case, if SPA needed to handle mirroring, a virtual device would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. This is a significantly large amount of information which allows for a larger storage limit.&lt;br /&gt;
 &lt;br /&gt;
ZFS also uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one or more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, which in turn is a collection of blocks. Such levels of abstraction increase ZFS&#039;s flexibility and simplifies its management. Lastly, with respect to flexibility, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. Its main strategies are checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency is therefore assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock. Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption. If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. Lastly, the DMU uses copy-on-write for all blocks in order to implement self-healing. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
In order to determine the needs and basic requirements of a file system, it is necessary to consider legacy file systems and how they have influenced the developed of current file systems and how they compare to a system such as ZFS.&lt;br /&gt;
&lt;br /&gt;
One such legacy file system is FAT32, and another is ext2. These file systems were designed for users who had much fewer and much smaller storage devices and storage needs than the average use today.The average user at the time would not have many files stored on their hard drive, and because the small amounts of data were not accessed that often, the file systems did not need to worry much about the procedures for ensuring data integrity(repairing the file system and relocating files).&lt;br /&gt;
 &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file. The first file on a new device will use all sequential clusters. Therefore, the first cluster will point to the second, which will point to the third and so on. The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file and the file is accessed the file system must find all clusters that go together that make up the file. This process takes long if the clusters are not organized. When files are deleted, the clusters are modified as well and leave empty clusters available for new data. Because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a de-fragmentation system, but all of the recent Windows OS’s come with a defragmentation tool for users to use. De-fragmentation allows for the storage device to organize the fragments of a file (clusters) so that they are near each other. This decreases the time it takes to access a file from the file system. Since this is not a default function in the FAT32 system, looking for empty space to store a file requires a linear search through all the clusters. Therefore, the lack of efficiency, the lack of sufficient storage space and the lack of data integrity preservation are all major drawbacks of FAT32. However, one feature of FAT32 is that the first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group. Files in ext2 are represented by inodes. Inodes are a structure that contains the description of the file, the file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32, the file allocation table was used to define the organization of how file fragments were, and it was important to have duplicate copies of this FAT in case of a crash. For similar functionality, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group. Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. These backup copies are used when the system fails or  shuts down suddenly and therefore requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
In general, when observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, while the ZFS contains 2^58 ZB -- an amount which isis incomparably larger. Also, ZFS has the ability to find and replace any bad data while the system is running which means that fsck is not used in ZFS, very much unlike the ext2 system. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, whereas the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. It is easy to see that although these legacy file systems fulfill the basic role of storing an retrieving data they cannot be reasonably compared to ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Current file systems, on the other hand, are much more comparable to ZFS and actually do fulfill some of the same requirements. However, despite their current popularity and usage, they do not provide all of the functionality possible using ZFS.&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
One system that is currently in widespread use is NTFS, the New Technology File System. This system was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The way it implements storage is that it creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. &lt;br /&gt;
&lt;br /&gt;
The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally, the Master File Table Copy is a copy of the MFT which ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. Therefore, the main advantages to NTFS is that it provides data recovery, data integrity and protection of data in case of interruption during writing.&lt;br /&gt;
&lt;br /&gt;
Another advantage is that it allows for compression of files to save disk space However, this has a negative effect on performance because in order to move compressed files they must first be decompressed then transferred and recompressed. Another disadvantage is that NTFS does have certain volume and size constraints. In particular, NTFS is a 64-bit file system which allows for a maximum of 2^64 bytes of storage. It is also capped at a maximum file size of 16TB and a maximum volume size of 256TB. This is significantly less than the storage capability provided by ZFS.&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of efficiency, integrity and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs was designed with efficiency, integrity and maintainability.  Btrfs efficiently uses space with tight packing of small files, on the fly compression, and very fast search capability. To improve integrity Bdfs has checksums for writes and snapshots.  Maintainability is supported with efficient incremental backups, live defragmentation, dynamic expansion of the file system to incorporate new devices, and it supports massive amounts of data.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  These trees are composed of three data types keys, items and block headers.  The data type of these trees are referred to as items and all are sorted on a 136-bit key.  The key is divided into three chucks the fist is a 64-bit object id followed by 8-bits denoting the item’s type and finally the last 64 bits have distinct uses depending on the type.  The unique key helps with quick searches using hash tables and is necessary for the sorting algorithms that help keep the tree balanced.  The items contain a key and information on the size and location of the items data.   Block headers contain various information about blocks such as checksum, level in the tree, generation number, owner, block number, flags, tree id and chunk id as well as a couple others.&lt;br /&gt;
&lt;br /&gt;
The trees are constructed of these primitive with interior nodes containing on keys to identify the node and block pointers that point to the child of the node.  Leaves contain multiple items and their data&lt;br /&gt;
. &lt;br /&gt;
As a minimum the Btrfs filesystem will contain three trees a tree that has contains a other tree roots. A subvolumes which holds file and directories.  An extents volume that contains the information about all the allocated extents files. Outside of the trees will be the extents, and a superblock.  The superblock is a data structure that points to the root of roots.  Btrfs can have additional trees are added to support other features such as logs, chunks and data relocation.&lt;br /&gt;
&lt;br /&gt;
The copy on write method of the system is a pivotal piece of a number of features of the Bdfs.  Writes never occur on the same blocks.  A transaction log is created and writes are cached the file system allocates sufficient blocks for the new data and the new data is written there.  All subvolumes are updated to the new blocks.  The old blocks are then removed and freed at the discretion of the filesystem.  This copy on write combined with the internal generation number allows the system to create snapshots of the data to be made.  After each copy the checksum is also recalculated on a per block basis and a duplicate is made to another chunk.  These actions combine to provide exceptional data integrity.&lt;br /&gt;
&lt;br /&gt;
Bdfs provides a very simple underlying implementation ( algorithms non-withstanding ) and provides a number of features that help future proof this file system.&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features that ZFS does have.  Btrfs doesn&#039;t have the self-healing capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs] ZFS does have three more years of development than Btrfs so Btrfs may very well catch up.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Conclusion&#039;&#039;&#039; ==&lt;br /&gt;
ZFS is a vast improvement over traditional file systems. It&#039;s modularization, administrative simplicity, self-healing, use of storage pool, and POSIX&lt;br /&gt;
compliance make it a viable file system replacement. Simplicity and administrative ease is perhaps one of its more important features. In fact, that&lt;br /&gt;
was the most attractive feature to PPPL (Princeton Plasma Physics Laboratory). PPPL collects data from plasma experiments [Z5].&lt;br /&gt;
&lt;br /&gt;
The laboratory systems administrators were having problems with their ufs (Unix file system). Given the increasingly growing needs for additional and larger disks, the administrators kept having to switch disks, perform partitions, copy old data to the new larger disks . . etc. Naturally, that meant users&#039; downtime. &lt;br /&gt;
&lt;br /&gt;
The administrators were attracted to the storage pool concept in ZFS, as well as the fact that they could create a storage pool (zpool) in few simple commands. Besides the aforementioned features, ZFS offers some additional flexibility.&lt;br /&gt;
&lt;br /&gt;
Users can choose to use a less demanding checksum algorithm if they are concerned about the slightly additional performance requirements. [Z1. P11]&lt;br /&gt;
&lt;br /&gt;
Lastly, given the increasing demands not only on vast amounts of storage, but on the continues availability of that storage, whether accessed via a smart-phone or a server, time wasted on partitions, disk swapping, and any similar activities will soon, if it hasn&#039;t already, become extremely intolerable.&lt;br /&gt;
&lt;br /&gt;
ZFS is a worthy choice and should be seriously considered.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
* S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
* Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
* Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
* Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
* Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
* ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
* Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
* Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*Microsoft- TechNet.(March 28, 2003) &amp;quot;How NTFS Works&amp;quot; [http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx].&lt;br /&gt;
&lt;br /&gt;
*Microsoft-TechNet. &amp;quot;File Systems&amp;quot; [http://technet.microsoft.com/en-us/library/cc938919.aspx].&lt;br /&gt;
&lt;br /&gt;
*Microsoft-TechNet. ( Sept. 3, 2009) &amp;quot;Best practices for NTFS compression in Windows&amp;quot; [http://support.microsoft.com/kb/251186].&lt;br /&gt;
&lt;br /&gt;
* Mathur, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;br /&gt;
&lt;br /&gt;
* Chris Mason, (2007), [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-ukuug.pdf &amp;quot;The Btrfs Filesystem&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4599</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4599"/>
		<updated>2010-10-15T07:24:54Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2] &lt;br /&gt;
The growing needs of file storage are currently best met by the ZFS file system as the requirements that this system satisfies are not fully implemented by any other one system.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. To understand the implementation of these requirements of ZFS, it is important to note that ZFS is made up of the following subsystems: SPA (Storage Pool Allocator), DSL (Data Set and snapshot Layer), DMU (Data Management Unit), ZAP (ZFS Attributes Processor), ZPL (ZFS POSIX Layer), ZIL (ZFS Intent Log) and ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system, that is, via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality. As a consequence, the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, it can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of APIs used for allocating and freeing blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). However, instead of memory allocation, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller. ZFS uses DVAs to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices abstract virtual device drivers. A virtual device can be thought of as a node with possible children. Each child can be another virtual device or a device driver. The SPA also handles the traditional volume manager tasks such as mirroring. It accomplishes such tasks via the use of virtual devices. Each one implements a specific task. In this case, if SPA needed to handle mirroring, a virtual device would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. This is a significantly large amount of information which allows for a larger storage limit.&lt;br /&gt;
 &lt;br /&gt;
ZFS also uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one or more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, which in turn is a collection of blocks. Such levels of abstraction increase ZFS&#039;s flexibility and simplifies its management. Lastly, with respect to flexibility, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. Its main strategies are checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency is therefore assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock. Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption. If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. Lastly, the DMU uses copy-on-write for all blocks in order to implement self-healing. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
One system that is currently in widespread use is NTFS, the New Technology File System. This system was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The way it implements storage is that it creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. &lt;br /&gt;
&lt;br /&gt;
The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally, the Master File Table Copy is a copy of the MFT which ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. Therefore, the main advantages to NTFS is that it provides data recovery, data integrity and protection of data in case of interruption during writing.&lt;br /&gt;
&lt;br /&gt;
Another advantage is that it allows for compression of files to save disk space However, this has a negative effect on performance because in order to move compressed files they must first be decompressed then transferred and recompressed. Another disadvantage is that NTFS does have certain volume and size constraints. In particular, NTFS is a 64-bit file system which allows for a maximum of 2^64 bytes of storage. It is also capped at a maximum file size of 16TB and a maximum volume size of 256TB. This is significantly less than the storage capability provided by ZFS.&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of efficiency, integrity and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs was designed with efficiency, integrity and maintainability.  Btrfs efficiently uses space with tight packing of small files, on the fly compression, and very fast search capability. To improve integrity Bdfs has checksums for writes and snapshots.  Maintainability is supported with efficient incremental backups, live defragmentation, dynamic expansion of the file system to incorporate new devices, and it supports massive amounts of data.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  These trees are composed of three data types keys, items and block headers.  The data type of these trees are referred to as items and all are sorted on a 136-bit key.  The key is divided into three chucks the fist is a 64-bit object id followed by 8-bits denoting the item’s type and finally the last 64 bits have distinct uses depending on the type.  The unique key helps with quick searches using hash tables and is necessary for the sorting algorithms that help keep the tree balanced.  The items contain a key and information on the size and location of the items data.   Block headers contain various information about blocks such as checksum, level in the tree, generation number, owner, block number, flags, tree id and chunk id as well as a couple others.&lt;br /&gt;
&lt;br /&gt;
The trees are constructed of these primitive with interior nodes containing on keys to identify the node and block pointers that point to the child of the node.  Leaves contain multiple items and their data&lt;br /&gt;
. &lt;br /&gt;
As a minimum the Btrfs filesystem will contain three trees a tree that has contains a other tree roots. A subvolumes which holds file and directories.  An extents volume that contains the information about all the allocated extents files. Outside of the trees will be the extents, and a superblock.  The superblock is a data structure that points to the root of roots.  Btrfs can have additional trees are added to support other features such as logs, chunks and data relocation.&lt;br /&gt;
&lt;br /&gt;
The copy on write method of the system is a pivotal piece of a number of features of the Bdfs.  Writes never occur on the same blocks.  A transaction log is created and writes are cached the file system allocates sufficient blocks for the new data and the new data is written there.  All subvolumes are updated to the new blocks.  The old blocks are then removed and freed at the discretion of the filesystem.  This copy on write combined with the internal generation number allows the system to create snapshots of the data to be made.  After each copy the checksum is also recalculated on a per block basis and a duplicate is made to another chunk.  These actions combine to provide exceptional data integrity.&lt;br /&gt;
&lt;br /&gt;
With&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Conclusion&#039;&#039;&#039; ==&lt;br /&gt;
ZFS is a vast improvement over traditional file systems. It&#039;s modularization, administrative simplicity, self-healing, use of storage pool, and POSIX&lt;br /&gt;
compliance make it a viable file system replacement. Simplicity and administrative ease is perhaps one of its more important features. In fact, that&lt;br /&gt;
was the most attractive feature to PPPL (Princeton Plasma Physics Laboratory). PPPL collects data from plasma experiments [Z5].&lt;br /&gt;
&lt;br /&gt;
The laboratory systems administrators were having problems with their ufs (Unix file system). Given the increasingly growing needs for additional and larger disks, the administrators kept having to switch disks, perform partitions, copy old data to the new larger disks . . etc. Naturally, that meant users&#039; downtime. &lt;br /&gt;
&lt;br /&gt;
The administrators were attracted to the storage pool concept in ZFS, as well as the fact that they could create a storage pool (zpool) in few simple commands. Besides the aforementioned features, ZFS offers some additional flexibility.&lt;br /&gt;
&lt;br /&gt;
TO-DO: Performance V.S. efficiency. ZFS provides the ability to do away with checksumming&lt;br /&gt;
&lt;br /&gt;
TO-DO: Plasma Physics Example&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] MATHUR, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The&lt;br /&gt;
new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;br /&gt;
&lt;br /&gt;
* Chris Mason, (2007), [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-ukuug.pdf &amp;quot;The Btrfs Filesystem&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4590</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4590"/>
		<updated>2010-10-15T07:17:26Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2] &lt;br /&gt;
The growing needs of file storage are currently best met by the ZFS file system as the requirements that this system satisfies are not fully implemented by any other one system.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. To understand the implementation of these requirements of ZFS, it is important to note that ZFS is made up of the following subsystems: SPA (Storage Pool Allocator), DSL (Data Set and snapshot Layer), DMU (Data Management Unit), ZAP (ZFS Attributes Processor), ZPL (ZFS POSIX Layer), ZIL (ZFS Intent Log) and ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system, that is, via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality. As a consequence, the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, it can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of APIs used for allocating and freeing blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). However, instead of memory allocation, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller. ZFS uses DVAs to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices abstract virtual device drivers. A virtual device can be thought of as a node with possible children. Each child can be another virtual device or a device driver. The SPA also handles the traditional volume manager tasks such as mirroring. It accomplishes such tasks via the use of virtual devices. Each one implements a specific task. In this case, if SPA needed to handle mirroring, a virtual device would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. This is a significantly large amount of information which allows for a larger storage limit.&lt;br /&gt;
 &lt;br /&gt;
ZFS also uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one or more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, which in turn is a collection of blocks. Such levels of abstraction increase ZFS&#039;s flexibility and simplifies its management. Lastly, with respect to flexibility, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. Its main strategies are checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency is therefore assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock. Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption. If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. Lastly, the DMU uses copy-on-write for all blocks in order to implement self-healing. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
One system that is currently in widespread use is NTFS, the New Technology File System. This system was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The way it implements storage is that it creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. &lt;br /&gt;
&lt;br /&gt;
The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally, the Master File Table Copy is a copy of the MFT which ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. Therefore, the main advantages to NTFS is that it provides data recovery, data integrity and protection of data in case of interruption during writing.&lt;br /&gt;
&lt;br /&gt;
Another advantage is that it allows for compression of files to save disk space However, this has a negative effect on performance because in order to move compressed files they must first be decompressed then transferred and recompressed. Another disadvantage is that NTFS does have certain volume and size constraints. In particular, NTFS is a 64-bit file system which allows for a maximum of 2^64 bytes of storage. It is also capped at a maximum file size of 16TB and a maximum volume size of 256TB. This is significantly less than the storage capability provided by ZFS.&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of efficiency, integrity and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs was designed with efficiency, integrity and maintainability.  Btrfs efficiently uses space with tight packing of small files, on the fly compression, and very fast search capability. To improve integrity Bdfs has checksums for writes and snapshots.  Maintainability is supported with efficient incremental backups, live defragmentation, dynamic expansion of the file system to incorporate new devices, and it supports massive amounts of data.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  These trees are composed of three data types keys, items and block headers.  The data type of these trees are referred to as items and all are sorted on a 136-bit key.  The key is divided into three chucks the fist is a 64-bit object id followed by 8-bits denoting the item’s type and finally the last 64 bits have distinct uses depending on the type.  The unique key helps with quick searches using hash tables and is necessary for the sorting algorithms that help keep the tree balanced.  The items contain a key and information on the size and location of the items data.   Block headers contain various information about blocks such as checksum, level in the tree, generation number, owner, block number, flags, tree id and chunk id as well as a couple others.&lt;br /&gt;
The trees are constructed of these primitive with interior nodes containing on keys to identify the node and block pointers that point to the child of the node.  Leaves contain multiple items and their data. &lt;br /&gt;
As a minimum the Btrfs filesystem will contain three trees a tree that has contains a other tree roots. A subvolumes which holds file and directories.  An extents volume that contains the information about all the allocated extents files. Outside of the trees will be the extents, and a superblock.  The superblock is a data structure that points to the root of roots.  Btrfs can have additional trees are added to support other features such as logs, chunks and data relocation.&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Conclusion&#039;&#039;&#039; ==&lt;br /&gt;
ZFS is a vast improvement over traditional file systems. It&#039;s modularization, administrative simplicity, self-healing, use of storage pool, and POSIX&lt;br /&gt;
compliance make it a viable file system replacement. Simplicity and administrative ease is perhaps one of its more important features. In fact, that&lt;br /&gt;
was the most attractive feature to PPPL (Princeton Plasma Physics Laboratory). PPPL collects data from plasma experiments [Z5].&lt;br /&gt;
&lt;br /&gt;
TO-DO: Performance V.S. efficiency. ZFS provides the ability to do away with checksumming&lt;br /&gt;
&lt;br /&gt;
TO-DO: Plasma Physics Example&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] MATHUR, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The&lt;br /&gt;
new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;br /&gt;
&lt;br /&gt;
* Chris Mason, (2007), [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-ukuug.pdf &amp;quot;The Btrfs Filesystem&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4558</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4558"/>
		<updated>2010-10-15T05:50:46Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
The DMU uses copy-on-write for all blocks. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified&lt;br /&gt;
traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of efficiency, integrity and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs was designed with efficiency, integrity and maintainability.  Btrfs efficiently uses space with tight packing of small files, on the fly compression, and very fast search capability. To improve integrity Bdfs has checksums for writes and snapshots.  Maintainability is supported with efficient incremental backups, live defragmentation, dynamic expansion of the file system to incorporate new devices, and it supports massive amounts of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  In Btrfs not only are files and directories stored in a B-tree but so are file system data such as extents, transaction logs, data relocation, chuncks. where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation of Btrfs is quite interesting the developers created it with good coding practices.  Fist of all Btrfs has very simple underlying components this allows wasy understanding of the basic components by most developers.  Additionally the system uses the B-trees structure extensively in addition to actual data and meta-data storage the structures that maintain and track space allocation use B-trees as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Conclusion&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
TO-DO: Performance V.S. efficiency. ZFS provides the ability to do away with checksumming&lt;br /&gt;
&lt;br /&gt;
TO-DO: Plasma Physics Example&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] MATHUR, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The&lt;br /&gt;
new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;br /&gt;
&lt;br /&gt;
* Chris Mason, (2007), [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-ukuug.pdf &amp;quot;The Btrfs Filesystem&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4553</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4553"/>
		<updated>2010-10-15T05:42:26Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
The DMU uses copy-on-write for all blocks. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified&lt;br /&gt;
traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of extensibility, reliability and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  In Btrfs not only are files and directories stored in a B-tree but so are file system data such as extents, transaction logs, data relocation, chuncks. where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation of Btrfs is quite interesting the developers created it with good coding practices.  Fist of all Btrfs has very simple underlying components this allows wasy understanding of the basic components by most developers.  Additionally the system uses the B-trees structure extensively in addition to actual data and meta-data storage the structures that maintain and track space allocation use B-trees as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Conclusion&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] MATHUR, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The&lt;br /&gt;
new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4552</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4552"/>
		<updated>2010-10-15T05:41:14Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
The DMU uses copy-on-write for all blocks. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified&lt;br /&gt;
traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of extensibility, reliability and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  In Btrfs not only are files and directories stored in a B-tree but so are file system data such as extents, transaction logs, data relocation, chuncks. where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation of Btrfs is quite interesting the developers created it with good coding practices.  Fist of all Btrfs has very simple underlying components this allows wasy understanding of the basic components by most developers.  Additionally the system uses the B-trees structure extensively in addition to actual data and meta-data storage the structures that maintain and track space allocation use B-trees as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
====Comparison====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] MATHUR, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The&lt;br /&gt;
new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4550</id>
		<title>Talk:COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4550"/>
		<updated>2010-10-15T05:39:34Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Who is doing what */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Contacts / If interested ==&lt;br /&gt;
Tawfic : tfatah@gmail.com&lt;br /&gt;
&lt;br /&gt;
Andy Zemancik: andy.zemancik@gmail.com&lt;br /&gt;
&lt;br /&gt;
Lester Mundt: lmundt@gmail.com&lt;br /&gt;
&lt;br /&gt;
Matthew Chou : mateh.cc@gmail.com (this is mchou2)&lt;br /&gt;
&lt;br /&gt;
Nisrin Abou-Seido: naseido@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
== Suggested References Format ==&lt;br /&gt;
Author, publisher/university, Name of the article&lt;br /&gt;
&lt;br /&gt;
== Who is doing what ==&lt;br /&gt;
Suggestion: In order to avoid duplication. Please state what section/item you&#039;re currently working on.&lt;br /&gt;
&lt;br /&gt;
Azemanci: Currently working on Section Three Current File Systems.&lt;br /&gt;
&lt;br /&gt;
Nisrin (naseido): Working on intro, conclusion and editing&lt;br /&gt;
&lt;br /&gt;
Lester: Working on section 3 BTRFS and WinFS&lt;br /&gt;
&lt;br /&gt;
Tawfic: Looking into the conclusion.&lt;br /&gt;
&lt;br /&gt;
KEY ISSUE: We need a thesis statement. Please suggest ideas.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 01:38, 15 October 2010 (UTC) I think the thesis statement is implied in the current intro, i.e. &amp;quot;.. of avoiding some of the major problems associated&lt;br /&gt;
with traditional file systems . . &amp;quot; suggests that it&#039;s unacceptable anymore to tolerate problems in today&#039;s IT environment. If&lt;br /&gt;
you&#039;d like to expand on it, you could mention the continuous need for flexibility vis-a-vis using data. Example: there&#039;s a growing&lt;br /&gt;
trend with cloud computing (the marketable name for distributed computing). Users who will opt for that option will have to trust&lt;br /&gt;
the host companies with their data. It won&#039;t be acceptable to them to be told that a file here or a directory there was lost. The&lt;br /&gt;
issue with the growth of smart phones and yet to proliferate tablets also increases the demands for flexibility ( need to be able&lt;br /&gt;
to add/shrink/manage storage on the fly and avoid manual intervention when problems arise) . . etc. Hope that helps.&lt;br /&gt;
&lt;br /&gt;
The conclusion would have to assert the main points regarding ZFS, i.e. it&#039;s modularization and administrative simplicity, it&#039;s&lt;br /&gt;
virtualization of storage via the use of SPA and DMU, and it&#039;s self healing abilities. I am currently working on the section&lt;br /&gt;
that talks ( briefly ) about ZFS&#039;s self-healing ( for lack of better words ). So I&#039;ll be online for sometime. The info on SPA&lt;br /&gt;
amd DMU is already there. If it&#039;s not clear enough, please let me know&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 03:05, 15 October 2010 (UTC) I agree completely with the thesis and mentioned this at the bottom of the page.  &lt;br /&gt;
&lt;br /&gt;
Something along the lines of &amp;quot;ZFS is a file system designed to support the changing requirements of computing&amp;quot; as I had mentioned before &amp;quot;server needs was of particular attention&amp;quot; then continue to expand by describing the environment that is causing these changes &amp;quot;more companies with distributed large scale data storage &amp;quot;the cloud&amp;quot; &amp;quot; as Tawfic has suggested this establishes motivation.&lt;br /&gt;
&lt;br /&gt;
Then we mention the goals that were desired extensibility( accomplished through modularization ), reliability ( checksums, copy on write ) and maintainability ( administrative simplicity)&lt;br /&gt;
&lt;br /&gt;
In the intro to ZFS we talk about how it&#039;s feature set supports the design goals.  Tawfic has then done most of the feature descriptions.&lt;br /&gt;
&lt;br /&gt;
The section on legacy filesystems should have a mini-intro talking about the state of the enivronment they were designed for and there goals of the time&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Describe then which has been done.&lt;br /&gt;
&lt;br /&gt;
Small contrast and compare with ZFS generally summarizing along the lines of &amp;quot;gee that sure is better&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Repeat for the other two sections current and future with each contrast/compare getting larger since they more comparable and with different conclusions.&lt;br /&gt;
&lt;br /&gt;
== Deadline ==&lt;br /&gt;
Suggestion: Adding content should stop on Thursday, October 14&#039;th at 3:00 PM. Any work after that&lt;br /&gt;
should go into formatting, spelling, and grammar checking.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:00, 14 October 2010 (UTC)&lt;br /&gt;
- I will definitely be adding content after this time probably late, late into the evening.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:25, 14 October 2010 (UTC) No problem. Forget about the suggested deadline. I thought we&#039;d have to be done by 11:00Pm.&lt;br /&gt;
I am still adding stuff myself. I think Anil will lock the Wiki around 7:00 Am or so. So anytime&lt;br /&gt;
before that is Ok.&lt;br /&gt;
&lt;br /&gt;
== Essay Format Take 2 ==&lt;br /&gt;
Hello. I am suggesting the following format instead. If you agree, I&#039;ll take care of merging the existing info into this new format. My feeling is that this format is&lt;br /&gt;
more flexible and will (hopefully) allow individuals to take a section or a sub-section and work on it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Abstract&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: Main point. Current File Systems are neither versatile enough nor intelligent to handle the rapidly&lt;br /&gt;
 growing needs of dynamic storage.&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the WHYS as to the need for versatile storage (e.g. cloud computing, mobile environments, shifting consumer&lt;br /&gt;
 demand . . etc )&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the need for intelligence (just statements, the body will take care of expanding on these ). E.g. more&lt;br /&gt;
 intelligent FS’s can include Metadata to help crime investigators, smart FS’s could be self healing . . .etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Limitations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Zettabyte File System&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Dissected&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: List the seven components of ZFS and basically what makes a ZFS&lt;br /&gt;
 E.g. interface, various parts, and external needed libraries . . etc.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Features Beyond Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Possible Real-Life Scenarios / Examples&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: 2-3 examples where ZFS was/could/is being considered for use.&lt;br /&gt;
&lt;br /&gt;
 TO-DO : One to two paragraphs stressing / reiterating the main points made in the abstract&lt;br /&gt;
         thesis statement).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Alternatives to ZFS&#039;&#039;&#039;&lt;br /&gt;
 one example is good enough.&lt;br /&gt;
 TO-DO: a brief description of the alternative.&lt;br /&gt;
 Main argument for it’s viability.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Pros/Cons&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: just a list of pluses and minuses&lt;br /&gt;
&lt;br /&gt;
 TO-DO : two to three paragraphs summarizing (this is the conclusion) the main points outlined in the abstract and the body, restating why traditional&lt;br /&gt;
 FS’s are no longer viable, and  stressing once more that ZFS is a valid alternative.&lt;br /&gt;
&lt;br /&gt;
== Essay Format ==&lt;br /&gt;
&lt;br /&gt;
I started working on the main page.  The bullets are to be expanded. Other group are are working in their respective discussion pages but I think it&#039;s all right to put our work in progress on the front page.  Thoughts?--[[User:Lmundt|Lmundt]] 16:14, 6 October 2010 (UTC)&lt;br /&gt;
* [[User:Gbint|Gbint]] 02:03, 7 October 2010 (UTC) Lmundt;  what do you think of listing the capacities of the file system under major features?  I was thinking that we could overview the features in brief, then delve into each one individually.&lt;br /&gt;
* --[[User:Lmundt|Lmundt]] 14:31, 7 October 2010 (UTC) I was thinking about the major structure... I like what your suggesting in one section. So here is the structure I am thinking of.&lt;br /&gt;
&lt;br /&gt;
* Intro &lt;br /&gt;
* Section One ZFS&lt;br /&gt;
** Major feature 1&lt;br /&gt;
** Major feature 2&lt;br /&gt;
** Major feature 3 &lt;br /&gt;
* Section Two Legacy File Systems&lt;br /&gt;
** Legacy File System1( FAT32 ) - what it does&lt;br /&gt;
** Legacy File System2( ext2 ) - what it does&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Three Current File Systems&lt;br /&gt;
** NTFS?&lt;br /&gt;
** ext4?&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Four future file Systems&lt;br /&gt;
** BTRFS&lt;br /&gt;
** WinFS or ??&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Conclusion&lt;br /&gt;
&lt;br /&gt;
What does everyone think of this format?   While everyone should contribute to section one we could divvy up the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 16:29, 9 October 2010 (UTC) The layout looks good; I filled out the data dedup section. I think it has reasonable coverage while staying away from becoming it&#039;s own essay just on deduplication.&lt;br /&gt;
&lt;br /&gt;
The legacy file systems are really not even in the same world as ZFS, so I think the contrasting section should cover a lot of how storage needs have changed.&lt;br /&gt;
&lt;br /&gt;
The current file systems are capable of being expanded into large pools of storage with good redundancy and even advanced features like data deduplication, but they are only a component in a chain of tools (like ext4 + lvm + mdraid + opendedup) rather than an full end-to-end solution.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 23:35, 9 October 2010 (UTC)  The section on deduplication looks good I agree it looks like the right amount of coverage for a portion of a single section.  Your also right about the old file systems not being able to hold a candle to ZFS and the conclusion section should talk about how storage needs and computers changed.  And intro to that section could set the stage for that period as well.  Non-multi-threaded, single processor system with much smaller RAM, even the applications were radically different the Internet was just single webpages without the high performance needs of web commerce and online banking for example.  I have another assignment so won&#039;t be contributing too much until Monday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 23:54, 10 October 2010 (UTC)&lt;br /&gt;
Please take a look at suggested essay format #2 and let me know soon. Time is running out Gents and Ladies :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:35, 11 October 2010 (UTC)&lt;br /&gt;
I think I prefer the outline I proposed only because it&#039;s a very regimented contrast/compare essay format and should get us any marks for format.  Most proper essays don&#039;t usually have a dedicated pros cons list.  Heading more towards a report format I think.  It&#039;s really what everyone agrees on.  I won&#039;t be touching the essay until tomorrow though.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 17:32, 11 October 2010 (UTC)&lt;br /&gt;
I like Lmundt&#039;s outline.  How would you like to divide up the work?  Also can everyone post the contact information so we know exactly who is in our group.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:03, 11 October 2010 (UTC)&lt;br /&gt;
No problem, I&#039;ll go with the current format. One issue to keep in mind is that this is an essay, not a report. I.E. the intro/thesis has to include&lt;br /&gt;
a reasonable suggestion towards using ZFS as a reliable FS. The body and the conclusion would have to assert that. The current format satisfies that&lt;br /&gt;
if we keep these points in mind. I started looking into the &amp;quot;dissect subsection&amp;quot; in the format I suggested, which is related to the ZFS features&lt;br /&gt;
section one in the current format. I&#039;ll continue to look into that part (above section, who is doing what will be updated accordingly), i.e. I&#039;ll&lt;br /&gt;
take care of section one since I&#039;ve already done some work on it. I suggest that each member of the group picks two items from one of the other&lt;br /&gt;
sections, except the contrasting part. Content in section one can then be used to finalize the comparisons in each of sections 2-4. The Intro/Abstract&lt;br /&gt;
and conclusion sections can be left to the end, and can be done collaboratively. I.E. once we have a very clear picture of all the&lt;br /&gt;
different pieces.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:18, 12 October 2010 (UTC)&lt;br /&gt;
I will begin working on section three current File Systems unless someone else has already begun working on it.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 20:29, 12 October 2010 (UTC)&lt;br /&gt;
I am going to start researching for section 2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:15, 13 October 2010 (UTC)  Alright so all the sections are being taken care of so we should be good to go for Thursday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:35, 13 October 2010 (UTC) &#039;&#039;&#039;No one is assigned to section four&#039;&#039;&#039; ? Also, for those who haven&#039;t picked any section or subsection, please help out with the sections you&#039;re&lt;br /&gt;
more familiar with.&lt;br /&gt;
&lt;br /&gt;
Finally, if you were in class today (well, technically yesterday), then you&#039;ve heard Anil talk about plagiarism. I know this is common knowledge, so forgive&lt;br /&gt;
the annoying reminder. Please never copy and paste, and make sure to cite your info. As Anil mentioned, if anyone plagiarises, we are ALL responsible. It is&lt;br /&gt;
simply impossible for the rest of the group to check whether every member&#039;s sentence is genuine or not. So use your own words/phrases ( doesn&#039;t&lt;br /&gt;
have to be fancy or sophisticated ). If you&#039;re not sure, please check with the rest of the group.&lt;br /&gt;
&lt;br /&gt;
Good luck, and good night.&lt;br /&gt;
--Tawfic&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 14:55, 13 October 2010 (UTC)  My bad I misread something I thought you were doing current file systems section 3.  I&#039;ll take section 3 but then someone needs to do section 4.  There are 4 of us so this should not be a problem.&lt;br /&gt;
&lt;br /&gt;
--[[User:Naseido|Naseido]] 13 October 2010  Sorry I haven&#039;t contributed till now. The outline looks great and I think we can spend most of the day tomorrow editing to make sure all the sections fit together like an essay. I&#039;ll be doing section 4.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 16:11, 13 October 2010 (UTC) Hi. In section 4 the most important one is BTRFS. More info on that and less info on the others is Ok.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:00, 14 October 2010 (UTC)&lt;br /&gt;
I have done what I can for the legacy file systems, if someone who doesn&#039;t have any particular job wouldn&#039;t mind going over it and correcting any errors they see. I am also not familiar with how to edit/format these wiki pages so I tried my best and if you want to change the layout then please do, I would assume after we complete our sections and collaborate them into 1 essay that the formatting will change. I simply put headings on each section just so it is easier to read.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:55, 14 October 2010 (UTC) A reference for wiki editing http://meta.wikimedia.org/wiki/Help:Editing&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:42, 14 October 2010 (UTC)  I&#039;m not going to have my info posted by 3:00.  Also how and where are we supposed to cite our sources?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:28, 14 October 2010 (UTC) No worries. You have till 7:00 Am ( or till Anil locks the Wiki down, though I wouldn&#039;t count on more than 7) Friday, Oct 15. For citing, I am using&lt;br /&gt;
this convention. Bla.....Bla [Z1. P3] means I am using info from page 3 of article labeled as Z1 in references section.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 20:48, 14 October 2010 (UTC) Citation reference looks good.  I think in each section we should talk about the motivation behind the design. A small into for each section.  For example in the legacy area fat32 and ext, we could talk about computing becoming commonplace for the average worker so most development was for single users with a relatively small hardrive, not too many files.  It will in-turn lead to justify/explanation for the design decission for each vintage of OS. &lt;br /&gt;
The main intro should about the motivations behind the design.  Intended for servers with a focus or expandability, reliability and self maintenance.  This is the motivation behind all those cool features we are detailing.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
Not from your group. Found a file which goes to the heart of your problem&lt;br /&gt;
[http://www.oracle.com/technetwork/server-storage/solaris/overview/zfs-14990&lt;br /&gt;
2.pdf ZFSDatasheet]&lt;br /&gt;
[[User:Gautam|Gautam]] 22:50, 5 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Thanks will take a look at that.--[[User:Lmundt|Lmundt]] 16:12, 6 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 01:45, 7 October 2010 (UTC) paper from Sun engineers explaining why they came to build ZFS, the problems they wanted to solve:  &lt;br /&gt;
* PDF:  http://www.timwort.org/classp/200_HTML/docs/zfs_wp.pdf&lt;br /&gt;
* HTML: http://74.125.155.132/scholar?q=cache:6Ex3KbFo4lYJ:scholar.google.com/+zettabyte+file+system&amp;amp;hl=en&amp;amp;as_sdt=2000&lt;br /&gt;
&lt;br /&gt;
Excellent article.[[User:Lmundt|Lmundt]] 14:24, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Not too exciting but it looks like an easy read http://arstechnica.com/hardware/news/2008/03/past-present-future-file-systems.ars [[User:Lmundt|Lmundt]] 14:40, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
the [http://en.wikipedia.org/wiki/Comparison_of_file_systems wikipedia comparison] has some good tables, and if you click the various categories you can learn quite a bit about the various important features //not your group. [[User:Rift|Rift]] 18:56, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Hey, I&#039;m not from your group but I found this slideshow that was really handy in the assignment! http://www.slideshare.net/Clogeny/zfs-the-last-word-in-filesystems - nshires&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hey there. I&#039;m not a member of your group. But you guys might want to look at this Wiki-page from the SolarisInternals website. I used it today for our assignment, a lot of interesting and in-depth breakdown of the ZFS file system: http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#ZFS_Performance_Considerations&lt;br /&gt;
&lt;br /&gt;
-- Munther&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:56, 13 October 2010 (UTC) Good intro to understanding FAT FS&lt;br /&gt;
http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:49, 14 October 2010 (UTC)&lt;br /&gt;
Abit late but I found a comparison of current file systems including ZFS:&lt;br /&gt;
http://www.idt.mdh.se/kurser/ct3340/ht09/ADMINISTRATION/IRCSE09-submissions/ircse09_submission_16.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4545</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4545"/>
		<updated>2010-10-15T05:32:44Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
The DMU uses copy-on-write for all blocks. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified&lt;br /&gt;
traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. Starting development just three years after ZFS main goals of extensibility, reliability and maintainability are clearly visible in the feature set of Btrfs.&lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure.  In Btrfs not only are files and directories stored in a B-tree but so are file system data such as extents, transaction logs, data relocation, chuncks. where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation of Btrfs is quite interesting the developers created it with good coding practices.  Fist of all Btrfs has very simple underlying components this allows wasy understanding of the basic components by most developers.  Additionally the system uses the B-trees structure extensively in addition to actual data and meta-data storage the structures that maintain and track space allocation use B-trees as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* C. Pugh, P. Henderson, K. Silber, T. Caroll, K. Ying, Information Technology Division, Princeton Plasma Physics Laboratory (PPPL), Utilizing ZFS For the Storage of Acquired Data [Z5] &lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] MATHUR, A., CAO, M., BHATTACHARYA, S., DILGER, A., TOMAS, A., VIVIER, L., AND S.A.S., B. 2007. The&lt;br /&gt;
new Ext4 filesystem: current status and future plans. In Ottawa Linux Symposium (OLS’07).&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4539</id>
		<title>Talk:COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4539"/>
		<updated>2010-10-15T05:17:48Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Who is doing what */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Contacts / If interested ==&lt;br /&gt;
Tawfic : tfatah@gmail.com&lt;br /&gt;
&lt;br /&gt;
Andy Zemancik: andy.zemancik@gmail.com&lt;br /&gt;
&lt;br /&gt;
Lester Mundt: lmundt@gmail.com&lt;br /&gt;
&lt;br /&gt;
Matthew Chou : mateh.cc@gmail.com (this is mchou2)&lt;br /&gt;
&lt;br /&gt;
Nisrin Abou-Seido: naseido@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
== Suggested References Format ==&lt;br /&gt;
Author, publisher/university, Name of the article&lt;br /&gt;
&lt;br /&gt;
== Who is doing what ==&lt;br /&gt;
Suggestion: In order to avoid duplication. Please state what section/item you&#039;re currently working on.&lt;br /&gt;
&lt;br /&gt;
Azemanci: Currently working on Section Three Current File Systems.&lt;br /&gt;
&lt;br /&gt;
Nisrin (naseido): Working on intro, conclusion and editing&lt;br /&gt;
&lt;br /&gt;
Lester: Working on section 3 BTRFS and WinFS&lt;br /&gt;
&lt;br /&gt;
KEY ISSUE: We need a thesis statement. Please suggest ideas.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 01:38, 15 October 2010 (UTC) I think the thesis statement is implied in the current intro, i.e. &amp;quot;.. of avoiding some of the major problems associated&lt;br /&gt;
with traditional file systems . . &amp;quot; suggests that it&#039;s unacceptable anymore to tolerate problems in today&#039;s IT environment. If&lt;br /&gt;
you&#039;d like to expand on it, you could mention the continuous need for flexibility vis-a-vis using data. Example: there&#039;s a growing&lt;br /&gt;
trend with cloud computing (the marketable name for distributed computing). Users who will opt for that option will have to trust&lt;br /&gt;
the host companies with their data. It won&#039;t be acceptable to them to be told that a file here or a directory there was lost. The&lt;br /&gt;
issue with the growth of smart phones and yet to proliferate tablets also increases the demands for flexibility ( need to be able&lt;br /&gt;
to add/shrink/manage storage on the fly and avoid manual intervention when problems arise) . . etc. Hope that helps.&lt;br /&gt;
&lt;br /&gt;
The conclusion would have to assert the main points regarding ZFS, i.e. it&#039;s modularization and administrative simplicity, it&#039;s&lt;br /&gt;
virtualization of storage via the use of SPA and DMU, and it&#039;s self healing abilities. I am currently working on the section&lt;br /&gt;
that talks ( briefly ) about ZFS&#039;s self-healing ( for lack of better words ). So I&#039;ll be online for sometime. The info on SPA&lt;br /&gt;
amd DMU is already there. If it&#039;s not clear enough, please let me know&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 03:05, 15 October 2010 (UTC) I agree completely with the thesis and mentioned this at the bottom of the page.  &lt;br /&gt;
&lt;br /&gt;
Something along the lines of &amp;quot;ZFS is a file system designed to support the changing requirements of computing&amp;quot; as I had mentioned before &amp;quot;server needs was of particular attention&amp;quot; then continue to expand by describing the environment that is causing these changes &amp;quot;more companies with distributed large scale data storage &amp;quot;the cloud&amp;quot; &amp;quot; as Tawfic has suggested this establishes motivation.&lt;br /&gt;
&lt;br /&gt;
Then we mention the goals that were desired extensibility( accomplished through modularization ), reliability ( checksums, copy on write ) and maintainability ( administrative simplicity)&lt;br /&gt;
&lt;br /&gt;
In the intro to ZFS we talk about how it&#039;s feature set supports the design goals.  Tawfic has then done most of the feature descriptions.&lt;br /&gt;
&lt;br /&gt;
The section on legacy filesystems should have a mini-intro talking about the state of the enivronment they were designed for and there goals of the time&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Describe then which has been done.&lt;br /&gt;
&lt;br /&gt;
Small contrast and compare with ZFS generally summarizing along the lines of &amp;quot;gee that sure is better&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Repeat for the other two sections current and future with each contrast/compare getting larger since they more comparable and with different conclusions.&lt;br /&gt;
&lt;br /&gt;
== Deadline ==&lt;br /&gt;
Suggestion: Adding content should stop on Thursday, October 14&#039;th at 3:00 PM. Any work after that&lt;br /&gt;
should go into formatting, spelling, and grammar checking.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:00, 14 October 2010 (UTC)&lt;br /&gt;
- I will definitely be adding content after this time probably late, late into the evening.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:25, 14 October 2010 (UTC) No problem. Forget about the suggested deadline. I thought we&#039;d have to be done by 11:00Pm.&lt;br /&gt;
I am still adding stuff myself. I think Anil will lock the Wiki around 7:00 Am or so. So anytime&lt;br /&gt;
before that is Ok.&lt;br /&gt;
&lt;br /&gt;
== Essay Format Take 2 ==&lt;br /&gt;
Hello. I am suggesting the following format instead. If you agree, I&#039;ll take care of merging the existing info into this new format. My feeling is that this format is&lt;br /&gt;
more flexible and will (hopefully) allow individuals to take a section or a sub-section and work on it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Abstract&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: Main point. Current File Systems are neither versatile enough nor intelligent to handle the rapidly&lt;br /&gt;
 growing needs of dynamic storage.&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the WHYS as to the need for versatile storage (e.g. cloud computing, mobile environments, shifting consumer&lt;br /&gt;
 demand . . etc )&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the need for intelligence (just statements, the body will take care of expanding on these ). E.g. more&lt;br /&gt;
 intelligent FS’s can include Metadata to help crime investigators, smart FS’s could be self healing . . .etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Limitations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Zettabyte File System&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Dissected&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: List the seven components of ZFS and basically what makes a ZFS&lt;br /&gt;
 E.g. interface, various parts, and external needed libraries . . etc.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Features Beyond Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Possible Real-Life Scenarios / Examples&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: 2-3 examples where ZFS was/could/is being considered for use.&lt;br /&gt;
&lt;br /&gt;
 TO-DO : One to two paragraphs stressing / reiterating the main points made in the abstract&lt;br /&gt;
         thesis statement).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Alternatives to ZFS&#039;&#039;&#039;&lt;br /&gt;
 one example is good enough.&lt;br /&gt;
 TO-DO: a brief description of the alternative.&lt;br /&gt;
 Main argument for it’s viability.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Pros/Cons&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: just a list of pluses and minuses&lt;br /&gt;
&lt;br /&gt;
 TO-DO : two to three paragraphs summarizing (this is the conclusion) the main points outlined in the abstract and the body, restating why traditional&lt;br /&gt;
 FS’s are no longer viable, and  stressing once more that ZFS is a valid alternative.&lt;br /&gt;
&lt;br /&gt;
== Essay Format ==&lt;br /&gt;
&lt;br /&gt;
I started working on the main page.  The bullets are to be expanded. Other group are are working in their respective discussion pages but I think it&#039;s all right to put our work in progress on the front page.  Thoughts?--[[User:Lmundt|Lmundt]] 16:14, 6 October 2010 (UTC)&lt;br /&gt;
* [[User:Gbint|Gbint]] 02:03, 7 October 2010 (UTC) Lmundt;  what do you think of listing the capacities of the file system under major features?  I was thinking that we could overview the features in brief, then delve into each one individually.&lt;br /&gt;
* --[[User:Lmundt|Lmundt]] 14:31, 7 October 2010 (UTC) I was thinking about the major structure... I like what your suggesting in one section. So here is the structure I am thinking of.&lt;br /&gt;
&lt;br /&gt;
* Intro &lt;br /&gt;
* Section One ZFS&lt;br /&gt;
** Major feature 1&lt;br /&gt;
** Major feature 2&lt;br /&gt;
** Major feature 3 &lt;br /&gt;
* Section Two Legacy File Systems&lt;br /&gt;
** Legacy File System1( FAT32 ) - what it does&lt;br /&gt;
** Legacy File System2( ext2 ) - what it does&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Three Current File Systems&lt;br /&gt;
** NTFS?&lt;br /&gt;
** ext4?&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Four future file Systems&lt;br /&gt;
** BTRFS&lt;br /&gt;
** WinFS or ??&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Conclusion&lt;br /&gt;
&lt;br /&gt;
What does everyone think of this format?   While everyone should contribute to section one we could divvy up the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 16:29, 9 October 2010 (UTC) The layout looks good; I filled out the data dedup section. I think it has reasonable coverage while staying away from becoming it&#039;s own essay just on deduplication.&lt;br /&gt;
&lt;br /&gt;
The legacy file systems are really not even in the same world as ZFS, so I think the contrasting section should cover a lot of how storage needs have changed.&lt;br /&gt;
&lt;br /&gt;
The current file systems are capable of being expanded into large pools of storage with good redundancy and even advanced features like data deduplication, but they are only a component in a chain of tools (like ext4 + lvm + mdraid + opendedup) rather than an full end-to-end solution.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 23:35, 9 October 2010 (UTC)  The section on deduplication looks good I agree it looks like the right amount of coverage for a portion of a single section.  Your also right about the old file systems not being able to hold a candle to ZFS and the conclusion section should talk about how storage needs and computers changed.  And intro to that section could set the stage for that period as well.  Non-multi-threaded, single processor system with much smaller RAM, even the applications were radically different the Internet was just single webpages without the high performance needs of web commerce and online banking for example.  I have another assignment so won&#039;t be contributing too much until Monday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 23:54, 10 October 2010 (UTC)&lt;br /&gt;
Please take a look at suggested essay format #2 and let me know soon. Time is running out Gents and Ladies :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:35, 11 October 2010 (UTC)&lt;br /&gt;
I think I prefer the outline I proposed only because it&#039;s a very regimented contrast/compare essay format and should get us any marks for format.  Most proper essays don&#039;t usually have a dedicated pros cons list.  Heading more towards a report format I think.  It&#039;s really what everyone agrees on.  I won&#039;t be touching the essay until tomorrow though.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 17:32, 11 October 2010 (UTC)&lt;br /&gt;
I like Lmundt&#039;s outline.  How would you like to divide up the work?  Also can everyone post the contact information so we know exactly who is in our group.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:03, 11 October 2010 (UTC)&lt;br /&gt;
No problem, I&#039;ll go with the current format. One issue to keep in mind is that this is an essay, not a report. I.E. the intro/thesis has to include&lt;br /&gt;
a reasonable suggestion towards using ZFS as a reliable FS. The body and the conclusion would have to assert that. The current format satisfies that&lt;br /&gt;
if we keep these points in mind. I started looking into the &amp;quot;dissect subsection&amp;quot; in the format I suggested, which is related to the ZFS features&lt;br /&gt;
section one in the current format. I&#039;ll continue to look into that part (above section, who is doing what will be updated accordingly), i.e. I&#039;ll&lt;br /&gt;
take care of section one since I&#039;ve already done some work on it. I suggest that each member of the group picks two items from one of the other&lt;br /&gt;
sections, except the contrasting part. Content in section one can then be used to finalize the comparisons in each of sections 2-4. The Intro/Abstract&lt;br /&gt;
and conclusion sections can be left to the end, and can be done collaboratively. I.E. once we have a very clear picture of all the&lt;br /&gt;
different pieces.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:18, 12 October 2010 (UTC)&lt;br /&gt;
I will begin working on section three current File Systems unless someone else has already begun working on it.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 20:29, 12 October 2010 (UTC)&lt;br /&gt;
I am going to start researching for section 2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:15, 13 October 2010 (UTC)  Alright so all the sections are being taken care of so we should be good to go for Thursday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:35, 13 October 2010 (UTC) &#039;&#039;&#039;No one is assigned to section four&#039;&#039;&#039; ? Also, for those who haven&#039;t picked any section or subsection, please help out with the sections you&#039;re&lt;br /&gt;
more familiar with.&lt;br /&gt;
&lt;br /&gt;
Finally, if you were in class today (well, technically yesterday), then you&#039;ve heard Anil talk about plagiarism. I know this is common knowledge, so forgive&lt;br /&gt;
the annoying reminder. Please never copy and paste, and make sure to cite your info. As Anil mentioned, if anyone plagiarises, we are ALL responsible. It is&lt;br /&gt;
simply impossible for the rest of the group to check whether every member&#039;s sentence is genuine or not. So use your own words/phrases ( doesn&#039;t&lt;br /&gt;
have to be fancy or sophisticated ). If you&#039;re not sure, please check with the rest of the group.&lt;br /&gt;
&lt;br /&gt;
Good luck, and good night.&lt;br /&gt;
--Tawfic&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 14:55, 13 October 2010 (UTC)  My bad I misread something I thought you were doing current file systems section 3.  I&#039;ll take section 3 but then someone needs to do section 4.  There are 4 of us so this should not be a problem.&lt;br /&gt;
&lt;br /&gt;
--[[User:Naseido|Naseido]] 13 October 2010  Sorry I haven&#039;t contributed till now. The outline looks great and I think we can spend most of the day tomorrow editing to make sure all the sections fit together like an essay. I&#039;ll be doing section 4.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 16:11, 13 October 2010 (UTC) Hi. In section 4 the most important one is BTRFS. More info on that and less info on the others is Ok.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:00, 14 October 2010 (UTC)&lt;br /&gt;
I have done what I can for the legacy file systems, if someone who doesn&#039;t have any particular job wouldn&#039;t mind going over it and correcting any errors they see. I am also not familiar with how to edit/format these wiki pages so I tried my best and if you want to change the layout then please do, I would assume after we complete our sections and collaborate them into 1 essay that the formatting will change. I simply put headings on each section just so it is easier to read.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:55, 14 October 2010 (UTC) A reference for wiki editing http://meta.wikimedia.org/wiki/Help:Editing&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:42, 14 October 2010 (UTC)  I&#039;m not going to have my info posted by 3:00.  Also how and where are we supposed to cite our sources?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:28, 14 October 2010 (UTC) No worries. You have till 7:00 Am ( or till Anil locks the Wiki down, though I wouldn&#039;t count on more than 7) Friday, Oct 15. For citing, I am using&lt;br /&gt;
this convention. Bla.....Bla [Z1. P3] means I am using info from page 3 of article labeled as Z1 in references section.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 20:48, 14 October 2010 (UTC) Citation reference looks good.  I think in each section we should talk about the motivation behind the design. A small into for each section.  For example in the legacy area fat32 and ext, we could talk about computing becoming commonplace for the average worker so most development was for single users with a relatively small hardrive, not too many files.  It will in-turn lead to justify/explanation for the design decission for each vintage of OS. &lt;br /&gt;
The main intro should about the motivations behind the design.  Intended for servers with a focus or expandability, reliability and self maintenance.  This is the motivation behind all those cool features we are detailing.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
Not from your group. Found a file which goes to the heart of your problem&lt;br /&gt;
[http://www.oracle.com/technetwork/server-storage/solaris/overview/zfs-14990&lt;br /&gt;
2.pdf ZFSDatasheet]&lt;br /&gt;
[[User:Gautam|Gautam]] 22:50, 5 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Thanks will take a look at that.--[[User:Lmundt|Lmundt]] 16:12, 6 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 01:45, 7 October 2010 (UTC) paper from Sun engineers explaining why they came to build ZFS, the problems they wanted to solve:  &lt;br /&gt;
* PDF:  http://www.timwort.org/classp/200_HTML/docs/zfs_wp.pdf&lt;br /&gt;
* HTML: http://74.125.155.132/scholar?q=cache:6Ex3KbFo4lYJ:scholar.google.com/+zettabyte+file+system&amp;amp;hl=en&amp;amp;as_sdt=2000&lt;br /&gt;
&lt;br /&gt;
Excellent article.[[User:Lmundt|Lmundt]] 14:24, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Not too exciting but it looks like an easy read http://arstechnica.com/hardware/news/2008/03/past-present-future-file-systems.ars [[User:Lmundt|Lmundt]] 14:40, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
the [http://en.wikipedia.org/wiki/Comparison_of_file_systems wikipedia comparison] has some good tables, and if you click the various categories you can learn quite a bit about the various important features //not your group. [[User:Rift|Rift]] 18:56, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Hey, I&#039;m not from your group but I found this slideshow that was really handy in the assignment! http://www.slideshare.net/Clogeny/zfs-the-last-word-in-filesystems - nshires&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hey there. I&#039;m not a member of your group. But you guys might want to look at this Wiki-page from the SolarisInternals website. I used it today for our assignment, a lot of interesting and in-depth breakdown of the ZFS file system: http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#ZFS_Performance_Considerations&lt;br /&gt;
&lt;br /&gt;
-- Munther&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:56, 13 October 2010 (UTC) Good intro to understanding FAT FS&lt;br /&gt;
http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:49, 14 October 2010 (UTC)&lt;br /&gt;
Abit late but I found a comparison of current file systems including ZFS:&lt;br /&gt;
http://www.idt.mdh.se/kurser/ct3340/ht09/ADMINISTRATION/IRCSE09-submissions/ircse09_submission_16.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4538</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4538"/>
		<updated>2010-10-15T05:16:48Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* ZFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
The DMU uses copy-on-write for all blocks. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified&lt;br /&gt;
traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. &lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] http://www.kernel.org/doc/ols/2007/ols2007v2-pages-21-34.pdf&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4537</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4537"/>
		<updated>2010-10-15T05:15:43Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* ZFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
The DMU uses copy-on-write for all blocks. Whenever a block needs to be modified, a new block is created, and the old block is then copied to the new block. Any pointers and / or indirect blocks are then modified&lt;br /&gt;
traversing all the way up to the uberblock. [Z1]&lt;br /&gt;
&lt;br /&gt;
The DMU thus ensures data integrity all the time. This is considered self-healing simply because it prevents major problems, such as silent data corruption, which are hard to detect.&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3. ext3 had a very large overhead when dealing with larger files.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]  The primary goal of ext4 was to increase the amount of storage possible.&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
Btrfs, the B-tree File System was started by Oracle systems in 2007 , is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. &lt;br /&gt;
&lt;br /&gt;
Btrfs is based on the b-tree structure where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btrfs upon first inspection seems near identical to ZFS currently however Btrfs lacks a couple features the ZFS does have.  Btrfs doesn&#039;t have the self-heading capability or data deduplication of ZFS.  ZFS also support more configurations of software RAID than Btrfs.[http://en.wikipedia.org/wiki/Btrfs]&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] http://www.kernel.org/doc/ols/2007/ols2007v2-pages-21-34.pdf&lt;br /&gt;
&lt;br /&gt;
* Heger Dominique A., (Post 2007), [http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf &amp;quot;Workload Dependent Performance Evaluation of the Btrfs and ZFS Filesystems&amp;quot;], DHTechnologies&lt;br /&gt;
&lt;br /&gt;
* Unaccredited, [http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-design.html &amp;quot;Btrfs Design&amp;quot;], Oracle&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4429</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4429"/>
		<updated>2010-10-15T03:38:23Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* ZFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
To self-heal a corrupted block, ZFS uses checksumming. It helps here to imagine blocks as part of a tree where the actual data resides at the leaves. The root node, in ZFS&#039; terminology, is called the uberblock [Z1. P8].&lt;br /&gt;
Each block has a checksum which is maintained by the block parent&#039;s indirect block. The scheme of maintaining the checksum and the data separately reduces the probability of simultaneous corruption.&lt;br /&gt;
&lt;br /&gt;
If a write fails for whatever reason, the uberblock is able to detect the failure since it has access to the checksum of the corrupted block. The uberblock is able then to retrieve a backup from another&lt;br /&gt;
location and correct ( heal ) the related block. [Z1. P7-9].  &lt;br /&gt;
&lt;br /&gt;
Lastly, in ZFS&#039;s arsenal of self-healing, comes copy-on-write.&lt;br /&gt;
&lt;br /&gt;
TO-DO&lt;br /&gt;
copy-on-write&lt;br /&gt;
Almost finished --Tawfic&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
--posted by [Naseido] -- just starting a rough draft for an intro to B-trees&lt;br /&gt;
--source: http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf ( found through Google Scholar)&lt;br /&gt;
&lt;br /&gt;
BTRFS, B-tree File System, is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. BTRFS is based on the b-tree structure where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] http://www.kernel.org/doc/ols/2007/ols2007v2-pages-21-34.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4357</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4357"/>
		<updated>2010-10-15T02:43:37Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* ZFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
ZPL also plays an important role in achieving data consistency, and maintaining its integrity. This brings us to the topic of how ZFS achieves self-healing. We will tackle the main strategies followed by ZFS.&lt;br /&gt;
&lt;br /&gt;
These can be summed as : checksumming, copy-on-write, and the use of transactions.&lt;br /&gt;
&lt;br /&gt;
Starting with transactions, ZPL combines data write changes to objects and uses the DMU object transaction interface to perform the updates. [Z1.P9]. Consistency thus is assured since updates are done atomically.&lt;br /&gt;
&lt;br /&gt;
TO-DO&lt;br /&gt;
copy-on-write&lt;br /&gt;
checksumming&lt;br /&gt;
&lt;br /&gt;
TO-DO : Not finished yet --Tawfic&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
--posted by [Naseido] -- just starting a rough draft for an intro to B-trees&lt;br /&gt;
--source: http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf ( found through Google Scholar)&lt;br /&gt;
&lt;br /&gt;
BTRFS, B-tree File System, is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. BTRFS is based on the b-tree structure where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] http://www.kernel.org/doc/ols/2007/ols2007v2-pages-21-34.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4318</id>
		<title>COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Essay_1_2010_Question_9&amp;diff=4318"/>
		<updated>2010-10-15T01:45:18Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* ZFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Question=&lt;br /&gt;
&lt;br /&gt;
What requirements distinguish the Zettabyte File System (ZFS) from traditional file systems? How are those requirements realized in ZFS, and how do other operating systems address those same requirements? (Please discuss legacy, current, and in-development systems.)&lt;br /&gt;
&lt;br /&gt;
=Answer=&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Introduction&#039;&#039;&#039; ==&lt;br /&gt;
ZFS was developed by Sun Microsystems in order to handle the functionality required by a file system, as well as a volume manager. Some of the motivations behind its development were modularity and simplicity, immense scalability (ZFS is a 128-bit file system), and ease of administration. Also, ZFS was designed with the aim of avoiding some of the major problems associated with traditional file systems. In particular, it avoids possible data corruption, especially silent corruption, as well as the inability to expand and shrink storage dynamically, the inability to fix bad blocks automatically, a low level of abstractions and a lack of simple interfaces. [Z2]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;ZFS&#039;&#039;&#039; ==&lt;br /&gt;
ZFS differs from major traditional file systems in various ways. Some of the primary ones are modularity, virtualization&lt;br /&gt;
of storage, and the ability to self-repair. A brief look at ZFS&#039; various components will help illustrate those differences.&lt;br /&gt;
&lt;br /&gt;
The following subsystems makeup ZFS [Z3. P2].&lt;br /&gt;
 # SPA (Storage Pool Allocator).&lt;br /&gt;
 # DSL (Data Set and snapshot Layer).	&lt;br /&gt;
 # DMU (Data Management Unit).&lt;br /&gt;
 # ZAP (ZFS Attributes Processor).&lt;br /&gt;
 # ZPL (ZFS POSIX Layer).&lt;br /&gt;
 # ZIL (ZFS Intent Log).&lt;br /&gt;
 # ZVOL (ZFS Volume).&lt;br /&gt;
&lt;br /&gt;
The ways in which these components deliver the aforementioned characteristics are illustrated next. Modularity is achieved in the same way as any non-trivial software system,&lt;br /&gt;
i.e. via the division of responsibilities across various modules (in this case, seven modules). Each one of these modules provides a specific functionality, as a consequence,&lt;br /&gt;
the entire system becomes simpler and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Storage virtualization is simplified by the removal of a volume manager, a component common in traditional file systems. The main issue with a volume manager is that it doesn&#039;t abstract the underlying physical storage enough. In other words, physical blocks are abstracted as logical ones. Yet, a consecutive sequence of blocks is still needed when creating a file system. That leads to issues such as the need to partition the disk (or disks) and the fact that once storage is assigned to a particular file system, even when not used, can not be shared with other file systems.&lt;br /&gt;
&lt;br /&gt;
In ZFS, the idea of pooled storage is used. A storage pool abstracts all available storage, and is managed by the SPA. The SPA can be thought of as a collection of API&#039;s to allocate and free blocks of storage, using the blocks&#039; DVA&#039;s (data virtual addresses). It behaves like malloc() and free(). Instead of memory though, physical storage is allocated and freed. The main point here is that all the details of the storage are abstracted from the caller.&lt;br /&gt;
&lt;br /&gt;
ZFS uses DVA&#039;s to simplify the operations of adding and removing storage. Since a virtual address is used, storage can be added and/or removed from the pool dynamically. Since the SPA uses 128-bit block addresses, it will take a very long time before that technology encounters limitations. Even then, the SPA module can be replaced, with the remaining modules of ZFS intact. To facilitate the SPA&#039;s work, ZFS enlists the help of the DMU and implements the idea of virtual devices.&lt;br /&gt;
&lt;br /&gt;
Virtual devices (vdevs) abstract virtual device drivers. A vdev can be thought of as a node with possible children. Each child can be another virtual device ( i.e. a vdev ) or a device driver. The SPA also handles the&lt;br /&gt;
traditional volume manager tasks like mirroring for example. It accomplishes such tasks via the use of vdevs. Each vdev implements a specific task. In this case, if SPA needed to handle mirroring, a vdev&lt;br /&gt;
would be written to handle mirroring. It is clear here that adding new functionality is straightforward, given the clear separation of modules and the use of interfaces.  &lt;br /&gt;
 &lt;br /&gt;
The DMU (Data Management Unit) accepts blocks as input from the SPA, and produces objects. In ZFS, files and directories are viewed as objects. An object&lt;br /&gt;
in ZFS is labelled with a 64 bit number and can hold up to 2^64 bytes of information. [Z1. P8].&lt;br /&gt;
 &lt;br /&gt;
ZFS uses the idea of a dnode. A dnode is a data structure that stores information about blocks per object. In other words, it provides a lower level abstraction so that a collection of one ore more blocks can be treated as an object. A collection of objects thus, referred to as object sets, is used to describe the file system. In essence then, in ZFS, a file system is a collection of object sets, each of which is a collection of objects, and in turn,  a collection of blocks. Such levels of abstraction increase ZFS&#039; flexibility and simplifies its management. [Z3 P2]. Lastly, with respect to flexibility at least, the ZFS POSIX layer provides a POSIX compliant layer to manage DMU&lt;br /&gt;
objects. This allows any software developed for a POSIX compliant file system to work seamlessly with ZFS.&lt;br /&gt;
&lt;br /&gt;
TO-DO:&lt;br /&gt;
How ZFS maintains Data integrity and accomplishes self healing ?&lt;br /&gt;
&lt;br /&gt;
copy-on-write&lt;br /&gt;
checksumming&lt;br /&gt;
Use of Transactions&lt;br /&gt;
&lt;br /&gt;
TO-DO : Not finished yet --Tawfic&lt;br /&gt;
&lt;br /&gt;
====Data Integrity====&lt;br /&gt;
&lt;br /&gt;
At the lowest level, ZFS uses checksums for every block of data that is written to disk.  The checksum is checked whenever data is read to ensure that data has not been corrupted in some way.  The idea is that if either the block or the checksum is corrupted, then recalculating the checksum for the block will result in a mismatch between the calculated and stored checksums.  It is possible that both the block and checksum record could be corrupted, but the probability of the corruption being such that the corrupted block&#039;s checksum matches the corrupted checksum is exceptionally low.&lt;br /&gt;
&lt;br /&gt;
In the event that a bad checksum is found, replication of data, in the form of &amp;quot;Ditto Blocks&amp;quot; provide an opportunity for recovery.  A block pointer in ZFS is actually capable of pointing to multiple blocks, each of which contains duplicate data.  By default, duplicate blocks are only stored for file system metadata, but this can be expanded to user data blocks as well.  When a bad checksum is read, ZFS is able to follow one of the other pointers in the block pointer to hopefully find a healthy block.&lt;br /&gt;
&lt;br /&gt;
RAID setups are particularly well suited to ZFS, since there is already an abstraction between the physical storage and the zpools.  Besides protecting from outright total disk failure, if a bad checksum is found, there is the possibility that one of the alternate disks has a healthy version. If these errors accumulate, it can signal an impending drive failure.  When a drive does fail, some of our tolerance for data loss is consumed; that is, the system is operating at less than 100% redundancy (however that is defined for the system at hand). To address this, ZFS supports &amp;quot;hot spares&amp;quot;, idle drives that can be brought online automatically when another drive fails so that full redundancy can be rebuilt with minimal delay, hopefully in time for the next drive failure.&lt;br /&gt;
&lt;br /&gt;
With block-by-block data integrity well in hand, ZFS also employs a transactional update model to ensure that higher level data structures remain consistent. Rather than use a journal to allow for quick consistency checking in the event of a system crash, ZFS uses a copy-on-write model.  New disk structures are written out in a detached state.  Once these structures have been written and checked, then they are connected to the existing disk structures in one atomic write, with the structures they replace becoming disconnected.&lt;br /&gt;
&lt;br /&gt;
At the user level, ZFS supports file-system snapshots.  Essentially, a clone of the entire file system at a certain point in time is created.  In the event of accidental file deletion, a user can access an older version out of a recent snapshot.&lt;br /&gt;
&lt;br /&gt;
====Data Deduplication====&lt;br /&gt;
&lt;br /&gt;
Data Deduplication is a method of interfile storage compression, based around the idea of storing any one block of unique data only once physically, and logically linking that block to each file that contains that data.  Effective use of data deduplication can reduce the space and power requirements of physical storage, but only if you have data that lends itself to deduplication.&lt;br /&gt;
&lt;br /&gt;
Data Deduplication schemes are typically implemented using hash-tables, and can be applied to whole files, sub files (blocks), or as a patch set.   There is an inherit trade off between the granularity of your deduplication algorithm and the resources needed to implement it.   In general, as you consider smaller blocks of data for deduplication, you increase your &amp;quot;fold factor&amp;quot;, that is, the difference between the logical storage provided vs. the physical storage needed.  At the same time, however, smaller blocks means more hash table overhead and more CPU time needed for deduplication and for reconstruction.&lt;br /&gt;
&lt;br /&gt;
The actual analysis and deduplication of incoming files can occur in-band or out-of-band.  In-band deduplication means that the file is analyzed as it arrives at the storage server, and written to disk in its already compressed state.  While this method requires the least over all storage capacity, resource constraints of the server may limit the speed at which new data can be ingested.   In particular, the server must have enough memory to store the entire deduplication hash table in memory for fast comparisons.  With out-of-band deduplication, inbound files are written to disk without any analysis (so, in the traditional way).  A background process analyzes these files at a later time to perform the compression.  This method means higher overall disk I/O is needed, which can be a problem if the disk (or disk array) is already at I/O capacity.&lt;br /&gt;
&lt;br /&gt;
In the case of ZFS, which is typically hosted as a server-side file system, the server itself performs all of the deduplication and reconstruction; the entire process is transparent to the client.  ZFS assumes that it is running on a highly multi-threaded operating system and that CPU cycles are in greater abundance than disk I/O cycles, and thus performs the deduplication in-band.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Legacy File Systems&#039;&#039;&#039; ==&lt;br /&gt;
Files exist on memory sources such as hard disks and flash memory, and when saving these files onto memory sources there must be an abstraction that organizes how these files will be stored and later retrieved. The abstraction that is used is a file system, and one such file system is FAT32, and another is ext2. These file systems were designed for users who had less and smaller storage devices than of today.The average worker/user would not have many files stored on their hard drive, and because of small amounts of data that might not be accessed as often as thought, the file systems did not worry too much about the procedures to repair data integrity(repairing the file system and relocating files). &lt;br /&gt;
====FAT32====&lt;br /&gt;
When files are stored onto storage devices, the storage device`s memory is made up of sectors (usually 512bytes) . Initially it was planned so that these sectors would contain the data of a file, and that some larger files would be stored as multiple sectors. In order for one to attempt to retrieve a file, each sector must have been stored and also documented on which sectors contained the data of the requested file. Since the size of each sector is relatively small in comparison to larger files that exist in the world, it would take significant amounts of time and memory to document each sector with the file it is associated with and where it is located. Because of the inconvenience of having so many sectors documented, the FAT file system has implemented clusters; which are a defined grouping of sectors. These clusters would serve as groupings of sectors and each cluster would be related to one file. An issue that has been discovered about using clusters is the event of storing a file that was smaller than a cluster, then the file would take up space in the cluster and no other file would be able to access the unused sectors in that cluster. For the FAT32 file system, the name FAT stands for File Allocation Table, which is the the table that contains entries of the clusters in the storage device and their properties. The FAT is designed as a linked list data structure which holds in each node a cluster’s information. “ For the FAT, the device directory contains the name, size of the file and the number of the first cluster allocated to that file. The entry in the table for that first cluster of that particular file contains the number of the second cluster in that file. This continues until the last cluster entry for that file which will contain all F’s indicating it is used and the last cluster of the file. The first file on a new device will use all sequential clusters. Hence the first cluster will point to the second, which will point to the third and so on.”#2.3a The digits specified beside each naming of a FAT system, as is in FAT32, means that the file allocation table is an array of 32-bit values. #2.3b Of the 32-bits, 28 of them are used to number the clusters in the storage device, therefore this means that 2^28 clusters are available. Issues that arise from having larger clusters is when files are drastically smaller than the cluster size, because then there is a lot of excess wasted space in the cluster. When clusters are being used to contain a file, when the file is accessed the file system must find all clusters that go together that make up the file, this process takes long if the clusters are not organized. When files are also deleted, the clusters are modified as well and leave empty clusters available for new data, because of this, some files may have their clusters scattered through the storage device and when accessing the file it would take longer to access. FAT32 does not include a defragmentation system, but all of the recent Windows OS’ come with a defragmentation tool for users to use. Defragging allows for the storage device to organize the fragments of a file (clusters) so that they reside near each other, which helps with the timing it takes to access a file from the file system. Since reorganization (defragging) is not a default function in the FAT32 system, when trying to store a file, looking for a empty space requires a linear search through all the clusters, this is one of the drawbacks to using FAT32, it is slow. The first cluster of every FAT32 file system contains information about the operating system, root directory, and always contains 2 copies of the file allocation table so that in the case of the file system being interrupted, a secondary FAT is available to be used to recover the files.&lt;br /&gt;
==== Ext2 ====&lt;br /&gt;
The ext2 file system (second extended file system) was designed after the UFS (Unix File System) and attempts to mimic certain functionalities of UFS yet remove unnecessary ones as well. Ext2 organizes the memory space into blocks, which are then seperated into block groups (similar to the cylinder groups in UFS) system. There is a superblock that is a block that contains basic information, such as the block size, the total number of blocks, the number of blocks per block group, and the number of reserved blocks before the first block group.The superblock also contains the total number of inodes and the number of inodes per block group.#2.3c Files in ext2 are represented by Inodes. Inodes are a structure that contain the description of the file, file type, access rights, owners, timestamps, size, and the pointers to the data blocks that hold the files data. In FAT32 the file allocation table was used to define the organization of how file fragments were, and it was vital to have duplicate copies of this FAT just in case of crashes. Just as it was in FAT32 with having duplicate copies of the FAT in the first cluster, the first block in ext2 is the superblock and it also contains the list of group descriptors (each group block has a group descriptor to map out where files are in the group) Backup copies of the superblock and group descriptors exist through the system in case the primary source gets affected. (each group has a group descriptor). These backup copies are used when the system had an unclean shutdown and requires the use of the “fsck” (file system checker) which traverses through the inodes and directories to repair any inconsistencies.#2.3d&lt;br /&gt;
==== Comparison ====&lt;br /&gt;
When observing how storage devices are managed using different file systems, one can notice that FAT32 file system has a max volume of 2TB(8TB -32KB clusters, 16TB -64KB clusters), 32TB for the ext2, and the ZFS contains 2^58 ZB(Zettabyte), where each ZB is 2^70 bytes(quite larger). “ZFS provides the ability to &#039;scrub&#039; all data within a pool while the system is live, finding and repairing any bad data in the process”#2.3e , because of this, the use a fsck is not used in ZFS, where as it is in the ext2 filesystem. Not having to check for inconsistencies allows for ZFS to save time and resources by not systematically going through a storage device. The FAT32 file system manages a storage device, and the ext2 file system also just manages a storage device, where as the ZFS utilizes a volume manager that can control multiple storage devices, virtual or physical. By being able to manage multiple storage devices under one file system means that resources are now available throughout the system, and that nothing is unavailable when accessing the data from the ZFS.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Current File Systems&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
====NTFS====&lt;br /&gt;
New Technology File Systems also known as NTFS was first introduced with Windows NT and is currently being used on all modern Microsoft operating systems. The NTFS file system creates volumes which are then broken down in to clusters much like the FAT32 file system. Volumes contain several components. A volume contains a NTFS Boot Sector, Master File Table, File System Data and a Master File Table Copy. The NTFS boot sector holds the information that communicates to the BIOS the layout of the volume and the file system structure. The Master File Table holds all the metadata in regards to all the files in the volume. The File System Data stores all data that is not included in the Master File Table. Finally the Master File Table Copy is a copy of the Master File Table.[1] Having the copy of the MFT ensures that if there is an error with the primary MTF the file system can still be recovered. The MFT keeps track of all file attributes in a relational database. The MFT is also part of this database. Every file that is in a volume has a record created for it in the MFT. NTFS is journal file system which means it utilizes a journal to ensure data integrity.  The file system enters changes into the journal before they are made in case there is an interruption while those changes are being written to disk.  A specific feature to NTFS is a change journal which records all changes that are made to the file system this assist’s in performance as the entire volume does not have to be scanned to find changes. [2] NTFS also allows for compression of files to save disk space unfortunately it can affect performance.  Performance is affected because in order to move compressed files they must first be decompressed then transferred and recompressed. NTFS does have certain volume and size constraints. [3] NTFS is a 64-bit file system which allows for 2^64 bytes of storage. NTFS is capped at a maximum file size of 16TB and a maximum volume size of 256TB.[1]&lt;br /&gt;
&lt;br /&gt;
====ext4====&lt;br /&gt;
Fourth Extended File System also known as ext4 is a Linux file system.   Ext4 also uses volumes like NTFS but does not use clusters.  It was designed to all for greater scalability then ext3.  Ext4 uses extents which is a descriptor representing contiguous physical blocks. [4] Extents represent the data that is stored in the volume.   They allow for better performance when handling large files when compared with ext3.  Ext4 file system is also a journaling file system.  It records changes to be made in a journal then makes the changes in case there is a chance of interruption while writing to the disk.  In order to ensure data integrity ext4 utilizes check summing.  In ext4 a checksum has been implemented in the journal do to the high importance of the data stored there. [4].  Ext4 does not support compression so there are no slowdowns when moving data as there is no compressing and decompressing.   Ext4 uses a 48-bit physical block rather than the 32-bit block used by ext3.  The 48-bit block increases the maximum volume size to 1EB up from the 16TB max of ext3.[4]&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
The most noticeable difference when comparing ZFS to other current file systems is the size.  NTFS allows for a maximum volume 256TB and ext4 allows for 1EB.  ZFS allow for a maximum file system of 16EB which is 16 times more than the current ext4 Linux file system.  After viewing the amount of storage available to the current file systems it is clear that ZFS is better suited to servers.  ZFS has the ability to self heal which neither of the two current file systems.  This improves performance as there is no need for down time to scan the disk to check for errors.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Future File Systems&#039;&#039;&#039; ==&lt;br /&gt;
====BTRFS====&lt;br /&gt;
&lt;br /&gt;
--posted by [Naseido] -- just starting a rough draft for an intro to B-trees&lt;br /&gt;
--source: http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf ( found through Google Scholar)&lt;br /&gt;
&lt;br /&gt;
BTRFS, B-tree File System, is a file system that is often compared to ZFS because it has very similar functionality even though a lot of  the implementation is different. BTRFS is based on the b-tree structure where a subvolume is a named b-tree made up of the files and directories stored.&lt;br /&gt;
&lt;br /&gt;
====WinFS====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Mandagere, N., Zhou, P., Smith, M. A., and Uttamchandani, S. 2008. [http://portal.acm.org.proxy.library.carleton.ca/citation.cfm?id=1462739 Demystifying data deduplication]. In Proceedings of the ACM/IFIP/USENIX Middleware &#039;08 Conference Companion  (Leuven, Belgium, December 01 - 05, 2008). Companion &#039;08. ACM, New York, NY, 12-17.&lt;br /&gt;
&lt;br /&gt;
* Geer, D.; , [http://ieeexplore.ieee.org.proxy.library.carleton.ca/xpls/abs_all.jsp?arnumber=4712493 &amp;quot;Reducing the Storage Burden via Data Deduplication,&amp;quot;] Computer , vol.41, no.12, pp.15-17, Dec. 2008&lt;br /&gt;
&lt;br /&gt;
* Bonwick, J.; [http://blogs.sun.com/bonwick/en_US/entry/zfs_dedup ZFS Deduplication]. Jeff Bonwick&#039;s Blog. November 2, 2009.&lt;br /&gt;
&lt;br /&gt;
* Andrew Li, Department of Computing Macquarie University, Zettabyte File System Autopsy: Digital Crime Scene Investigation for Zettabyte File System [Z3]&lt;br /&gt;
&lt;br /&gt;
* Zhang, Yupu and Rajimwale, Abhishek and Arpaci-Dusseau, Andrea C. and Arpaci-Dusseau, Remzi H.; [http://www.usenix.org/events/fast10/tech/full_papers/zhang.pdf End-to-end Data Integrity for File Systems: A ZFS Case Study]. FAST&#039;10: Proceedings of the 8th USENIX conference on File and storage technologies. USENIX Association, Berkley, CA, USA.&lt;br /&gt;
&lt;br /&gt;
*2.3a - S.Tenanbaum, A. (2008). Modern operating systems. Prentice Hall. Sec: 1.3.3&lt;br /&gt;
&lt;br /&gt;
*2.3b - Dr.William F. Heybruck.(August 2003). An Introduction to FAT 16/FAT 32 File Systems. [http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf].&lt;br /&gt;
&lt;br /&gt;
*2.3c - Raymond Chen. Windows Confidential -A Brief and Incomplete History of FAT32.(2008)  [http://technet.microsoft.com/en-ca/magazine/2006.07.windowsconfidential.aspx]. &lt;br /&gt;
&lt;br /&gt;
*2.3d - Carrier, B. (2005). File system forensic analysis. Addison-Wesley Professional. P.287 [http://proquest.safaribooksonline.com.proxy.library.carleton.ca/0321268172/ch14#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTAzMjEyNjgxNzIvMjg5].&lt;br /&gt;
&lt;br /&gt;
*2.3e - Brokken, F, &amp;amp; Kubat, K. (1995). Proceedings to the first dutch international symposium on linux, amsterdam, december 8th and 9th, 1994. [http://e2fsprogs.sourceforge.net/ext2intro.html]. &lt;br /&gt;
&lt;br /&gt;
*2.3f - ZFS FAQ - opensolaris [http://hub.opensolaris.org/bin/view/Community+Group+zfs/faq#whatstandfor].&lt;br /&gt;
&lt;br /&gt;
*Jeff Bonwick, Matt Ahrens, Val Henson, Mark Maybee, Mark Shellenbaum. Sun Micro Systems, The Zettabyte File System [Z1]&lt;br /&gt;
&lt;br /&gt;
*Romik Guha Anjoy, Soumya Kanti Chakraborty, Malardalen University, Sweden. Feature Based Comparison of Modern File Systems [Z2]&lt;br /&gt;
&lt;br /&gt;
*[1] http://technet.microsoft.com/en-us/library/cc781134%28WS.10%29.aspx&lt;br /&gt;
&lt;br /&gt;
*[2] http://technet.microsoft.com/en-us/library/cc938919.aspx&lt;br /&gt;
&lt;br /&gt;
*[3] http://support.microsoft.com/kb/251186&lt;br /&gt;
&lt;br /&gt;
*[4] http://www.kernel.org/doc/ols/2007/ols2007v2-pages-21-34.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4312</id>
		<title>Talk:COMP 3000 Essay 1 2010 Question 9</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Talk:COMP_3000_Essay_1_2010_Question_9&amp;diff=4312"/>
		<updated>2010-10-15T01:38:47Z</updated>

		<summary type="html">&lt;p&gt;Tafatah: /* Who is doing what */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Contacts / If interested ==&lt;br /&gt;
Tawfic : tfatah@gmail.com&lt;br /&gt;
&lt;br /&gt;
Andy Zemancik: andy.zemancik@gmail.com&lt;br /&gt;
&lt;br /&gt;
Lester Mundt: lmundt@gmail.com&lt;br /&gt;
&lt;br /&gt;
Matthew Chou : mateh.cc@gmail.com (this is mchou2)&lt;br /&gt;
&lt;br /&gt;
Nisrin Abou-Seido: naseido@connect.carleton.ca&lt;br /&gt;
&lt;br /&gt;
== Suggested References Format ==&lt;br /&gt;
Author, publisher/university, Name of the article&lt;br /&gt;
&lt;br /&gt;
== Who is doing what ==&lt;br /&gt;
Suggestion: In order to avoid duplication. Please state what section/item you&#039;re currently working on.&lt;br /&gt;
&lt;br /&gt;
Tawfic : Currently working on Section One ZFS.&lt;br /&gt;
&lt;br /&gt;
Azemanci: Currently working on Section Three Current File Systems.&lt;br /&gt;
&lt;br /&gt;
Nisrin (naseido): Working on intro, conclusion and editing&lt;br /&gt;
&lt;br /&gt;
KEY ISSUE: We need a thesis statement. Please suggest ideas.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 01:38, 15 October 2010 (UTC) I think the thesis statement is implied in the current intro, i.e. &amp;quot;.. of avoiding some of the major problems associated&lt;br /&gt;
with traditional file systems . . &amp;quot; suggests that it&#039;s unacceptable anymore to tolerate problems in today&#039;s IT environment. If&lt;br /&gt;
you&#039;d like to expand on it, you could mention the continuous need for flexibility vis-a-vis using data. Example: there&#039;s a growing&lt;br /&gt;
trend with cloud computing (the marketable name for distributed computing). Users who will opt for that option will have to trust&lt;br /&gt;
the host companies with their data. It won&#039;t be acceptable to them to be told that a file here or a directory there was lost. The&lt;br /&gt;
issue with the growth of smart phones and yet to proliferate tablets also increases the demands for flexibility ( need to be able&lt;br /&gt;
to add/shrink/manage storage on the fly and avoid manual intervention when problems arise) . . etc. Hope that helps.&lt;br /&gt;
&lt;br /&gt;
The conclusion would have to assert the main points regarding ZFS, i.e. it&#039;s modularization and administrative simplicity, it&#039;s&lt;br /&gt;
virtualization of storage via the use of SPA and DMU, and it&#039;s self healing abilities. I am currently working on the section&lt;br /&gt;
that talks ( briefly ) about ZFS&#039;s self-healing ( for lack of better words ). So I&#039;ll be online for sometime. The info on SPA&lt;br /&gt;
amd DMU is already there. If it&#039;s not clear enough, please let me know&lt;br /&gt;
&lt;br /&gt;
== Deadline ==&lt;br /&gt;
Suggestion: Adding content should stop on Thursday, October 14&#039;th at 3:00 PM. Any work after that&lt;br /&gt;
should go into formatting, spelling, and grammar checking.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:00, 14 October 2010 (UTC)&lt;br /&gt;
- I will definitely be adding content after this time probably late, late into the evening.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:25, 14 October 2010 (UTC) No problem. Forget about the suggested deadline. I thought we&#039;d have to be done by 11:00Pm.&lt;br /&gt;
I am still adding stuff myself. I think Anil will lock the Wiki around 7:00 Am or so. So anytime&lt;br /&gt;
before that is Ok.&lt;br /&gt;
&lt;br /&gt;
== Essay Format Take 2 ==&lt;br /&gt;
Hello. I am suggesting the following format instead. If you agree, I&#039;ll take care of merging the existing info into this new format. My feeling is that this format is&lt;br /&gt;
more flexible and will (hopefully) allow individuals to take a section or a sub-section and work on it.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Abstract&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: Main point. Current File Systems are neither versatile enough nor intelligent to handle the rapidly&lt;br /&gt;
 growing needs of dynamic storage.&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the WHYS as to the need for versatile storage (e.g. cloud computing, mobile environments, shifting consumer&lt;br /&gt;
 demand . . etc )&lt;br /&gt;
&lt;br /&gt;
 TO-DO: few statements regarding the need for intelligence (just statements, the body will take care of expanding on these ). E.g. more&lt;br /&gt;
 intelligent FS’s can include Metadata to help crime investigators, smart FS’s could be self healing . . .etc.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Limitations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Zettabyte File System&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Characteristics&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Dissected&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: List the seven components of ZFS and basically what makes a ZFS&lt;br /&gt;
 E.g. interface, various parts, and external needed libraries . . etc.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Features Beyond Traditional File Systems&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Possible Real-Life Scenarios / Examples&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: 2-3 examples where ZFS was/could/is being considered for use.&lt;br /&gt;
&lt;br /&gt;
 TO-DO : One to two paragraphs stressing / reiterating the main points made in the abstract&lt;br /&gt;
         thesis statement).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Alternatives to ZFS&#039;&#039;&#039;&lt;br /&gt;
 one example is good enough.&lt;br /&gt;
 TO-DO: a brief description of the alternative.&lt;br /&gt;
 Main argument for it’s viability.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;Pros/Cons&#039;&#039;&#039;&lt;br /&gt;
 TO-DO: just a list of pluses and minuses&lt;br /&gt;
&lt;br /&gt;
 TO-DO : two to three paragraphs summarizing (this is the conclusion) the main points outlined in the abstract and the body, restating why traditional&lt;br /&gt;
 FS’s are no longer viable, and  stressing once more that ZFS is a valid alternative.&lt;br /&gt;
&lt;br /&gt;
== Essay Format ==&lt;br /&gt;
&lt;br /&gt;
I started working on the main page.  The bullets are to be expanded. Other group are are working in their respective discussion pages but I think it&#039;s all right to put our work in progress on the front page.  Thoughts?--[[User:Lmundt|Lmundt]] 16:14, 6 October 2010 (UTC)&lt;br /&gt;
* [[User:Gbint|Gbint]] 02:03, 7 October 2010 (UTC) Lmundt;  what do you think of listing the capacities of the file system under major features?  I was thinking that we could overview the features in brief, then delve into each one individually.&lt;br /&gt;
* --[[User:Lmundt|Lmundt]] 14:31, 7 October 2010 (UTC) I was thinking about the major structure... I like what your suggesting in one section. So here is the structure I am thinking of.&lt;br /&gt;
&lt;br /&gt;
* Intro &lt;br /&gt;
* Section One ZFS&lt;br /&gt;
** Major feature 1&lt;br /&gt;
** Major feature 2&lt;br /&gt;
** Major feature 3 &lt;br /&gt;
* Section Two Legacy File Systems&lt;br /&gt;
** Legacy File System1( FAT32 ) - what it does&lt;br /&gt;
** Legacy File System2( ext2 ) - what it does&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Three Current File Systems&lt;br /&gt;
** NTFS?&lt;br /&gt;
** ext4?&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Section Four future file Systems&lt;br /&gt;
** BTRFS&lt;br /&gt;
** WinFS or ??&lt;br /&gt;
** Contrast them with ZFS&lt;br /&gt;
* Conclusion&lt;br /&gt;
&lt;br /&gt;
What does everyone think of this format?   While everyone should contribute to section one we could divvy up the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 16:29, 9 October 2010 (UTC) The layout looks good; I filled out the data dedup section. I think it has reasonable coverage while staying away from becoming it&#039;s own essay just on deduplication.&lt;br /&gt;
&lt;br /&gt;
The legacy file systems are really not even in the same world as ZFS, so I think the contrasting section should cover a lot of how storage needs have changed.&lt;br /&gt;
&lt;br /&gt;
The current file systems are capable of being expanded into large pools of storage with good redundancy and even advanced features like data deduplication, but they are only a component in a chain of tools (like ext4 + lvm + mdraid + opendedup) rather than an full end-to-end solution.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 23:35, 9 October 2010 (UTC)  The section on deduplication looks good I agree it looks like the right amount of coverage for a portion of a single section.  Your also right about the old file systems not being able to hold a candle to ZFS and the conclusion section should talk about how storage needs and computers changed.  And intro to that section could set the stage for that period as well.  Non-multi-threaded, single processor system with much smaller RAM, even the applications were radically different the Internet was just single webpages without the high performance needs of web commerce and online banking for example.  I have another assignment so won&#039;t be contributing too much until Monday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 23:54, 10 October 2010 (UTC)&lt;br /&gt;
Please take a look at suggested essay format #2 and let me know soon. Time is running out Gents and Ladies :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 15:35, 11 October 2010 (UTC)&lt;br /&gt;
I think I prefer the outline I proposed only because it&#039;s a very regimented contrast/compare essay format and should get us any marks for format.  Most proper essays don&#039;t usually have a dedicated pros cons list.  Heading more towards a report format I think.  It&#039;s really what everyone agrees on.  I won&#039;t be touching the essay until tomorrow though.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 17:32, 11 October 2010 (UTC)&lt;br /&gt;
I like Lmundt&#039;s outline.  How would you like to divide up the work?  Also can everyone post the contact information so we know exactly who is in our group.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:03, 11 October 2010 (UTC)&lt;br /&gt;
No problem, I&#039;ll go with the current format. One issue to keep in mind is that this is an essay, not a report. I.E. the intro/thesis has to include&lt;br /&gt;
a reasonable suggestion towards using ZFS as a reliable FS. The body and the conclusion would have to assert that. The current format satisfies that&lt;br /&gt;
if we keep these points in mind. I started looking into the &amp;quot;dissect subsection&amp;quot; in the format I suggested, which is related to the ZFS features&lt;br /&gt;
section one in the current format. I&#039;ll continue to look into that part (above section, who is doing what will be updated accordingly), i.e. I&#039;ll&lt;br /&gt;
take care of section one since I&#039;ve already done some work on it. I suggest that each member of the group picks two items from one of the other&lt;br /&gt;
sections, except the contrasting part. Content in section one can then be used to finalize the comparisons in each of sections 2-4. The Intro/Abstract&lt;br /&gt;
and conclusion sections can be left to the end, and can be done collaboratively. I.E. once we have a very clear picture of all the&lt;br /&gt;
different pieces.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:18, 12 October 2010 (UTC)&lt;br /&gt;
I will begin working on section three current File Systems unless someone else has already begun working on it.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 20:29, 12 October 2010 (UTC)&lt;br /&gt;
I am going to start researching for section 2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 03:15, 13 October 2010 (UTC)  Alright so all the sections are being taken care of so we should be good to go for Thursday.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:35, 13 October 2010 (UTC) &#039;&#039;&#039;No one is assigned to section four&#039;&#039;&#039; ? Also, for those who haven&#039;t picked any section or subsection, please help out with the sections you&#039;re&lt;br /&gt;
more familiar with.&lt;br /&gt;
&lt;br /&gt;
Finally, if you were in class today (well, technically yesterday), then you&#039;ve heard Anil talk about plagiarism. I know this is common knowledge, so forgive&lt;br /&gt;
the annoying reminder. Please never copy and paste, and make sure to cite your info. As Anil mentioned, if anyone plagiarises, we are ALL responsible. It is&lt;br /&gt;
simply impossible for the rest of the group to check whether every member&#039;s sentence is genuine or not. So use your own words/phrases ( doesn&#039;t&lt;br /&gt;
have to be fancy or sophisticated ). If you&#039;re not sure, please check with the rest of the group.&lt;br /&gt;
&lt;br /&gt;
Good luck, and good night.&lt;br /&gt;
--Tawfic&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 14:55, 13 October 2010 (UTC)  My bad I misread something I thought you were doing current file systems section 3.  I&#039;ll take section 3 but then someone needs to do section 4.  There are 4 of us so this should not be a problem.&lt;br /&gt;
&lt;br /&gt;
--[[User:Naseido|Naseido]] 13 October 2010  Sorry I haven&#039;t contributed till now. The outline looks great and I think we can spend most of the day tomorrow editing to make sure all the sections fit together like an essay. I&#039;ll be doing section 4.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 16:11, 13 October 2010 (UTC) Hi. In section 4 the most important one is BTRFS. More info on that and less info on the others is Ok.&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:00, 14 October 2010 (UTC)&lt;br /&gt;
I have done what I can for the legacy file systems, if someone who doesn&#039;t have any particular job wouldn&#039;t mind going over it and correcting any errors they see. I am also not familiar with how to edit/format these wiki pages so I tried my best and if you want to change the layout then please do, I would assume after we complete our sections and collaborate them into 1 essay that the formatting will change. I simply put headings on each section just so it is easier to read.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 04:55, 14 October 2010 (UTC) A reference for wiki editing http://meta.wikimedia.org/wiki/Help:Editing&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:42, 14 October 2010 (UTC)  I&#039;m not going to have my info posted by 3:00.  Also how and where are we supposed to cite our sources?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tafatah|Tafatah]] 19:28, 14 October 2010 (UTC) No worries. You have till 7:00 Am ( or till Anil locks the Wiki down, though I wouldn&#039;t count on more than 7) Friday, Oct 15. For citing, I am using&lt;br /&gt;
this convention. Bla.....Bla [Z1. P3] means I am using info from page 3 of article labeled as Z1 in references section.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lmundt|Lmundt]] 20:48, 14 October 2010 (UTC) Citation reference looks good.  I think in each section we should talk about the motivation behind the design. A small into for each section.  For example in the legacy area fat32 and ext, we could talk about computing becoming commonplace for the average worker so most development was for single users with a relatively small hardrive, not too many files.  It will in-turn lead to justify/explanation for the design decission for each vintage of OS. &lt;br /&gt;
The main intro should about the motivations behind the design.  Intended for servers with a focus or expandability, reliability and self maintenance.  This is the motivation behind all those cool features we are detailing.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
Not from your group. Found a file which goes to the heart of your problem&lt;br /&gt;
[http://www.oracle.com/technetwork/server-storage/solaris/overview/zfs-14990&lt;br /&gt;
2.pdf ZFSDatasheet]&lt;br /&gt;
[[User:Gautam|Gautam]] 22:50, 5 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Thanks will take a look at that.--[[User:Lmundt|Lmundt]] 16:12, 6 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Gbint|Gbint]] 01:45, 7 October 2010 (UTC) paper from Sun engineers explaining why they came to build ZFS, the problems they wanted to solve:  &lt;br /&gt;
* PDF:  http://www.timwort.org/classp/200_HTML/docs/zfs_wp.pdf&lt;br /&gt;
* HTML: http://74.125.155.132/scholar?q=cache:6Ex3KbFo4lYJ:scholar.google.com/+zettabyte+file+system&amp;amp;hl=en&amp;amp;as_sdt=2000&lt;br /&gt;
&lt;br /&gt;
Excellent article.[[User:Lmundt|Lmundt]] 14:24, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Not too exciting but it looks like an easy read http://arstechnica.com/hardware/news/2008/03/past-present-future-file-systems.ars [[User:Lmundt|Lmundt]] 14:40, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
the [http://en.wikipedia.org/wiki/Comparison_of_file_systems wikipedia comparison] has some good tables, and if you click the various categories you can learn quite a bit about the various important features //not your group. [[User:Rift|Rift]] 18:56, 7 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Hey, I&#039;m not from your group but I found this slideshow that was really handy in the assignment! http://www.slideshare.net/Clogeny/zfs-the-last-word-in-filesystems - nshires&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hey there. I&#039;m not a member of your group. But you guys might want to look at this Wiki-page from the SolarisInternals website. I used it today for our assignment, a lot of interesting and in-depth breakdown of the ZFS file system: http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#ZFS_Performance_Considerations&lt;br /&gt;
&lt;br /&gt;
-- Munther&lt;br /&gt;
&lt;br /&gt;
--[[User:Mchou2|Mchou2]] 03:56, 13 October 2010 (UTC) Good intro to understanding FAT FS&lt;br /&gt;
http://www-ssdp.dee.fct.unl.pt/leec/micro/20042005/teorica/Introduction_to_FAT.pdf&lt;br /&gt;
&lt;br /&gt;
--[[User:Azemanci|Azemanci]] 18:49, 14 October 2010 (UTC)&lt;br /&gt;
Abit late but I found a comparison of current file systems including ZFS:&lt;br /&gt;
http://www.idt.mdh.se/kurser/ct3340/ht09/ADMINISTRATION/IRCSE09-submissions/ircse09_submission_16.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.dhtusa.com/media/IOPerf_CMG09DHT.pdf&lt;/div&gt;</summary>
		<author><name>Tafatah</name></author>
	</entry>
</feed>