JP2001022640A - Memory managing method - Google Patents

Memory managing method

Info

Publication number
JP2001022640A
JP2001022640A JP11189373A JP18937399A JP2001022640A JP 2001022640 A JP2001022640 A JP 2001022640A JP 11189373 A JP11189373 A JP 11189373A JP 18937399 A JP18937399 A JP 18937399A JP 2001022640 A JP2001022640 A JP 2001022640A
Authority
JP
Japan
Prior art keywords
memory
segment
management
area
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11189373A
Other languages
Japanese (ja)
Inventor
Shigeto Kawabata
成人 河端
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP11189373A priority Critical patent/JP2001022640A/en
Publication of JP2001022640A publication Critical patent/JP2001022640A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve the transfer efficiency of input/output data by providing memory management by a segment system in addition to memory management by a paging system. SOLUTION: A memory managing device 3 has a page managing device 3a which performs the memory management by the paging system and a segment managing device 3b which performs memory management by the segment system. In this computer system, the memory area of a main storage device 5 is divided into a program data area and a segment I/O area according to several high-order bits of a memory address of a user program and in the program data area, multiple page memories are demarcated on the main storage device 5 by using a page management table consisting of program page directories to form a paging management memory. In the segment I/0 area, on the other hand, multiple segment memories of arbitrary size are sectioned on the main storage device 5 by using a segment management table to form a segment management memory.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、仮想記憶方式によ
るマルチタスクを実現するオペレーティングシステムを
備えたコンピュータシステムにおけるメモリ管理方法に
関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a memory management method in a computer system having an operating system for realizing multitasking by a virtual memory system.

【0002】[0002]

【従来の技術】従来、仮想記憶方式によるマルチタスク
を実現するオペレーティングシステムにおいてよく使用
される方法として、ページング方式によるメモリ管理が
ある。これは、オペレーティングシステムがメモリをペ
ージと呼ばれる小さい単位に分けて管理し、メモリ管理
装置を用いてプログラム上のリニアなアドレスをページ
管理テーブルに従って実際の物理メモリに変換すること
によりプログラムの実行やメモリの確保を行うものであ
る。
2. Description of the Related Art Conventionally, as a method often used in an operating system for realizing multitasking by a virtual memory system, there is a memory management by a paging system. This is because the operating system manages the memory by dividing it into small units called pages, and uses a memory management device to convert linear addresses on the program into actual physical memory according to the page management table. It is to secure.

【0003】なお、この場合のページサイズは、通常シ
ステム全体、または1つのプロセスで唯一のユニークな
ものであり、例えば4〜8kbyte であることが多い。す
なわち、プログラム上ではリニアなアドレスでも、実際
に用いられる物理メモリはページサイズ単位に分割され
た不連続なメモリとなる。これらのメモリ管理方式で
は、基本的に一度の入出力単位はページサイズに制限さ
れる。
[0003] The page size in this case is usually unique only in the entire system or in one process, and is, for example, often 4 to 8 kbytes. In other words, even if the address is linear in the program, the physical memory actually used is a discontinuous memory divided into page size units. In these memory management methods, the unit of input / output once is basically limited to the page size.

【0004】一方、近年では動画像や音声などの連続し
たストリームデータをコンピュータ上で扱う要求が増大
し、これらの入出力は一度に大量のDMA(Direct Mem
oryAccess)転送を必要とする場合が多い。
On the other hand, in recent years, there has been an increasing demand for a computer to handle continuous stream data such as moving images and voices, and these inputs and outputs have a large amount of DMA (Direct Memory Card) at once.
oryAccess) often requires transfer.

【0005】ページング方式による仮想記憶方式を実現
するオペレーティングシステムでは、このような一度の
大量のDMA転送の要求に対処するために、オペレーテ
ィングシステムの立ち上げときに、入出力を担当するデ
バイスドライバ内で静的に連続したバッファを確保し、
このバッファ内に一時的に転送した後、ユーザプログラ
ムエリアにコピーする方法が従来は採用されていた。
In an operating system that implements a virtual memory system based on a paging system, in order to cope with such a once large-scale DMA transfer request, a device driver responsible for input / output is required when the operating system is started up. Allocate a static contiguous buffer,
Conventionally, a method of temporarily transferring data in the buffer and then copying the data to a user program area has been employed.

