CN101308469B - Soft interruption load balancing realization method and apparatus - Google Patents

Soft interruption load balancing realization method and apparatus Download PDF

Info

Publication number
CN101308469B
CN101308469B CN2008101276776A CN200810127677A CN101308469B CN 101308469 B CN101308469 B CN 101308469B CN 2008101276776 A CN2008101276776 A CN 2008101276776A CN 200810127677 A CN200810127677 A CN 200810127677A CN 101308469 B CN101308469 B CN 101308469B
Authority
CN
China
Prior art keywords
cpu
central processing
processing unit
soft
interruption
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.)
Active
Application number
CN2008101276776A
Other languages
Chinese (zh)
Other versions
CN101308469A (en
Inventor
罗镇
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.)
Chengdu Huawei Technology Co Ltd
Original Assignee
Huawei Symantec Technologies Co 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 Huawei Symantec Technologies Co Ltd filed Critical Huawei Symantec Technologies Co Ltd
Priority to CN2008101276776A priority Critical patent/CN101308469B/en
Publication of CN101308469A publication Critical patent/CN101308469A/en
Application granted granted Critical
Publication of CN101308469B publication Critical patent/CN101308469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Hardware Redundancy (AREA)

Abstract

An embodiment of the invention discloses a soft interrupt load balancing equipment, which comprises a plurality of central processing units; each central processing unit has a corresponding local soft interrupt queue; the central processing units are used to receive hard interrupt and then select the central processing unit which processes the soft interrupt corresponding to the hard interrupt; if the other central processing units are selected, then IPI messages are sent to the selected central processing units to make the selected central processing units execute the soft interrupt. The embodiment of the invention discloses a soft interrupt load balancing realization method. The invention sends IPI messages among CPUs when the other CPUs are needed to process the soft interrupt, so the whole process does not need to be triggered by external events (such as the interruption of the clock); the whole process is coherent without delay and can uniformly dispatch the soft interrupt processing data among a plurality of CPUs in a timely manner.

Description

