0% found this document useful (0 votes)
21 views11 pages

Maximum File Size in UNIX Systems

In a 32-bit UNIX System V, the maximum file size with 12 direct pointers and a block size of 4 KB is approximately 4 TB, while with a block size of 1 KB, it is 16 GB. The document also discusses virtual memory systems, detailing virtual address ranges that cause page faults and the physical addresses for specific virtual addresses. Additionally, it examines execution patterns for processes under different scheduling policies and the impact of memory allocation on page fault intervals.

Uploaded by

lehoangvi.work
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views11 pages

Maximum File Size in UNIX Systems

In a 32-bit UNIX System V, the maximum file size with 12 direct pointers and a block size of 4 KB is approximately 4 TB, while with a block size of 1 KB, it is 16 GB. The document also discusses virtual memory systems, detailing virtual address ranges that cause page faults and the physical addresses for specific virtual addresses. Additionally, it examines execution patterns for processes under different scheduling policies and the impact of memory allocation on page fault intervals.

Uploaded by

lehoangvi.work
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. In 32-bit UNIX system V, the length of a block is 4 Kbyte.

Using the inode


scheme, what is the maximum size of a file?
(Supposing 12 direct pointers)

In a 32-bit UNIX System V, the maximum size of a file can be calculated based on the
inode structure and the block size. Let's break this down step by step.

An inode in UNIX System V typically contains:

● Direct pointers
● Single indirect pointer
● Double indirect pointer
● Triple indirect pointer

Given that each block is 4 KB (4096 bytes) and each pointer is 4 bytes (since it's a 32-bit
system), we can calculate the maximum file size as follows:

Maximum size from double indirect block=1024×1024×4096=4294967296 bytes=4 GB

Maximum size from triple indirect block=1024×1024×1024×4096=4398046511104 bytes=4


TB
So, the maximum file size in a 32-bit UNIX System V with a block size of 4 KB and the
described inode structure is approximately 4 TB.

2. In UNIX System V, the length of a block is 1 Kbyte, and each block can hold a
total of 256 block addresses. Using the inode schema, what is the maximum
size of a file?
(If not tell anything -> 13 direct pointers)
Maximum size from double indirect block=256×256×1024=67108864 bytes=64 MB

Maximum size from triple indirect block=256×256×256×1024=17179869184 bytes=16 GB


3. A virtual memory system has a page size of 1024 bytes, eight virtual pages
and four physical page frames. The table is as follows:

Virtual Page Page Frame

0 3

1 1

2 not in memory

4 2

5 not in memory

6 0

7 not in memory

using hexadecimal arithmetic (1024 = $0400)


1. Make a list of the virtual address ranges that will cause page faults

Page 0: 0x0000 -> (plus by 3FF) 0x03FF (move to another page then plus
1)
Page 1: 0x0400 -> 0x07FF
Page 2: 0x0800 -> 0x0BFF
Page 3: 0x0C00 -> 0x0FFF
Page 4: 0x1000 -> 0x13FF
Page 5: 0x1400 -> 0x17FF
Page 6: 0x1800 -> 0x1BFF
Page 7: 0x1C00 -> 0x1FFF

2. What are the physical addresses for $0000, $03FF, $0E90, $0400,
$0401, $06B5, $1E78 and $10FA
4. Consider the following set of processes and show the execution pattern for
the following policies: Shortest process next (SPN), Shortest remaining time
(SRT). If there is a tie on criteria, FCFS will be applied:

Process Name Arrival Time Service Time

A 0 3

B 2 5

C 4 5

D 5 3
5. It has been observed that the number of instructions executed between page
faults is directly proportional to the number of page frames allocated to a
program. If the available memory is doubled, the mean interval between page
faults is also doubled. Suppose that a normal instruction takes 1
microsecond, but if a page fault occurs, it takes 2000 microseconds. If a
program takes 60s to run, during which time it gets 15,000 page faults, how
long would it take to run if twice as much memory were available?
(1000000 instructions per second)
(Total time for new pa… = Total time for new page faults)