【0006】[0006]

【発明が解決しようとする課題】上述した従来の方法で
は、ユーザプログラムがそのデバイスを使用していない
時でも、常に一定のメモリが取られることになり、メモ
リ利用効率が悪いという問題がある。
The above-mentioned conventional method has a problem that a fixed memory is always taken even when the user program is not using the device, and the memory utilization efficiency is low.

【0007】また、カーネル内にメモリを確保するた
め、カーネル内バッファとユーザプログラムとの間で少
なくとも一度のメモリ転送を行う必要があり、入出力の
スループットを低下させるという問題がある。
Further, in order to secure a memory in the kernel, it is necessary to perform at least one memory transfer between the buffer in the kernel and the user program, and there is a problem that input / output throughput is reduced.

【0008】本発明は、上記に鑑みてなされたもので、
その目的とするところは、ページング方式によるメモリ
管理に加えてセグメント方式によるメモリ管理を備える
ことにより入出力データ転送効率を向上させ得るメモリ
管理方法を提供することにある。
[0008] The present invention has been made in view of the above,
An object of the present invention is to provide a memory management method capable of improving input / output data transfer efficiency by providing memory management by a segment method in addition to memory management by a paging method.

【0009】[0009]

【課題を解決するための手段】上記目的を達成するた
め、請求項1記載の本発明は、仮想記憶方式によるマル
チタスクを実現するオペレーティングシステムを備えた
コンピュータシステムにおいて、ユーザプロセスプログ
ラムおよび汎用メモリアロケーションによる小容量のメ
モリ要求に対してはページング方式によるメモリ管理を
行い、ユーザプロセスからの大容量のメモリ要求に対し
てはセグメント方式による物理的に連続したメモリ領域
を確保するメモリ管理を行うことを要旨とする。
According to one aspect of the present invention, there is provided a computer system having an operating system for realizing multitasking by a virtual memory system, comprising a user process program and a general-purpose memory allocation. For small-capacity memory requests, memory management using the paging method is performed, and for large-capacity memory requests from user processes, memory management for securing a physically continuous memory area using the segment method is performed. Make a summary.

【0010】請求項1記載の本発明にあっては、ユーザ
プロセスプログラムおよび汎用メモリアロケーションの
メモリ管理にはページング方式によるメモリ管理を行
い、ユーザプロセスからの大容量のメモリ要求に対して
はセグメント方式による物理的に連続したメモリを確保
し、この確保したメモリをユーザプロセスのメモリ空間
上にマップすることにより外部記憶装置および外部入出
力装置を含む外部装置からのデータ転送を行うため、ユ
ーザからの大量の入出力要求を効率的に行い、入出力転
送効率を向上することができる。
According to the first aspect of the present invention, the memory management of the user process program and the general-purpose memory allocation is performed by a paging method, and the segment method is used for a large-capacity memory request from the user process. To transfer data from an external device including an external storage device and an external input / output device by mapping a physically continuous memory by the user and mapping the allocated memory on a memory space of a user process. A large amount of input / output requests can be made efficiently, and the input / output transfer efficiency can be improved.

【0011】[0011]

【発明の実施の形態】以下、図面を用いて本発明の実施
の形態を説明する。図1は、本発明の一実施形態に係る
メモリ管理方法を実施するコンピュータシステムの構成
を示す図である。同図において、1は中央演算装置、3
はメモリ管理装置、5は主記憶装置、7は二次記憶装
置、9は外部I/O装置、11はシステムバス、13は
I/Oバスであり、メモリ管理装置3は、ページング方
式によるメモリ管理を行うページ管理装置3aとセグメ
ント方式によるメモリ管理を行うセグメント管理装置3
bを有する。なお、図1に示すコンピュータシステム
は、仮想記憶方式によるマルチタスクを実現し得るオペ
レーティングシステムを備えているものである。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram illustrating a configuration of a computer system that executes a memory management method according to an embodiment of the present invention. In the figure, 1 is a central processing unit, 3
Is a memory management device, 5 is a main storage device, 7 is a secondary storage device, 9 is an external I / O device, 11 is a system bus, 13 is an I / O bus, and the memory management device 3 is a paging type memory. Page management device 3a for performing management and segment management device 3 for performing memory management by the segment method
b. Note that the computer system shown in FIG. 1 includes an operating system capable of realizing multitasking by a virtual storage method.