A kind of implementation method of soft interrupt load equilibrium and equipment
Technical field
The embodiment of the invention relates to communication technical field, relates in particular to a kind of implementation method and equipment of soft interrupt load equilibrium.
Background technology
In order to make hard interruption fast return, often adopt in soft interruption and carry out data processing in the computer system.Have a plurality of CPU (Central Process Unit, CPU (central processing unit)) in SMP (Symmetric Multiprocessor, symmetric multiprocessor) system, the hard interruption reports certain CPU, and corresponding soft interruption is also carried out on this CPU.Because the data processing of soft interruption consumes cpu resource very much, report under the unbalanced situation of all CPU hard the interruption, corresponding soft interruption also can't be balanced, this just causes the occupancy of CPU unbalanced, performance is limited by single cpu, can't bring into play the advantage of smp system, therefore, solving soft interruption equalization problem has great role to the performance that improves smp system.
Propose a kind of scheme in the prior art, as shown in Figure 1, each CPU has been increased a long-range soft interruption queue.After the hard interruption of equipment reported, CPU handled according to following steps:
The processing procedure that receives on the hard CPU that interrupts is as follows:
Step 101, equipment interrupt producing firmly, choose a CPU according to current system CPU loading condition and report hard interruption.
Step 102, that receive hard CPU (for example CPU0) the judgement selection of interrupting is this CPU, then soft Interrupt Process is placed local soft interruption queue, otherwise enters step 104.
Step 103, the hard Interrupt Process that receives the hard CPU that interrupts is finished, and dispatches soft interruption, handles the corresponding soft interruption of this hard interruption in the local soft interruption queue, and entire process is finished.
Step 104 receives the hard CPU (CPU0) that interrupts soft Interrupt Process is placed in the long-range soft interruption queue of CPU (for example CPU1) correspondence that is selected, and this CPU (CPU0) finishes dealing with.
Step 105 when the CPU that is selected interrupts producing at clock, is dispatched soft interruption.
Step 106, the CPU that is selected handles local soft interruption queue.
Step 107, the CPU that is selected handles the hard soft interruption of interrupting of equipment in the corresponding step 101 in the long-range soft interruption queue of this CPU, and entire process is finished.
In realizing process of the present invention, the inventor finds that there is following shortcoming in prior art:
Depend on the clock interruption because the long-range soft interruption queue of the CPU that is selected is handled, promptly interruption is set, after clock interrupts finishing, check the long-range soft interruption queue of itself, carry out soft Interrupt Process according to temporal frequency.And the cycle that clock interrupts generally be Millisecond other, therefore the soft Interrupt Process of long-range soft interruption queue is not very timely, has a strong impact on the promptness of data processing.
Summary of the invention
The embodiment of the invention provides a kind of implementation method and equipment of soft interrupt load equilibrium, to improve soft Interrupt Process promptness.
The embodiment of the invention provides a kind of soft interrupt load balancing equipment, comprises a plurality of CPU (central processing unit), and each CPU (central processing unit) has corresponding local soft interruption queue;
Described CPU (central processing unit), be used for receiving firmly and have no progeny, select to handle the CPU (central processing unit) of the corresponding soft interruption of described hard interruption, if select other CPU (central processing unit), then send IPI message, make described other CPU (central processing unit) carry out described soft interruption to described other CPU (central processing unit).
The embodiment of the invention provides a kind of implementation method of soft interrupt load equilibrium, is used for a plurality of CPU (central processing unit), and each CPU (central processing unit) has corresponding local soft interruption queue, may further comprise the steps:
One of them CPU (central processing unit) is had no progeny in receiving firmly, selects to handle the CPU (central processing unit) of the corresponding soft interruption of described hard interruption;
If select other CPU (central processing unit), then send and interrupt IPI message between processor to described other CPU (central processing unit), make described other CPU (central processing unit) carry out described soft interruption.
In the embodiments of the invention, adopted when needing other CPU to handle soft interruptions and sent IPI message between the CPU, whole flow process need not to wait for the triggering of external event (interrupting as clock), and whole flow process is coherent, there is not time-delay, in time the soft Interrupt Process data of balance dispatching between many CPU.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do one to the accompanying drawing of required use in embodiment or the description of the Prior Art below introduces simply, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is that CPU receives the hard processing synoptic diagram that interrupts in the prior art;
Fig. 2 is a kind of soft interrupt load balancing equipment structural drawing in the embodiment of the invention;
Fig. 3 is the implementation method process flow diagram of a kind of soft interrupt load equilibrium in the embodiment of the invention;
Fig. 4 is a kind of CPU (central processing unit) structural drawing in the embodiment of the invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and the embodiments.Should be appreciated that embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The equipment of soft interrupt load equilibrium in the embodiment of the invention as shown in Figure 2, comprises the equipment (for example network interface card, data card etc. obtain mass data from the outside, and need obtain the equipment of the soft Interrupt Process data of system) that reports hard interruption; A plurality of CPU, for example CPU0 is to CPUn, and each CPU has the local soft interruption queue of oneself, do not increase new long-range soft interruption queue, by sending IPI (Inter-ProfessorInterrupt interrupts between processor) message between the CPU, allow soft interruption between many CPU, carry out equilibrium in time.
The embodiment of the invention provides a kind of implementation method of soft interrupt load equilibrium, may further comprise the steps:
Have no progeny in receiving firmly, select to handle the CPU (central processing unit) of the corresponding soft interruption of described hard interruption;
If this CPU (central processing unit) is then carried out described soft interruption by local soft interruption queue; Wherein, describedly carry out described soft interruption by the soft interruption queue in this locality and specifically comprise: trigger the described hard corresponding soft interruption of interrupting; Described soft interruption is placed local soft interruption queue; Withdraw from described hard interruption; Dispatch soft interruption, handle local soft interruption queue.
If select other CPU (central processing unit), then send IPI message to described other CPU (central processing unit), make described other CPU (central processing unit) carry out described soft interruption.Wherein, making described other CPU (central processing unit) carry out described soft interruption specifically comprises: trigger the described hard corresponding soft interruption of interrupting; Described soft interruption is placed local soft Interrupt Process formation; Withdraw from described IPI and interrupt, dispatch soft interruption.
For the hard Interrupt Process flow process of equipment of soft interruption equilibrium treatment as shown in Figure 3, may further comprise the steps:
Step 301, equipment report hard interruption, and its interrupt number is irq_x, suppose that CPU0 receives interruption firmly.
Step 302, CPU0 chooses the CPUn for preparing to handle the corresponding soft interruption of irq_x according to the system load situation.
Step 303, CPU0 judges whether CPUn equals CPU0, if equal, then changes step 304, otherwise changes step 308.
Step 304 triggers soft interruption, and soft Interrupt Process is placed the local soft interruption queue of CPU0.
Step 305, the hard interruption of CPU0irq_x withdrawed from, and CPU0irq_x interrupts corresponding soft interruption firmly in the local soft interruption queue of scheduling CPU0.
Step 306, CPU0irq_x interrupts corresponding soft interruption firmly in the local soft interruption queue of processing CPU0.
Step 307 is finished the corresponding soft interruption data processing of this hard interruption of equipment.
Step 308, the CPU that CPU0 chooses is CPUn, sends IPI message to CPUn.
Step 309, CPUn receives IPI message, IPI takes place interrupt.
Step 310 is called the Interrupt Process function in the IPI Interrupt Process of CPUn, and this Interrupt Process function is to be stored in to be exclusively used in the function that carries out Interrupt Process among the CPU.
Step 311, CPUn triggers the soft interruption of irq_x correspondence, and soft interruption is placed local soft Interrupt Process formation on the CPUn.
Step 312, the IPI Interrupt Process of CPUn finishes, and CPU0irq_x interrupts corresponding soft interruption firmly in the local soft interruption queue of scheduling CPUn.
Step 313, CPUn carries out soft Interrupt Process.
Step 314 is finished the corresponding soft interruption data processing of this hard interruption of equipment.
In the embodiments of the invention, adopted transmission IPI message between the CPU when needing other CPU to handle soft interruptions, whole flow process need not to wait for the triggering of external event, in time the soft Interrupt Process data of balance dispatching between many CPU.
The embodiment of the invention provides a kind of soft interrupt load balancing equipment, comprises a plurality of CPU (central processing unit), and each CPU (central processing unit) has corresponding local soft interruption queue; Described CPU (central processing unit) is used for receiving firmly and has no progeny, and selects to handle the CPU (central processing unit) of the corresponding soft interruption of described hard interruption, if this CPU (central processing unit) is then carried out described soft interruption by local soft interruption queue; If select other CPU (central processing unit), then send IPI message to described other CPU (central processing unit), make described other CPU (central processing unit) carry out described soft interruption.
Wherein, as shown in Figure 4, described CPU (central processing unit) specifically comprises: interrupt receiving element 401 firmly, be used to receive the hard interrupt request from external unit; Selected cell 402 is used for the CPU (central processing unit) according to the corresponding soft interruption of the system load selection described hard interruption of execution; Processing unit 403 when being used for selected cell 402 and selecting local CPU (central processing unit), is carried out described soft interruption by the soft interruption queue in this locality; Notification unit 404 when being used for selected cell 402 other CPU (central processing unit) of selection, sends IPI message to described other CPU (central processing unit), makes described other CPU (central processing unit) carry out described soft interruption.
Described CPU (central processing unit) also comprises: notice receiving element 405 is used to receive IPI message; Described processing unit 403 when also being used to notify receiving element 405 to receive IPI message, is carried out described soft interruption by the soft interruption queue in this locality.
In the embodiments of the invention, adopted when needing other CPU to handle soft interruptions and sent IPI message between the CPU, whole flow process need not to wait for the triggering of external event (interrupting as clock), and whole flow process is coherent, there is not time-delay, in time the soft Interrupt Process data of balance dispatching between many CPU.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (6)

