Block in the file system's block database and a summary of the page basics in memory (it may be wrong to understand)

Source: Internet
Author: User

1. Block in the operating system file system

The block in the filesystem is the smallest read-write unit in the file system, and in the disk age of HDD, the size of the block may match the disk's sector size by 512bytes.

Also because of this reason the MBR starts the hand 0 track 0 sector 512bytes first loaded into memory, first contains the MBR boot information of 446byte, and also contains 64bytes of disk partition information so the MBR disk format only supports 4 primary partitions and the size can only be extended to 2TB

Later, using GPT partitioning mode, you can expand the use of disks larger than 2TB.

The operating system's file cluster size can also be an integer multiple of the sector size or sector size

More common SSDs are typically 4kB sector size so there is a 4k alignment problem with an SSD operating system disk (Win7 MBR case)

The block of a single file system can only be assigned to one file and cannot be held by two files at the same time, so if the file block is large, it can cause a lot of wasted disk space.

However, if the file system block is too small, it will affect the performance of certain IO.

2. Block in the database

Oracle and SQL Server have different names for read-write units for the smallest database

Oracle and the operating system generally write the smallest read-write unit as block SQL Server called page

Their size is associated with the operating system an integer multiple of the block of the operating system file system generally

For example, the general Windows System file cluster is 4kB, Oracle and SQL Server's basic block size is 8kB

SQL Server page has page head and industry offsets and other information content, a single page is 8192bytes generally can be used to save the data part is 8060byte the rest of the bytes used to store the head and offset

Oracle's block can be specified when the DBCA database is created, and the version of the operating system that is more than 11g in number is generally the default is 8kB can be adjusted to a larger situation

A single IO of the database crawls the contents of a block into the SGA area (direct path read should be read into the PGA area)

Oracle database Multiple Blocks compose extent region Oracle should allocate storage area to schema with extent as the smallest logical allocation unit

Extent added the feature of delayed short creation at the beginning of the 11g, and the creation of the extent segment is not done when no insert data is created.

Extent when it was first created, it seemed to contain only 8 blocks, or 64kB size.

When scaling to a certain extent to reach 16 extent, which is 1MB size, it is possible to assign a 1MB zone to the user each time.

Oracle To improve extent performance this piece has done a lot of optimization processing

Oracle's only block-level and release-level locks seem to be capable of simultaneously processing block records within a extent region to improve concurrency response performance.

3. Memory page.

The modern operating system deals with virtual memory, which is mapped to virtual memory and physical memory by the hardware underlying or by other means.

x86 's operating system without large pages enabled the size of a single memory page for many of the now-used versions of Windows or Linux is 4KB in size.

In order to speed up memory access, CPU access memory is typically done through a multi-level cache,

This can have a microscopic understanding of:

The speed of light is 300,000-kilometer hours. Within a cycle of a 3GHZ CPU the light can walk 10cm feel here may limit the CPU to achieve a particularly large area.

The CPU access register should be within a 1cycle to resolve, the time is within 0.5ns

CPU access memory latency is higher, may reach more than 10 cycle overall time may be about 12ns

CPU completion acquiring memory address and fetching from memory may take more than 100ns

Taking a number from a hard drive plus a disk seek and data acquisition takes about 10ms or more, when you see that the memory is 100,000 times times faster than the hard drive but 100-200 times slower than the CPU register.

CPU in order to speed up the memory addressing portion of the internal access number as far as possible not through memory acquisition, but through the register or a level 123 cache to achieve

The name of the register is the TLB TLB inside should be stored a 64-bit address long part because a memory page is 4KB so need to have 12 within the page offset to a bit to identify the contents of a bytes in addition to the 12-bit offset part to identify the location of the page

Now it should be a page-type memory management, but the operating system of the course did not learn, this section of the content is not thoroughly understood.

Because the overall size of the TLB is limited, the conversion of the virtual address to the physical address in the TLB always occurs with the TLB miss so you can add page entry to reduce page table items I understand that to increase the size of the in-page offsets in the address to decrease the number of pages in memory, Guaranteed TLB hits hit rate for improved performance

The processing of large pages in Linux should be considered as supporting large pages/proc/meminfo The fields containing hugepage in the information.

I have never understood the memory management of windows as a part of the page type (in fact, in-depth content does not understand ...!) -_-!).

An IO operation may involve a very great number of points. The above is just your own simple understanding is very not comprehensive.

Block in the file system's block database and a summary of the page basics in memory (it may be wrong to understand)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.