KR19990032701A - How to port Unix device drivers - Google Patents

How to port Unix device drivers Download PDF

Info

Publication number
KR19990032701A
KR19990032701A KR1019970053801A KR19970053801A KR19990032701A KR 19990032701 A KR19990032701 A KR 19990032701A KR 1019970053801 A KR1019970053801 A KR 1019970053801A KR 19970053801 A KR19970053801 A KR 19970053801A KR 19990032701 A KR19990032701 A KR 19990032701A
Authority
KR
South Korea
Prior art keywords
disk
driver
job
queue
job queue
Prior art date
Application number
KR1019970053801A
Other languages
Korean (ko)
Other versions
KR100253198B1 (en
Inventor
정현호
Original Assignee
구자홍
엘지전자 주식회사
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 구자홍, 엘지전자 주식회사 filed Critical 구자홍
Priority to KR1019970053801A priority Critical patent/KR100253198B1/en
Publication of KR19990032701A publication Critical patent/KR19990032701A/en
Application granted granted Critical
Publication of KR100253198B1 publication Critical patent/KR100253198B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)
  • Stored Programmes (AREA)

Abstract

본 발명은 UNIX 또는 UNIX 디바이스 드라이버의 개념을 준수하는 운영체계의 디바이스 드라이버 이식을 수행할 때, 대기상태 집중에 의한 프로세스 오버헤드를 없애기 위하여, 잡 큐(job queue) 단계의 최대 부하가 메시지 인터페이스 한계 부하량을 상회하지 않도록 설계하는 과정과; 보조 드라이버의 입출력 경로상의 병렬성을 최대한 활용하여 성능을 극대화 할 수 있도록 커널 드라이버의 잡 큐에 플로우 콘트롤 메커니즘을 삽입하고, 수위조절기법을 사용하여 잡 큐의 플로우 량을 하나의 디바이스 처리 능력에 의거하여 설정함과 아울러 최대 플로우 량을 메시지 인터페이스상의 대기상태를 방지할 수 있도록 설정하는 과정과; 메시지 인터페이스를 잡 큐 하단에 위치시킬 경우의 시스템 정지 문제를 해결하고, 이벤트 동기화와 프로세스적으로 연결되지 않고 인터럽트 핸들러 부분도 아닌 것을 감안하여 묶음 처리가 가능하도록 데몬 프로세스를 생성하는 과정을 통해 이루어지도록 한 것이다.According to the present invention, when performing device driver porting of an operating system conforming to the concept of UNIX or UNIX device driver, the maximum load of the job queue step is the message interface limit in order to eliminate the process overhead due to the concentration of wait states. Designing not to exceed the load; The flow control mechanism is inserted into the kernel driver's job queue to maximize the performance by maximizing the parallelism on the auxiliary driver's I / O path, and using the level control technique, the flow rate of the job queue is based on the capacity of one device. Setting the maximum flow amount to prevent a waiting state on the message interface; This is done by resolving the system hang when placing the message interface at the bottom of the job queue, and by creating a daemon process to enable batch processing in consideration of event synchronization and not being part of the interrupt handler. It is.

Description

유닉스 디바이스 드라이버 이식 방법How to port Unix device drivers

본 발명은 유닉스(UNIX) 또는 UNIX 디바이스 드라이버의 개념을 준수하는 운영체계의 디바이스 드라이버 이식상의 알고리즘 설계기술에 관한 것으로, 특히 본래의 설계에 한정된 자원 요소를 추가해야 하는 시스템에서 필연적으로 봉착하게 되는 부하 집중과 대기상태 집중을 차단하여 드라이버의 병렬성 및 성능을 도모할 수 있도록한 유닉스 디바이스 드라이버 이식 방법에 관한 것이다.The present invention relates to an algorithm design technique for device driver porting of an operating system that conforms to the concept of UNIX or UNIX device driver. In particular, the load inevitably encountered in a system in which resource elements limited to the original design must be added. The present invention relates to a UNIX device driver porting method that enables the parallelism and performance of a driver by blocking concentration and waiting state concentration.

입출력(I/O)을 전담하는 프로세서를 채택한 시스템에 유닉스를 이식할 때 해당 디바이스 드라이버는 이 시스템의 보드간 메시지 전달 체계를 준수하는 코드를 포함하여야 한다. 이 부분은 디바이스 드라이버 이식시 반드시 필요한 사안일뿐만 아니라 그 시스템의 성능을 결정하는 중요한 인자로 작용할 소지가 크기 때문에 신중한 설계를 요한다.When porting Unix to a system with a processor dedicated to I / O, the device driver must include code that conforms to the system's board-to-board messaging mechanism. This part requires careful design because it is not only an issue when porting a device driver, but can also be an important factor in determining the performance of the system.