1. a soft interrupt load balancing equipment is characterized in that, comprises a plurality of CPU (central processing unit), and each CPU (central processing unit) has corresponding local soft interruption queue;
Described CPU (central processing unit), be used for receiving firmly and have no progeny, select to handle the CPU (central processing unit) of the corresponding soft interruption of described hard interruption, if select other CPU (central processing unit), then send and interrupt IPI message between processor, make described other CPU (central processing unit) carry out described soft interruption to described other CPU (central processing unit).
2. soft according to claim 1 interrupt load balancing equipment is characterized in that described CPU (central processing unit) comprises:
The hard receiving element that interrupts is used to receive the hard interrupt request from external data;
Selected cell is used for the CPU (central processing unit) according to the corresponding soft interruption of the described hard interrupt request of system load selection execution;
Notification unit when being used to select other CPU (central processing unit), sends interruption IPI message between processor to described other CPU (central processing unit), makes described other CPU (central processing unit) carry out described soft interruption.
3. as soft interrupt load balancing equipment as described in the claim 2, it is characterized in that described CPU (central processing unit) also comprises:
Processing unit when being used to select local CPU (central processing unit), is carried out described soft interruption by the soft interruption queue in this locality.
4. as soft interrupt load balancing equipment as described in the claim 3, it is characterized in that described CPU (central processing unit) also comprises:
The notice receiving element is used for interrupting between receiving processor IPI message;
Described processing unit also is used for described notice receiving element and receives when interrupting IPI message between processor, carries out described soft interruption by the soft interruption queue in this locality.
5. the implementation method of a soft interrupt load equilibrium is used for a plurality of CPU (central processing unit), and each CPU (central processing unit) has corresponding local soft interruption queue, it is characterized in that, may further comprise the steps:
One of them CPU (central processing unit) is had no progeny in receiving firmly, selects to handle the CPU (central processing unit) of the corresponding soft interruption of described hard interruption;
If select other CPU (central processing unit), then send and interrupt IPI message between processor to described other CPU (central processing unit), make described other CPU (central processing unit) carry out described soft interruption.
6. as the implementation method of soft interrupt load equilibrium as described in the claim 5, it is characterized in that, make described other CPU (central processing unit) carry out described soft interruption and comprise:
Enter and interrupt the IPI Interrupt Process between processor;
Trigger the described hard corresponding soft interruption of interrupting;
Described soft interruption is placed local soft Interrupt Process formation;
Withdraw from and interrupt the IPI interruption between described processor, dispatch the described hard soft interruption of interrupting correspondence in the soft Interrupt Process formation in described this locality.
CN2008101276776A 2008-07-07 2008-07-07 Soft interruption load balancing realization method and apparatus Active CN101308469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101276776A CN101308469B (en) 2008-07-07 2008-07-07 Soft interruption load balancing realization method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101276776A CN101308469B (en) 2008-07-07 2008-07-07 Soft interruption load balancing realization method and apparatus