Common questions

Powered by AI

In the virtual memory system described, with a page size of 1024 bytes, virtual pages 2, 5, and 7 are not in memory. Therefore, accessing any virtual address within the ranges 0x0800-0x0BFF (Page 2), 0x1400-0x17FF (Page 5), and 0x1C00-0x1FFF (Page 7) will cause page faults because the respective pages are not present in the physical memory .

If memory is doubled, the interval between page faults also doubles, reducing the number of page faults. Initially, with 15,000 page faults and a time of 60s, the time taken includes 15,000 page faults taking 2000 microseconds each. With doubled memory, the program should effectively experience half the number of page faults, thus reducing the total runtime . The adjusted runtime would decrease by the time saved from reduced page faults.

Page fault frequency tends to decrease as the number of allocated page frames increases because more of the working set can be held in memory, reducing the likelihood that necessary pages are swapped out. When the number of frames is insufficient to hold the working set, page faults occur frequently, degrading performance. Conversely, with more frames, the system can minimize page replacements, thereby extending the mean interval between page faults and improving execution efficiency .

A combination of different types of pointers in an inode structure efficiently balances the need for accessing small files quickly (using direct pointers) and supporting very large files (using indirect pointers). Direct pointers provide fast access since they point directly to data blocks; single indirect pointers extend file size modestly; double and triple indirect pointers significantly expand possible file sizes by forming multi-level indexes, accommodating large files without requiring enormous, contiguously allocated directories .

The page size directly affects the granularity of memory management, influencing how frequently page faults occur. Larger page sizes may reduce page faults due to fewer pages overall, thus decreasing overhead. However, it may increase internal fragmentation and memory waste if individual allocations are much smaller than the page size. Conversely, smaller pages reduce waste but may increase paging overhead and frequency of page faults as more pages need to be managed for the same memory footprint .

Increasing block size can enhance file access speed by reducing the number of required read operations for large files, thereby improving sequential access efficiency. However, it can also lead to waste due to internal fragmentation, as small files may occupy full blocks despite using only a fraction of each block. This trade-off affects storage efficiency negatively when dealing with numerous small files, inflating the amount of unused space and effectively reducing the system's overall storage capacity .

FIFO may lead to suboptimal replacement decisions when older pages that are still actively used are evicted, potentially causing frequent page faults and increased execution time (Belady's anomaly). LRU, in contrast, replaces the least recently used page which often aligns better with actual usage patterns, minimizing page faults and improving execution times in typical scenarios. However, LRU may require more tracking and overhead than FIFO. The specific impact on execution time depends on program access patterns and memory constraints .

Using the page frame mapping provided: Virtual address $0000 maps to physical frame 3, which is physical address $0C00; $03FF is within Page 0 and maps to physical $0FFF; $0E90 (Page 3, not in memory) causes a page fault; $0400 is within Page 1, thus $0400 + offset 0 = physical $0400; $0401 similarly maps to $0401 in physical memory; $06B5 (Page 1) = $06B5; $1E78 (Page 7) causes a page fault; $10FA (Page 4) = $10FA physical as Page 4 maps to frame 2 .

In a 32-bit UNIX System V with a block size of 4KB, the inode structure includes direct, single indirect, double indirect, and triple indirect pointers. The maximum file size can be calculated using these pointers. The maximum size from a double indirect block is 4 GB, and from a triple indirect block, it is 4 TB. Therefore, the maximum file size is approximately 4 TB .

SPN selects the process with the shortest service time that is ready to execute next while SRT selects the process that will finish the soonest. For processes A (3), B (5), C (5), and D (3), SPN might execute A, D, B, C once all processes are available. SRT, however, could start with A, then switch among processes based on remaining time whenever new processes become ready, minimizing the total waiting time differently by potentially pre-empting tasks depending on their remaining time .

You might also like