세계적으로 시장을 선도하고 있는 유닉스 시스템들은 오픈 아키텍처를 지향하면서 여러 가지 표준과 다양한 확장성(scalability)을 제공하는 하나의 원천 코드(source code) 형태를 지향하고 있다. 이식내용이 가장 많을 수밖에 없는 디바이스 드라이버 역시 이러한 관점에서 드라이버-커널간 및 드라이버-디바이스간 표준을 준수하여 개발되어야 하는데, 디바이스 드라이버의 일반적인 구조를 디스크의 경우를 예로하여 도 1에 도시하였다.Market-leading Unix systems are oriented towards open architectures, with one source code form offering multiple standards and different scalability. The device driver, which has the most porting content, should also be developed in accordance with the driver-kernel and driver-device standards in this respect. The general structure of the device driver is illustrated in FIG.

이러한 구조를 도 3과 같이 한정된 메시지 전달 자원을 사용한 다중 처리기 구조로 이식할 경우 이식의 핵심 사항은 도 1과 같은 구조를 어떻게 분리하여 커널 드라이버(30B)와 보조 드라이버(30D)로 적절히 배분할 것인가 하는 문제와, 메시지 인터페이스(31A),(31B)를 어느 위치에 어떤 방식으로 설계하여 삽입하는가 하는 문제이다.When porting such a structure to a multiprocessor structure using limited message delivery resources as shown in FIG. 3, the key point of porting is how to separate the structure as shown in FIG. 1 and properly distribute it to the kernel driver 30B and the auxiliary driver 30D. The problem is how to design and insert the message interfaces 31A and 31B at which position.

여기에서는 하드웨어적으로 메시지 전달을 위한 완벽한 전용 프로토콜이 없는 보편적인 다중 처리기의 경우를 예로하여 공유 영역상에 소프트웨어적인 메시지 자료 구조를 갖추고 보드간 인터럽트 등의 하드웨어 프로토콜을 이용하여 구동되는 디스크 드라이버를 도시한 것인데, 이와 같은 구조 변경 설계를 행할 경우에 일반적으로 다음과 같이 성능에 영향을 주는 세가지의 문제점이 발생한다.Here, a disk driver driven by using hardware protocols such as board-to-board interrupts and a software message data structure in a shared area is shown as an example of a general multiprocessor without a fully dedicated protocol for message delivery in hardware. In the case of such a structural change design, three problems generally affect performance as follows.

첫째, 메시지 인터페이스(31A),(31B)를 디바이스의 어느 지점에 삽입한다 하더라도 메시지 자원에 대해 대기상태가 집중되는 현상을 피할 수 없어 프로세스 천이 오버헤드가 커지고 이로인하여 결국 병목현상을 보이게 된다. 일부 저널링 파일 시스템 등은 I/O 요청량을 스스로 조절하기 때문에 이러한 문제점이 발생하지 않을 수도 있으나 미가공 입출력(Raw I/O)과 대부분의 파일 시스템은 이와 같은 로드 조절 능력이 없다. 따라서, 이러한 문제점은 디바이스 드라이버 자체에서 그 해결방법을 모색해야 한다.First, even if the message interfaces 31A and 31B are inserted at any point of the device, the concentration of the waiting state for the message resources cannot be avoided, and thus, the process transition overhead becomes large, resulting in a bottleneck. Some journaling file systems, etc., may not have this problem because they adjust their own I / O requests, but raw I / O and most file systems do not have this capability. Therefore, this problem must be found in the device driver itself.

둘째, 작업 대기행렬인 잡 큐(job queue)(13)는 이식과정에서 원천코드를 그대로 사용할 수 있는 부분으로 도 3의 보조 드라이버(30D) 영역으로 옮겨 이식할 경우 커널 드라이버(30A)에서는 삭제할 수도 있다. 그러나, 일반적인 이식경향이 원래의 코드를 준수하는 것이고, 또한 잡 큐(13)의 운영방식으로 I/O 플로우 콘트롤이 가능하기 때문에 이 부분을 삭제하는 것은 바람직하지 않다. 문제는 도 2에 도시한 구조상의 문제점으로 보통 드라이버는 각각의 물리적인 디바이스마다 자료 구조를 만들어 액티브 큐(active queue) 형태로 job을 관리하는데 여러 가지 포인터를 사용하여 효율을 높이거나 플로우 콘트롤 방안을 도입하는 경우도 있다. 그러나, 어떠한 방법을 사용하더라도 이는 공유영역에 해당하는 메시지 시스템(30C)의 크기와 동작 구조를 반영하여 설계되어야 한다. 따라서, 이 부분 역시 목적 시스템에 부합하는 테크닉이 삽입되어 재설계가 필요하다.Second, the job queue 13, which is a job queue, is a part of the source code that can be used as it is in the process of porting, and may be deleted by the kernel driver 30A when the port is moved to the auxiliary driver 30D area of FIG. have. However, it is not desirable to delete this part because the general porting tendency is to comply with the original code, and I / O flow control is possible through the operation of the job queue 13. The problem is a structural problem shown in FIG. 2. Usually, a driver creates a data structure for each physical device and manages a job in the form of an active queue. It may be introduced. However, whatever method is used, it should be designed to reflect the size and operation structure of the message system 30C corresponding to the shared area. Therefore, this part also needs to be redesigned by inserting a technique corresponding to the target system.