Publications (2)

Publication Number Publication Date
CN101308469A CN101308469A (en) 2008-11-19
CN101308469B true CN101308469B (en) 2011-08-10

Family

ID=40124934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101276776A Active CN101308469B (en) 2008-07-07 2008-07-07 Soft interruption load balancing realization method and apparatus

Country Status (1)

Country Link
CN (1) CN101308469B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101394362B (en) * 2008-11-12 2010-12-22 清华大学 Method for load balance to multi-core network processor based on flow fragmentation
CN106502786A (en) * 2016-10-08 2017-03-15 郑州云海信息技术有限公司 A kind of interrupt distribution method and device
CN109791503A (en) * 2018-03-07 2019-05-21 华为技术有限公司 Handle the method and apparatus interrupted
CN109284192B (en) * 2018-09-29 2021-10-12 网宿科技股份有限公司 Parameter configuration method and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050125582A1 (en) * 2003-12-08 2005-06-09 Tu Steven J. Methods and apparatus to dispatch interrupts in multi-processor systems
US20080082710A1 (en) * 2006-09-29 2008-04-03 Dell Products L.P. System and method for managing system management interrupts in a multiprocessor computer system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050125582A1 (en) * 2003-12-08 2005-06-09 Tu Steven J. Methods and apparatus to dispatch interrupts in multi-processor systems
US20080082710A1 (en) * 2006-09-29 2008-04-03 Dell Products L.P. System and method for managing system management interrupts in a multiprocessor computer system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JP特开2007-188397A 2007.07.28