【0012】メモリ管理装置3は、ページ管理装置3a
によりページング方式によるメモリ管理を行うことに加
えて、セグメント管理装置3bによりセグメント方式に
よるセグメント管理を行うことができる。そして、ユー
ザプロセスプログラムや汎用メモリアロケーションのメ
モリ管理にはページング方式によるメモリ管理を行うと
ともに、またユーザプログラムが入出力用の大容量のメ
モリを要求した時には、この要求に対するバッファとし
て、カーネルはセグメント方式による物理的に連続した
メモリを確保し、この確保したメモリをユーザプロセス
のメモリ空間に直接マップし、これにより二次記憶装置
および外部入出力装置を含む外部装置からの大量のDM
A転送を可能にするとともに、また直接ユーザプログラ
ム上に外部装置からDMA転送を可能にし、入出力のス
ループットを向上させている。
The memory management device 3 has a page management device 3a.
In addition to performing the memory management by the paging method, the segment management device 3b can perform the segment management by the segment method. The memory management of the user process program and the general-purpose memory allocation is performed by the paging method, and when the user program requests a large amount of memory for input / output, the kernel uses the segment method as a buffer for this request. , And directly maps the secured memory to the memory space of the user process, thereby enabling a large amount of DM from external devices including a secondary storage device and an external input / output device.
A transfer is enabled, and DMA transfer from an external device is directly enabled on a user program, thereby improving input / output throughput.

【0013】上述したように、図1に示すコンピュータ
システムにおけるメモリ管理方法では、カーネルはユー
ザプログラムや通常のメモリアロケーション要求に対し
ては、ページング方式によって管理されたメモリを割り
付けるが、ユーザプログラムが入出力用に連続したメモ
リを要求した時には、カーネルはページング用メモリと
は別に、セグメント方式用に予め確保したメモリ領域よ
り空いているエリアを探して、このエリアを確保し、こ
のエリア情報をユーザプログラムに割り付けられた仮想
アドレスに返却する。しかしながら、要求された空き領
域がない場合には、使用可能な最大のサイズのエリアを
返す。そして、ユーザプログラムは必要に応じてこのエ
リアを確保する。
As described above, in the memory management method in the computer system shown in FIG. 1, the kernel allocates a memory managed by the paging method to a user program or a normal memory allocation request. When requesting continuous memory for output, the kernel searches for an area free from the memory area reserved in advance for the segment method, separate from the paging memory, reserves this area, and stores this area information in the user program. Return to the virtual address assigned to. However, if there is no requested free area, the area of the maximum usable size is returned. Then, the user program secures this area as needed.

【0014】ここで一例として、 Segmemoryalloc
( )をメモリ確保の関数とし、入出力要求をIOrequest
( )とした場合の様子をプログラムで示すと次のように
なる。
Here, as an example, Seg - memory - alloc
() Is a function for allocating memory, and input / output requests are IO - request
The situation when () is shown in a program is as follows.