마지막으로, 도 2에서 보는 바와 같이, I/O 요청을 담당하는 disk_strategy()는 그 다음의 이벤트 동기화가 필요하기 때문에 응답시간에 영향을 주지 않으려면 한 번 호출될때마다 한 번의 job만을 처리한다. 아울러, disk_intr() 역시 인터럽트 핸들러라는 특성에 의해 기본적으로 인터럽트 마스킹되어 있는 상태이므로 오랜 시간을 점유할 수 없고, 따라서 하나의 job만을 처리하도록 되어 있다. 결국, 묶음 처리에 의해 성능 향상을 기대할 수 있는 부분이 존재하지 않는다. 이를 해결하기 위해서는 디스크 job queue의 구조와 그 운영을 담당하는 커널 드라이버(30B) 상위 부분의 동작 구조 설계를 일부 변경해야 한다.Lastly, as shown in FIG. 2, disk_strategy () in charge of I / O requests processes only one job each time it is called to avoid response time because the next event synchronization is required. In addition, disk_intr () is basically interrupt masked due to the property of an interrupt handler, so it cannot occupy a long time. Therefore, only one job is processed. As a result, there is no part that can be expected to improve performance by the bundle process. In order to solve this problem, the structure of the disk job queue and the operation structure design of the upper part of the kernel driver 30B in charge of its operation must be changed.

이와 같이 종래기술에 의한 유닉스 디바이스 드라이버 이식기술에 있어서는 드라이버를 이분하고 중간에 메시지 교환을 위한 인터페이스를 추가할 경우에 메시지 인터페이스를 축으로하여 대기상태가 집중되고, 부하의 분산이 이루어지지 않으며, 기존의 드라이버 자체의 성능 취약점인 묶음 처리 부재 등으로 인하여 시스템의 성능이 저하되는 결함이 있었다.As described above, in the conventional UNIX device driver porting technology, when a driver is divided into two and an interface for message exchange is added in the middle, the standby state is concentrated around the message interface, and the load is not distributed. The system's performance was degraded due to the lack of bundle processing, which is a performance vulnerability of the driver itself.

따라서, 본 발명이 이루고자 하는 기술적 과제는 대기 상태 집중에 의한 프로세스 관리의 오버헤드를 없애기 위하여 잡 큐(job queue) 구조를 사용하고, 보조 드라이버의 입출력 경로상의 병렬성을 최대한 활용하여 성능을 극대화 하기 위하여 커널 드라이버의 job queue에 플로우 콘트롤 메카니즘을 삽입하며, 묶음 처리가 가능하도록 데몬 프로세스를 생성하는 유닉스 디바이스 드라이버 이식 방법을 제공함에 있다.Accordingly, the technical problem to be achieved by the present invention is to use a job queue structure in order to eliminate the overhead of process management by concentration of the standby state, and to maximize the performance by maximizing the parallelism on the input / output path of the auxiliary driver. It is to provide a Unix device driver porting method that inserts a flow control mechanism into the kernel driver's job queue and creates a daemon process to enable batch processing.

도 1은 종래 기술에 의한 디스크 디바이스 드라이버의 구조도.1 is a structural diagram of a disk device driver according to the prior art.

도 2는 종래 기술에 의한 디스크 드라이버의 잡 큐 구조 및 동작 메카니즘 설명도.2 is a diagram illustrating a job queue structure and an operation mechanism of a disk driver according to the prior art.

도 3은 이식된 디스크 드라이버의 구조도.3 is a structural diagram of an implanted disk driver.

도 4는 본 발명에 의한 디스크 드라이버의 잡 큐 구조 및 동작 메카니즘 설명도.4 is an explanatory diagram of the job queue structure and operation mechanism of the disk driver according to the present invention;

도 5a는 본 발명에 의한 디스크 스트래티지 루틴의 신호 흐름도.5A is a signal flow diagram of a disk strategy routine in accordance with the present invention.

도 5b는 본 발명에 의한 디스크 리스타트 루틴의 신호 흐름도.5b is a signal flow diagram of a disk restart routine according to the present invention;

***도면의 주요 부분에 대한 부호의 설명****** Description of the symbols for the main parts of the drawings ***