Also Published As

Publication number Publication date
CN101308469A (en) 2008-11-19

Similar Documents

Publication Publication Date Title
CN109471705B (en) Task scheduling method, device and system, and computer device
US11157061B2 (en) Processor management via thread status
US8539498B2 (en) Interprocess resource-based dynamic scheduling system and method
US10877766B2 (en) Embedded scheduling of hardware resources for hardware acceleration
CN108536532B (en) Batch task processing method and system
US7788435B2 (en) Interrupt redirection with coalescing
US20070005530A1 (en) Selecting grid executors via a neural network
WO2009075913A1 (en) Interrupt controller for invoking service routines with associated priorities
CN104901898A (en) Load balancing method and device
CN101308469B (en) Soft interruption load balancing realization method and apparatus
CN109298990A (en) Log storing method, device, computer equipment and storage medium
US11526382B2 (en) Cascading job scheduling in guests
CN106030559A (en) Syncronization of interrupt processing to reduce power consumption
CN105786909A (en) Message queue backlog load self-adaptive application triggering method and system
US10545890B2 (en) Information processing device, information processing method, and program
CN104793996A (en) Task scheduling method and device of parallel computing equipment
CN112162835A (en) Scheduling optimization method for real-time tasks in heterogeneous cloud environment
CN109710416A (en) Resource regulating method and device
CN107015931A (en) Method and accelerator unit for interrupt processing
CN106330750A (en) Controllable high-concurrency distributed message queue push method
CN110837415B (en) Thread scheduling method and device based on RISC-V multi-core processor
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
US20090327555A1 (en) Processor Interrupt Determination
CN107544840A (en) A kind of process management method and device
CN108306926B (en) Method and device for pushing gateway service data of Internet of vehicles equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: CHENGDU CITY HUAWEI SAIMENTEKE SCIENCE CO., LTD.

Free format text: FORMER OWNER: HUAWEI TECHNOLOGY CO., LTD.

Effective date: 20090424

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20090424

Address after: Qingshui River District, Chengdu high tech Zone, Sichuan Province, China: 611731

Applicant after: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES Co.,Ltd.

Address before: Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Province, China: 518129

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: HUAWEI DIGITAL TECHNOLOGY (CHENGDU) CO., LTD.

Free format text: FORMER NAME: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LTD.

CP01 Change in the name or title of a patent holder

Address after: 611731 Chengdu high tech Zone, Sichuan, West Park, Qingshui River

Patentee after: HUAWEI DIGITAL TECHNOLOGIES (CHENG DU) Co.,Ltd.

Address before: 611731 Chengdu high tech Zone, Sichuan, West Park, Qingshui River

Patentee before: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221012

Address after: No. 1899 Xiyuan Avenue, high tech Zone (West District), Chengdu, Sichuan 610041

Patentee after: Chengdu Huawei Technologies Co.,Ltd.

Address before: 611731 Qingshui River District, Chengdu hi tech Zone, Sichuan, China

Patentee before: HUAWEI DIGITAL TECHNOLOGIES (CHENG DU) Co.,Ltd.