【数1】 Uneigned char Ptr; Unsigned int size,Needsize; Needsize=N; If((Ptr=Segmemoryalloc(Needsize,& size)==NULL){ Needsize=size; Ptr=Segmemoryalloc(size,& size); } IOrequest(Ptr,Needsize); この時のメモリ管理装置は、ユーザプログラムのアドレ
スを図2に示すようにユーザプログラムのメモリアドレ
スの上位数ビットを用いて、ページング管理によるメモ
リ空間かまたはセグメント管理によるメモリ空間かを判
断し、それぞれページ管理テーブルまたはセグメント管
理テーブルを用いて、物理メモリである主記憶装置5上
の物理アドレスに変換する。
[Equation 1] Uneigned char * Ptr; Unsigned int size, Needsize; Needsize = N; If ((Ptr = Seg memory alloc (Needsize, & size) == NULL) {Needsize = size; Ptr = Seg memory alloc (size, &size);} IO - request (Ptr, Needsize); At this time, the memory management device uses the upper few bits of the user program memory address as shown in FIG. It is determined whether the memory space is based on paging management or memory space based on segment management, and is converted into a physical address on the main storage device 5 as a physical memory using the page management table or the segment management table.

【0015】すなわち、図2に示すように、主記憶装置
5のメモリエリアはユーザプログラムのメモリアドレス
の上位数ビットでプログラムデータエリアかまたはセグ
メントI/Oエリアかに分けられ、プログラムデータエ
リアではプログラムページディレクトリからページ管理
テーブルを用いて物理メモリである主記憶装置5上に複
数のページメモリを画定し、これによりページング管理
メモリを形成し、またセグメントI/Oエリアではセグ
メント管理テーブルを用いて物理メモリである主記憶装
置5上に任意サイズの複数のセグメントメモリを画定
し、これによりセグメント管理メモリを形成している。
なお、各セグメントメモリのサイズN,Mなどは任意の
大きさであり、要求に応じて任意のサイズのセグメント
メモリを確保するが、この確保したセグメントメモリを
使用した後に空きとなった領域がセグメントメモリの末
尾に空き領域として図2ではサイズMのセグメントメモ
リの末尾に示されている。
That is, as shown in FIG. 2, the memory area of the main storage device 5 is divided into a program data area or a segment I / O area by upper several bits of a memory address of a user program. From the page directory, a plurality of page memories are defined on the main storage device 5, which is a physical memory, by using a page management table, thereby forming a paging management memory. In a segment I / O area, a physical memory is defined by using a segment management table. A plurality of segment memories of an arbitrary size are defined on the main storage device 5 which is a memory, thereby forming a segment management memory.
Note that the size N, M, etc. of each segment memory is an arbitrary size, and a segment memory of an arbitrary size is reserved according to a request. In FIG. 2, a free area at the end of the memory is shown at the end of the segment memory of size M.

【0016】セグメント管理によるメモリに対する例え
ばサイズNの入出力要求を受けたカーネルは、ドライバ
に対してサイズNだけの転送要求を出力する。転送終了
後はデータのユーザ空間へのコピーを行わずに直ちにユ
ーザプログラムに戻る。
The kernel that has received, for example, a size N input / output request to the memory by the segment management outputs a transfer request of size N to the driver. After the transfer is completed, the process immediately returns to the user program without copying the data to the user space.

【0017】[0017]

【発明の効果】以上説明したように、本発明によれば、
ユーザプロセスプログラムおよび汎用メモリアロケーシ
ョンのメモリ管理にはページング方式によるメモリ管理
を行い、ユーザプロセスからの大量の入出力要求に対応
するバッファとしてセグメント方式によるメモリ管理を
行い、ユーザプロセスのメモリ空間上にマップすること
により外部装置からのデータ転送を行うので、ユーザか
らの大量の入出力要求を効率的に行うことができ、入出
力転送効率を向上することができる。
As described above, according to the present invention,
For the memory management of the user process program and general-purpose memory allocation, the memory management by the paging method is performed, the memory management by the segment method is performed as a buffer corresponding to a large amount of input / output requests from the user process, and the memory is mapped on the memory space of the user process. By doing so, data transfer from the external device is performed, so that a large amount of input / output requests from the user can be made efficiently, and the input / output transfer efficiency can be improved.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施形態に係るメモリ管理方法を実
施するコンピュータシステムの構成を示す図である。
FIG. 1 is a diagram illustrating a configuration of a computer system that executes a memory management method according to an embodiment of the present invention.

【図2】図1の実施形態におけるユーザプログラム空
間、ページ管理テーブル、セグメント管理テーブル、主
記憶装置の関連を示す説明図である。
FIG. 2 is an explanatory diagram showing a relationship among a user program space, a page management table, a segment management table, and a main storage device in the embodiment of FIG.

【符号の説明】[Explanation of symbols]

1 中央演算装置 3 メモリ管理装置 3a ページ管理装置 3b セグメント管理装置 5 主記憶装置 7 二次記憶装置 9 外部I/O装置 DESCRIPTION OF SYMBOLS 1 Central processing unit 3 Memory management device 3a Page management device 3b Segment management device 5 Main storage device 7 Secondary storage device 9 External I / O device

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 仮想記憶方式によるマルチタスクを実現
するオペレーティングシステムを備えたコンピュータシ
ステムにおいて、 ユーザプロセスプログラムおよび汎用メモリアロケーシ
ョンによる小容量のメモリ要求に対してはページング方
式によるメモリ管理を行い、 ユーザプロセスからの大容量のメモリ要求に対してはセ
グメント方式による物理的に連続したメモリ領域を確保
するメモリ管理を行うことを特徴とするメモリ管理方
法。
In a computer system having an operating system for realizing multitasking by a virtual memory system, a memory management by a paging system is performed for a small-capacity memory request by a user process program and general-purpose memory allocation, A memory management method for securing a physically continuous memory area by a segment method in response to a large-capacity memory request from a user.
JP11189373A 1999-07-02 1999-07-02 Memory managing method Pending JP2001022640A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11189373A JP2001022640A (en) 1999-07-02 1999-07-02 Memory managing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11189373A JP2001022640A (en) 1999-07-02 1999-07-02 Memory managing method

Publications (1)

Publication Number Publication Date
JP2001022640A true JP2001022640A (en) 2001-01-26

Family

ID=16240242

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11189373A Pending JP2001022640A (en) 1999-07-02 1999-07-02 Memory managing method

Country Status (1)

Country Link
JP (1) JP2001022640A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006085393A (en) * 2004-09-15 2006-03-30 National Institute Of Information & Communication Technology High-speed transfer method for data from device, and data processor
JP2008033928A (en) * 2006-07-31 2008-02-14 Nvidia Corp Dedicated mechanism for page mapping in gpu
US7676645B2 (en) 2004-01-09 2010-03-09 International Business Machines Corporation Method, system, and article of manufacture for reserving memory
JP2013037589A (en) * 2011-08-09 2013-02-21 Kyocera Document Solutions Inc Image forming apparatus and image forming program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7676645B2 (en) 2004-01-09 2010-03-09 International Business Machines Corporation Method, system, and article of manufacture for reserving memory
JP2006085393A (en) * 2004-09-15 2006-03-30 National Institute Of Information & Communication Technology High-speed transfer method for data from device, and data processor
JP2008033928A (en) * 2006-07-31 2008-02-14 Nvidia Corp Dedicated mechanism for page mapping in gpu
JP2013037589A (en) * 2011-08-09 2013-02-21 Kyocera Document Solutions Inc Image forming apparatus and image forming program

Similar Documents

Publication Publication Date Title
JP2625385B2 (en) Multiprocessor system
JP4805314B2 (en) Offload input / output (I / O) virtualization operations to the processor
WO2016082196A1 (en) File access method and apparatus and storage device
WO2021244155A1 (en) Inter-process communication method and inter-process communication apparatus
JP2005242598A5 (en)
JPH06187298A (en) Data transfer processing method and data transfer processor
US8473691B2 (en) Memory management device, image forming apparatus, and image forming method
JP2774862B2 (en) DMA control device and information processing device
US20210373955A1 (en) Methods and systems for hardware-based memory resource allocation
US7249241B1 (en) Method and apparatus for direct virtual memory address caching
US10331570B2 (en) Real time memory address translation device
KR20180041037A (en) Method for shared distributed memory management in multi-core solid state driver
CN106295413B (en) Semiconductor device with a plurality of semiconductor chips
JP2001022640A (en) Memory managing method
US8375194B2 (en) System and method for freeing memory
JP2001051958A (en) Unified memory management system for multiprocessor multicomponent architecture
JP2001134486A (en) Microprocessor and storage device
TWI284806B (en) Method for managing external memory of a processor and chip for managing external memory
CN111026680A (en) Mapping a first identifier to a second identifier
JP3875358B2 (en) Storage device, storage method, and recording medium
CN117389685B (en) Virtual machine thermal migration dirty marking method and device, back-end equipment and chip thereof
JP4354583B2 (en) Access method and recording medium recording access processing program
JP3745909B2 (en) File management method
CN114461391A (en) Remappable GPU (graphics processing Unit) main memory access management method and system
CN115543618A (en) Memory allocation method, device, equipment and readable storage medium