11 : 베이식 커널 12 : 디스크 드라이버 엔트리 포인트11: Basic Kernel 12: Disk Driver Entry Point

13 : 잡 큐 14 : 입출력버스 드라이버13: Job queue 14: I / O bus driver

15 : 물리적 입출력버스 30A : 커널15: physical I / O bus 30A: kernel

30B : 커널 드라이버 30C : 메시지 시스템30B: Kernel Driver 30C: Message System

30D : 보조 드라이버 31A,31B : 메시지 인터페이스30D: Auxiliary Driver 31A, 31B: Message Interface

32 : 미니-커널 33 : 메시지 풀32: mini-kernel 33: message pool

본 발명의 목적을 달성하기 위한 유닉스 디바이스 드라이버 이식 방법은 대기상태 집중에 의한 프로세스 오버헤드를 없애기 위하여, 잡 큐 단계의 최대 부하가 메시지 인터페이스 한계 부하량을 상회하지 않도록 설계하는 과정과; 보조 드라이버의 입출력 경로상의 병렬성을 최대한 활용하여 성능을 극대화 할 수 있도록 커널 드라이버의 잡 큐에 플로우 콘트롤 메커니즘을 삽입하고, 수위조절기법을 사용하여 잡 큐의 플로우 량을 하나의 디바이스 처리 능력에 의거하여 설정함과 아울러 최대 플로우 량을 메시지 인터페이스상의 대기상태를 방지할 수 있도록 설정하는 과정과; 메시지 인터페이스를 잡 큐 하단에 위치시킬 경우 시스템 정지 문제와, 이벤트 동기화와 프로세스적으로 연결되지 않고 인터럽트 핸들러 부분도 아닌 것을 감안하여 묶음 처리가 가능하도록 데몬 프로세스를 생성하는 과정으로 이루어지는 것으로, 이와 같이 이루어진 본 발명의 작용을 첨부한 도 3 내지 도 5를 참조하여 상세히 설명하면 다음과 같다.Unix device driver porting method for achieving the object of the present invention comprises the steps of designing such that the maximum load of the job queue step does not exceed the message interface limit load in order to eliminate the process overhead due to the concentration of the standby state; The flow control mechanism is inserted into the kernel driver's job queue to maximize the performance by maximizing the parallelism on the auxiliary driver's I / O path, and using the level control technique, the flow rate of the job queue is based on the capacity of one device. Setting the maximum flow amount to prevent a waiting state on the message interface; When the message interface is placed at the bottom of the job queue, the daemon process is created to allow for batch processing in consideration of a system hang problem and a process that is not connected to event synchronization and is not part of an interrupt handler. Referring to Figures 3 to 5 attached to the operation of the present invention in detail as follows.

우선, 도 3의 베이식 커널(11)이 디스크 드라이버 엔트리 포인트(12)에 등록된 함수를 통하여 I/O 요청을 하면 커널 드라이버(30B)의 상위 루틴은 몇가지 데이터 일치를 위한 이벤트 동기화를 제외하고는 대부분 메모리 할당에 관계된 이벤트에 대해서 대기상태로 진입할 수 있다. 전자의 경우는 빈번히 발생하지 않는 특수 요청에 관련되어 있어 대기상태 집중이 발생되지 않고, 후자의 경우는 베이식 커널(11)과 동일한 메모리 할당 메커니즘을 사용하기 때문에 메모리 자원의 고갈시 후속 요청 역시 차단되고 이로 인하여 대기상태 집중이 발생되지 않는다.First, when the basic kernel 11 of FIG. 3 makes an I / O request through a function registered in the disk driver entry point 12, the upper routine of the kernel driver 30B except for event synchronization for some data matching. Most of the time, you can enter a wait state for events related to memory allocation. The former case is related to a special request that does not occur frequently, so no waiting state concentration occurs. The latter case uses the same memory allocation mechanism as the basic kernel 11, so subsequent requests are also blocked when memory resources are exhausted. As a result, no concentration of standby state occurs.

그러나, 시스템 메모리 등을 활용한 공유 영역에 구축된 메시지 풀(Message pools)(33)에 상기와 동일한 메모리 할당 메커니즘을 사용하면 물리적으로 연속된 메모리를 할당 받기 위해 드라이버의 메모리 할당을 위한 응답시간이 길어지는 문제가 발생된다. 물리적으로 연속되지 않은 메모리 할당을 허용하려면 커널 드라이버(30B) 및 보조 드라이버(30D)의 주체가 동일한 MMU 테이블을 공유해야 하기 때문에 이 또한 현실적으로 설계가 어려울 뿐만 아니라 이 경우에도 평균 응답시간이 길어질 수 밖에 없다.However, if the same memory allocation mechanism is used for the message pools 33 constructed in the shared area utilizing the system memory, the response time for the memory allocation of the driver in order to allocate the physically contiguous memory is increased. Longer problems arise. This is also difficult to design, because the kernel driver 30B and the secondary driver 30D must share the same MMU table to allow physically non-contiguous memory allocation, and in this case, the average response time is also long. none.

따라서, 상기 메시지 풀(33)은 미리 할당된 제한된 자원으로 구성하고 할당 자원 부족시 대기상태로 진입하도록 설계하는 것이 일반적이다. 상기 커널 드라이버(30B)는 상기 메시지 풀(33)로 부터 메시지를 할당받아 메시지 자료 구조에 연결한 후 보조 드라이버(30D)에게 시그널을 전송한다. 그 시그널을 전송받은 보조 드라이버(30D)는 해당 메시지를 참조하여 작업을 수행한 후 다시 커널 드라이버(30B)에 그 시그널을 전송하게 된다. 이때, 메시지 반환의 주체가 커널 드라이버(30B)인지 보조 드라이버(30D)인지는 설계상의 선택사항이며 두가지 방식을 모두 지원하는 것이 바람직하다.Therefore, the message pool 33 is generally composed of limited resources allocated in advance and designed to enter a standby state when the allocated resources are insufficient. The kernel driver 30B receives a message from the message pool 33, connects to a message data structure, and transmits a signal to the auxiliary driver 30D. After receiving the signal, the auxiliary driver 30D performs the operation by referring to the corresponding message and transmits the signal to the kernel driver 30B again. At this time, whether the message return subject is the kernel driver 30B or the auxiliary driver 30D is a design option and it is preferable to support both methods.

디스크별로 큐 자료 구조를 따로 가지고 각각의 큐에 대해서 수위조절을 하는 것은 하나의 디스크 처리능력을 고려하여 과부하가 걸리지 않게 하는 역할뿐만 아니라 상기 메시지 풀(33)의 자원을 일부의 디스크가 독점하여 여타 디스크의 I/O 플로우가 원활하게 이루어지지 못하는 기근(starvation) 현상도 방지할 수 있으며, 이는 시스템의 전체 성능에 큰 영향을 미친다.The level control for each queue with a separate disk data structure for each disk not only takes care of the disk throughput, but also overloads the resources of the message pool 33 with other disks. It also prevents starvation, which prevents the I / O flow of the disks from running smoothly, which greatly affects the overall performance of the system.

도 4에 디스크 드라이버의 잡 큐(job queue)(13) 구조와 그 구동 메커니즘을 도시하였으며, 여기서, disk_strategy()와 disk_restart()의 세부 순서도를 도 5a 및 도 5b에 나타내었다. 도 5a 및 도 5b의 내용이 도 4의 잡 큐(13) 구동 메커니즘과 밀접한 상관 관계를 가지고 있기 때문에 이들을 종합하여 설명하기로 한다.4 illustrates a structure of a job queue 13 of a disk driver and a driving mechanism thereof, and detailed flowcharts of disk_strategy () and disk_restart () are shown in FIGS. 5A and 5B. Since the contents of FIGS. 5A and 5B have a close correlation with the job queue 13 driving mechanism of FIG. 4, these will be collectively described.

먼저, 잡 큐(13)는 물리적인 디스크마다 하나씩 할당되며 디스크 라는 자료 구조로 설정되고, 각각의 job은 링크 리스트(linked list) 형태로 접속된다. 새로운 요청은 리스트의 꼬리(tail)에 접속되고, 요청 job을 하부의 보조 드라이버(30D)로 요청할때는 리스트의 머리부(head)에서 가져온다. 각각의 리스트는 디스크의 실제적인 처리능력을 고려하고 또한 시스템의 현실성 있는 최대 부하 및 메시지 시스템 용량을 고려하여 보조 드라이버(30D)로의 요청에 대한 수위조절(water mark control) 기법을 적용하게 된다.First, a job queue 13 is allocated to each physical disk and set in a data structure called a disk. Each job is connected in the form of a linked list. The new request is connected to the tail of the list, and is taken from the head of the list when the request job is requested to the subordinate driver 30D. Each list takes into account the actual processing capacity of the disk and also takes into account the realistic maximum load of the system and the message system capacity to apply watermark control techniques to requests to the secondary driver 30D.

도 4의 상단에 표시된 disk_strategy() 루틴은 커널(30A)로 부터의 I/O 요청을 행하는 부분으로 job을 큐에 삽입하는 작업과 큐로 부터 떼어오는 작업을 모두 수행하게 되고, 하단에 표시된 disk_restart()는 큐로 부터 job을 떼어서 보조 드라이버(30D)로 요청만 하는 단방향 작업만을 수행하게 된다.The disk_strategy () routine shown in the upper part of FIG. 4 performs I / O requests from the kernel 30A and performs both the operation of inserting a job into the queue and the operation of detaching from the queue, and the disk_restart ( ) Removes the job from the queue and performs only one-way jobs that request only the auxiliary driver 30D.

도 5a의 disk_strategy 신호 흐름도에서와 같이, 커널(30A)로 부터의 I/O 요청이 발생하면 필요한 경우 파일 시스템 등의 데이터 구조 등을 체크하고, 논리 및 물리적 범위의 적합성 등을 점검한 후 job 자료구조를 하나 할당받아 이를 무조건 디스크 큐에 접속한다. 해당 디스크 큐로 부터 보조 드라이버(30D)로 요청된 job의 개수가 HWM(High_Water_Mark) 이상인지를 조사하여 이상으로 판명되면 바로 리턴하고, 그렇지 않은 것으로 판명되면 디스크 큐의 헤드로 부터 하나의 job을 떼어내 메시지를 할당받고 job의 내용으로 부터 필요한 정보를 메시지에 기재하여 보조 드라이버(30D)로 전송한다.As shown in the disk_strategy signal flow diagram of FIG. 5A, when an I / O request from the kernel 30A occurs, the data structure such as a file system is checked if necessary, and the job data after checking the suitability of the logical and physical ranges. Takes a structure and attaches it to a disk queue. Investigate whether the number of jobs requested from the disk queue to the auxiliary driver 30D is greater than or equal to HWM (High_Water_Mark). The message is allocated and the necessary information from the contents of the job is written in the message and transmitted to the auxiliary driver 30D.

다시말해서, disk_strategy()는 하나의 I/O 요청에 대해서 하나의 보조 드라이버(30D) 요청을 행하든지 아니면 잡 큐(13)만 갱신하고 아무런 요청을 하지 않을 수도 있기 때문에 모든 요청이 보조 드라이버(30D)의 작업 요청으로 전달될 수 있도록 보장해주기 위한 엔진이 필요한데 이것이 인터럽트 핸들러에서 이루어지는 것이 유닉스 디바이스 드라이버의 관행이다. 그러나, 유닉스의 설계에는 인터럽트 핸들러에서 대기상태로 진입해서는 않된다는 또하나의 규칙이 있기 때문에 메시지를 할당 받으며 대기상태로 진입할 수 있도록 설계해야 하는 본 구조에서는 이 엔진을 인터럽트 핸들러내에 둘 수 없다.In other words, disk_strategy () may make one auxiliary driver 30D request for one I / O request, or it may update only the job queue 13 and do not make any request. We need an engine to ensure that it can be delivered as a work request, which is what Unix device drivers do for the interrupt handler. However, in Unix's design there is another rule that an interrupt handler must not enter a wait state, so in this architecture, which must be designed to allow a message to be allocated and enter a wait state, the engine cannot be placed in an interrupt handler.

이 문제를 해결하기 위해 데몬 프로세스(daemon process)를 설계한다. 먼저, 데몬 개수는 디스크 자료 구조의 개수와 일치시켜 엔진의 규모를 가볍게 하고 해당 디스크를 처음 오픈(open)할 때 동적으로 생성하여 불필요한 엔진 생성을 방지한다. 데몬의 명칭을 disk_restart 라 하며, 이를 도 5b에 나타내었다.To solve this problem, design a daemon process. First, the number of daemons matches the number of disk data structures to reduce the size of the engine and dynamically create the first time the disk is opened to prevent unnecessary engine creation. The name of the daemon is called disk_restart, which is shown in FIG. 5B.

disk_restart()의 페어런트(parent)는 시스템 프로세스 즉, 프로세스 0번이 되도록 생성해야만 그 생성을 유발시킨 유저 프로세서의 무한 대기 상황을 방지할 수 있다. 이와 같이 disk_restart()를 시스템 프로세스의 커널 쓰레드(kernel thread)로 생성시키면 성능적인 오버헤드를 최소화 하면서 그 기능을 수행할 수 있다. 실행되자마자 무조건 대기상태로 진입하는 disk_restart()는 디스크 인터럽트 핸들러인 disk_intr()에서 깨우는 역할을 하는데, 보조 드라이버로 요청된 I/O job의 수가 low_water_mark 이하일때만 깨운다. 이렇게 해서 깨어난 disk_restart()는 디스크 큐(disk queue)에 대기하고 있는 job들을 하나씩 떼어내 보조 드라이버의 I/O job 개수가 다시 high_water_mark가 될 때까지 혹은 더 이상 수행할 job이 없을때까지 그 수행을 반복한 후 다시 대기상태로 진입한다. 이렇게 하여 커널 드라이버(30B)는 I/O 요청을 묶음 처리할 수 있고, 그 양은 high_water_mark-low_water_mark의 크기에 의해 결정된다. 더구나, 이러한 드라이버 구조는 disk_strategy()에 의한 일대 일 요청과 disk_restart()에 의한 묶음 요청이 적절히 균형을 이루어 I/O 로드가 비교적 작을 때는 전자의 역할이 강조되고 로드가 클때는 후자의 역할이 강조되는 복합적인 I/O 대응력을 갖게 된다.The parent of disk_restart () must be created to be a system process, that is, process 0, to prevent the infinite waiting state of the user processor causing the creation. If disk_restart () is created as a kernel thread of a system process like this, the function can be performed with minimal performance overhead. As soon as it executes, disk_restart () enters the standby state and wakes up from the disk interrupt handler disk_intr (). It wakes up only when the number of I / O jobs requested by the auxiliary driver is below low_water_mark. This wakes up disk_restart (), which removes the jobs waiting in the disk queue one by one until the number of I / O jobs in the auxiliary driver becomes high_water_mark again or until there are no more jobs to run. Repeat to enter the standby state again. In this way, the kernel driver 30B can bundle the I / O requests, the amount of which is determined by the size of high_water_mark-low_water_mark. Moreover, this driver architecture is well-balanced for one-to-one requests by disk_strategy () and bundle requests by disk_restart (), which emphasizes the former when the I / O load is relatively small and the latter when the load is heavy. You will have multiple I / O responsiveness.

이상에서 상세히 설명한 바와 같이, 본 발명은 메시지 등의 한정된 자원에 의한 인터페이스를 유닉스의 디바이스 드라이버에 삽입할 때 발생하는 이식상의 성능과 관련된 문제를 해결하기 위해 부하 집중과 대기 상태 집중을 차단함으로써 I/O 흐름의 병렬성이 향상되고 시스템의 성능에 이바지할 수 있는 효과가 있다. 이러한 기법은 디스크 이외의 다른 유닉스 디바이스 드라이버에도 적응이 가능하며, 특히 잡 큐의 플로우 조절과 연관된 데몬 프로세스의 묶음 처리 기법은 메시지 인터페이스의 유무로 예시된 시스템의 아키텍쳐와 관계없이 모든 유닉스 시스템에 적용이 가능하게 되는 효과가 있다.As described in detail above, the present invention solves the problem of portability performance when inserting an interface by a limited resource such as a message into a device driver of Unix. The parallelism of the O flow is improved and it can contribute to the performance of the system. This technique is also adaptable to other Unix device drivers other than disks. In particular, the daemon process's bundle handling techniques associated with job queue flow control apply to all Unix systems regardless of the architecture of the illustrated system, with or without a message interface. There is an effect that becomes possible.

Claims (4)

대기상태 집중에 의한 프로세스 오버헤드를 없애기 위하여, 잡 큐 단계의 최대 부하가 메시지 인터페이스 한계 부하량을 상회하지 않도록 설계하는 과정과; 보조 드라이버의 입출력 경로상의 병렬성을 최대한 활용하여 성능을 극대화 할 수 있도록 커널 드라이버의 잡 큐에 플로우 콘트롤 메커니즘을 삽입하고, 수위조절기법을 사용하여 잡 큐의 플로우 량을 하나의 디바이스 처리 능력에 의거하여 설정함과 아울러 최대 플로우 량을 메시지 인터페이스상의 대기상태를 방지할 수 있도록 설정하는 과정과; 메시지 인터페이스를 잡 큐 하단에 위치시킬 경우의 시스템 정지문제를 해결하고, 이벤트 동기화와 프로세스적으로 연결되지 않고 인터럽트 핸들러 부분도 아닌 것을 감안하여 묶음 처리가 가능하도록 데몬 프로세스를 생성하는 과정으로 이루어지는 것을 특징으로 하는 유닉스 디바이스 드라이버 이식 방법.Designing such that the maximum load of the job queue step does not exceed the message interface limit load in order to eliminate the process overhead due to concentration of waiting states; The flow control mechanism is inserted into the kernel driver's job queue to maximize the performance by maximizing the parallelism on the auxiliary driver's I / O path, and using the level control technique, the flow rate of the job queue is based on the capacity of one device. Setting the maximum flow amount to prevent a waiting state on the message interface; It solves the system hang problem when the message interface is located at the bottom of the job queue, and creates the daemon process to enable the batch processing considering that it is not connected to the event synchronization process and is not part of the interrupt handler. UNIX device driver porting method. 제1항에 있어서, 잡 큐는 물리적인 디스크마다 하나씩 할당되며 디스크 라는 자료 구조로 설정되고, 각각의 잡은 링크 리스트 형태로 접속되며, 새로운 요청은 리스트의 꼬리에 접속되고, 요청 잡을 하부의 보조 드라이버로 요청할때는 리스트의 머리부에서 가져오며, 각각의 리스트는 디스크의 실제적인 처리능력을 고려하고 또한 시스템의 현실성 있는 최대 부하 및 메시지 시스템 용량을 고려하여 보조 드라이버로의 요청에 대한 수위조절 기법을 적용하는 것을 특징으로 하는 유닉스 디바이스 드라이버 이식 방법.2. The job queue of claim 1, wherein a job queue is allocated for each physical disk and set up in a data structure called disk, each job is connected in the form of a linked list, new requests are connected to the tail of the list, and a subordinate driver underneath the request job. The request is taken from the head of the list, and each list takes into account the actual processing capacity of the disk, and also applies the level control technique to the request to the auxiliary driver considering the system's realistic maximum load and message system capacity. Unix device driver porting method, characterized in that. 제1항에 있어서, 잡 큐는 잡을 큐에 삽입하는 작업과 큐로 부터 떼어오는 작업을 모두 수행하는 디스크 스트래티지(disk_strategy()) 루틴과; 큐로 부터 잡을 떼어서 보조 드라이버로 요청하는 단방향 작업만을 수행하는 디스크 리스타트(disk_restart()) 루틴을 포함하여 이루어지는 것을 특징으로 하는 유닉스 디바이스 드라이버 이식 방법.3. The job queue of claim 1, further comprising: a disk strategy (disk_strategy ()) routine for performing both a job of inserting a job into the queue and a job of removing from the queue; A method for porting a Unix device driver, comprising: a disk restart (disk_restart ()) routine that performs only a one-way operation by requesting an auxiliary driver from a queue. 제1항에 있어서, 데몬 프로세스를 생성할 때, 데몬의 개수는 디스크 자료 구조의 개수와 일치시켜 엔진의 규모를 가볍게 하고, 해당 디스크를 처음 오픈할 때 동적으로 생성하여 불필요한 엔진 생성을 방지하도록 생성하는 것을 특징으로 하는 유닉스 디바이스 드라이버 이식 방법.The method of claim 1, wherein when creating a daemon process, the number of daemons matches the number of disk data structures to reduce the size of the engine, and dynamically creates the first disk to prevent unnecessary engine generation. Unix device driver porting method, characterized in that.
KR1019970053801A 1997-10-20 1997-10-20 Transplantation method of unix device driver KR100253198B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019970053801A KR100253198B1 (en) 1997-10-20 1997-10-20 Transplantation method of unix device driver

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019970053801A KR100253198B1 (en) 1997-10-20 1997-10-20 Transplantation method of unix device driver

Publications (2)

Publication Number Publication Date
KR19990032701A true KR19990032701A (en) 1999-05-15
KR100253198B1 KR100253198B1 (en) 2000-04-15

Family

ID=19523067

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019970053801A KR100253198B1 (en) 1997-10-20 1997-10-20 Transplantation method of unix device driver

Country Status (1)

Country Link
KR (1) KR100253198B1 (en)

Also Published As

Publication number Publication date
KR100253198B1 (en) 2000-04-15

Similar Documents

Publication Publication Date Title
US8307053B1 (en) Partitioned packet processing in a multiprocessor environment
US9710310B2 (en) Dynamically configurable hardware queues for dispatching jobs to a plurality of hardware acceleration engines
US9710408B2 (en) Source core interrupt steering
US7493436B2 (en) Interrupt handling using simultaneous multi-threading
US5390329A (en) Responding to service requests using minimal system-side context in a multiprocessor environment
US6895585B2 (en) Method of mixed workload high performance scheduling
US7996843B2 (en) Symmetric multi-processor system
US7661115B2 (en) Method, apparatus and program storage device for preserving locked pages in memory when in user mode
US20020103847A1 (en) Efficient mechanism for inter-thread communication within a multi-threaded computer system
JP2000330806A (en) Computer system
EP2240852B1 (en) Scalable sockets
EP2191371A2 (en) Allocating network adapter resources among logical partitions
US7103631B1 (en) Symmetric multi-processor system
US20030056084A1 (en) Object orientated heterogeneous multi-processor platform
US20230315526A1 (en) Lock-free work-stealing thread scheduler
US7765548B2 (en) System, method and medium for using and/or providing operating system information to acquire a hybrid user/operating system lock
EP3770759A1 (en) Wake-up and scheduling of functions with context hints
US7844782B2 (en) Data processing system with memory access
Govindarajan et al. Design and performance evaluation of a multithreaded architecture
JPH06243112A (en) Multiprocessor device
JPH0916531A (en) Data transmission method
Barton-Davis et al. Adding Scheduler Activations to Mach 3.0.
KR100253198B1 (en) Transplantation method of unix device driver
US7660939B2 (en) Operating system arrangement for flexible computer system design
JPH03257634A (en) Method and device for parallelly processing program

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20061220

Year of fee payment: 8

LAPS Lapse due to unpaid annual fee