CN101276289A - Method for user and multi-inner core to perform communication in Linux system - Google Patents

Method for user and multi-inner core to perform communication in Linux system Download PDF

Info

Publication number
CN101276289A
CN101276289A CNA2008100961643A CN200810096164A CN101276289A CN 101276289 A CN101276289 A CN 101276289A CN A2008100961643 A CNA2008100961643 A CN A2008100961643A CN 200810096164 A CN200810096164 A CN 200810096164A CN 101276289 A CN101276289 A CN 101276289A
Authority
CN
China
Prior art keywords
message
linux
nuclear
kernel
fmn
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.)
Granted
Application number
CNA2008100961643A
Other languages
Chinese (zh)
Other versions
CN101276289B (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.)
Jiangsu Sannong Tesco Agel Ecommerce Ltd.
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2008100961643A priority Critical patent/CN101276289B/en
Publication of CN101276289A publication Critical patent/CN101276289A/en
Application granted granted Critical
Publication of CN101276289B publication Critical patent/CN101276289B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention provides a communication method of users with a multi-kernel in a Linux system, including: (1) a kernel of the multi-kernel in the Linux system is provided as a control kernel, other kernels are provided as accompanied kernels; (2)After receiving the data message transmitted by the application program in the Linux user space, Linux control kernel transmits an arousing function pointer message containing arousing receiving accompanied kernels and message of the receiving accompanied kernels to FMN according to the type selection transmission strategy of the data message; (3) Linux is aroused by receiving the message of FMN received by the accompanied kernels, extracting the arousing function pointer message from the FMN message, entering in the service processing function pointed by the arousing function pointer, processing service process by the service line program. The invention achieves the progress that the communication between user and kernel is from single kernel to multiple-kernel, achieving effect of realizing communication between user and multiple-kernel in Linux system.

Description

The method that user and many kernels carry out communication in linux system
Technical field
The present invention relates to data communication field, relate in particular to a kind of method that user and many kernels carry out communication in linux system.
Background technology
Development along with data communication technology, particularly (SuSE) Linux OS further develop and perfect, the increasing network equipment begins and has adopted the operating system software of (SuSE) Linux OS as equipment, compare with some other operating system, Linux has the support multi-user, multiprocessor, multi-platform characteristics also have abundanter simultaneously and the function of network realization more efficiently; In addition attractive spot is no more than increasing income property and the free property of Linux, the source code that is whole linux kernel all freely can get, this just makes the network equipment that adopts (SuSE) Linux OS software except the characteristic with function expansion preferably and performance expansion, also has better commercial value, because only need doing some exploitations that are fit to own equipment on open Linux source code, the user just can obtain good functions of the equipments and performance, go to buy the commercial operating system software of specialty and need not spend a large amount of money, make cost of developing reduce greatly.
What use mostly in the present network equipment is vxworks operating system, and vxworks operating system adopts microkernel designs as a kind of business software, though preferable performance is arranged, cost of use is higher.Comparatively speaking, Linux has better economic worth as a kind of that increase income with free software.
In linux system, be divided into Linux user's space and linux kernel space.Linux user's space: be meant that mainly the various application programs in user's space promptly are in the various application programs of user's attitude; Linux kernel space B: comprise the various application programs that are in kernel state, the kernel of finishing functional processor and (the Fast Message Network of the FMN between the intraware, the fast message network) communication network and can realize the Netlink protocol suite that user's space is communicated by letter with kernel spacing, being used to finish the processing that user's space is passed the data message of coming, is that the space is handled in the operation of all associative operations in the kernel state.In addition, Linux also supports multi-processor structure, this can further improve the processing power of processor and the performance of whole operation system, but how to realize that it is urgent problem that user's space and many kernel spacings carry out communication in the linux system that adopts multinuclear.
Summary of the invention
The invention provides a kind of method that user and many kernels carry out communication in linux system, in adopting linux system, realize the problem that user's space and many kernel spacings carry out communication to solve.
In order to solve the problems of the technologies described above, the invention provides a kind of method that user and many kernels carry out communication in linux system, comprise the steps:
(1) kernel that is provided with in linux system in many kernels is control nuclear, and other kernel is from nuclear;
(2) after the data message of the application program transmission of receiving this Linux user's space is examined in described Linux control, send strategy according to the type selecting of this data message, will comprise then and wake the message of reception up and send on the fast message network FMN from the function pointer information of waking up of nuclear and this reception from nuclear information;
(3) described reception promptly is waken up after stone grafting is received message on the described FMN, extracts the described function pointer information of waking up from this FMN message, enters into this and wakes the business processing function that function pointer points to up, carries out business processing by its professional thread.
The method of the invention, wherein, in the step (2) before, the socket system call of the application program of described Linux user's space by the Netlink protocol suite with this linux kernel space communication, authorized to described Linux control and to be sent data message.
The method of the invention, wherein, in the step (2), the type of described data message is divided into control class and service class, and described transmission strategy is divided into " directive sending strategy " and " load balancing sends strategy ":
If the data message of control class then adopts " directive sending strategy ";
If the data message of service class then adopts " load balancing sends strategy ".
The method of the invention, wherein, in the step (1), also the difference according to class of service is provided with the different processing of division from nuclear.
Further, in the step (2), after the data message of the application program transmission of receiving this Linux user's space is examined in described Linux control, at first judge corresponding which kind of business of this data message, handle from nuclear to determine it, and then send strategy according to the type selecting of this data message, will comprise and wake the message of reception up and send on the FMN from the function pointer information of waking up of nuclear and this reception from nuclear information.
Further, if described Linux control nuclear is received the data message of the service class that the application program of this Linux user's space sends, and after judging corresponding which kind of business of this data message, with the data storage of different business kind in different buffer queues, adopt " load balancing sends strategy " then, structure FMN message, comprise in this message be used for waking up reception from the function pointer information of waking up of nuclear, receive this FMN message from nuclear information and described service class data message in the address of described buffer queue memory location, and send on the FMN.
The method of the invention wherein, also comprises the steps:
(4) reception returns to described control kernel with result by FMN message from nuclear, is sent to the application program of described Linux user's space by this control kernel.
Adopt the method for the invention, compared with prior art, obtained communication between user and the kernel by the progress of monokaryon to multinuclear, reached the effect that in linux system, realizes communication between user and the many kernels, saved the cost of development that adopts linux system, improved and adopted traffic handing capacity of linux system or the like.
Description of drawings
Fig. 1 is the method flow diagram that the embodiment of the invention user and many kernels in linux system carry out communication;
Fig. 2 is application example of the present invention is realized the means of communication between user and the many kernels in adopting linux system a synoptic diagram;
Fig. 3 is application example of the present invention is realized the means of communication between user and the many kernels in the employing linux system of Fig. 2 a process flow diagram.
Embodiment
Below in conjunction with the drawings and specific embodiments technical scheme of the present invention is described in detail.
As shown in Figure 1, be the method flow diagram that the embodiment of the invention user and many kernels in linux system carry out communication, comprise the steps:
Step 101, a kernel that is provided with in linux system in many kernels is control nuclear, other kernel is from nuclear;
The socket system call by the Netlink protocol suite of step 102, the application program of Linux user's space with this linux kernel space communication, is authorized to Linux control and to be sent data message;
Step 103, after the data message of the application program transmission of receiving this Linux user's space is examined in Linux control, send strategy according to the type selecting of this data message, will comprise then and can wake the message of reception up and send on the FMN from the function pointer information of waking up of nuclear and this reception from nuclear information;
Step 104, generally speaking, reception is in dormant state from nuclear, promptly be waken up after receiving the message on the FMN, from FMN message, extract and wake function pointer information up, enter into this and wake the business processing function that function pointer points to up, carry out corresponding service processing by its professional thread.
As shown in Figure 2, be application example of the present invention is realized the means of communication between user and the many kernels in adopting linux system synoptic diagram: should comprise 8 kernels in the processor with the example use, by Core0, Core1 ..., Core7 identifies, wherein we are referred to as control nuclear as the Core0 of control, examine us as other of business processing and are referred to as from nuclear.Linux system comprises Linux user's space A and linux kernel space B.
As shown in Figure 3, be application example of the present invention is realized the means of communication between user and the many kernels in the employing linux system of Fig. 2 process flow diagram, comprise the steps:
Step 301, a kernel Core0 who is provided with in linux system in 8 kernels is control nuclear, other kernel is from nuclear; Further, also the difference according to class of service is provided with the different processing of division from nuclear, moves professional A such as Core1 to Core4, and Core5 to Core7 moves professional B;
Step 302, the application program of Linux user's space are by the socket system call of Netlink protocol suite, and with this linux kernel space communication, Core0 sends data message to control nuclear;
Step 303 after Core0 receives data message, is at first judged corresponding which kind of business of this data message, handles from nuclear, if professional A then need send it to Core1 to Core4 to determine it; If professional B then need send it to Core5 to Core7;
Step 304, after which kind of business judgement was, Core0 sent strategy according to the type selecting of this data message in the buffer queue: if the data message of control class then changes step 305; If the data message of service class then changes step 306;
Step 305, Core0 selects to adopt " directive sending strategy " to send control information, change step 307 then: such as this control information is professional A, 4 corresponding Core1 to Core4 of FMN message difference of structure during transmission, if in certain time delay, can not receive the FMN passback message that receives nuclear, will repeat to send to this nuclear, each nuclear of Core1 to Core4 all will be received this control information when as seen adopting this strategy;
Step 306, Core0 select to adopt " load balancing sends strategy " to send business information, changes step 307 then: business information only may be received and handles from nuclear by one when adopting this strategy;
Step 307, Core0 choose send strategy after, will construct the FMN information and sending to FMN, contain in the FMN message and be used for waking up from the function pointer information of nuclear and receive from nuclear information;
Step 308, reception is in dormant state from nuclear, promptly be waken up after receiving the message on the FMN, from FMN message, extract the function pointer information of waking up, enter into this and wake the business processing function that function pointer points to up, carry out corresponding service processing by its professional thread, and result is returned to Core0 by FMN message, send to the application program of Linux user's space by Core0.
It should be noted that herein business datum is stored among the buffer queue Buffer in the above-mentioned application example, do not have business datum in the FMN message, have only the address of business datum memory location in Buffer.Core0 elder generation storage service data are encapsulated into memory address in the FMN message of structure in the step 307 then to Buffer.In the step 303, after Core0 receives the data message of service class, at first judge corresponding which kind of business of this data message, handle from nuclear to determine it, we use two buffer queue BufferA and BufferB corresponding professional A and B respectively herein, and the business datum of professional A and B is dealt into respectively among BufferA and the BufferB; Because what the business datum address information adopted is " load balancing sends strategy "; The poll BufferA that Core1 to Core4 can not stop, handle business datum (Core5 to Core7 is poll BufferB in like manner) wherein, like this when the BufferA non-NULL, in case there is certain nuclear free time to get off, this nuclear will come the data among the treatments B ufferA, and some nuclear overload can not take place, but the idle situation of some nuclear effectively raises the efficient of multinuclear.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1, a kind of method that user and many kernels carry out communication in linux system is characterized in that, comprises the steps:
(1) kernel that is provided with in linux system in many kernels is control nuclear, and other kernel is from nuclear;
(2) after the data message of the application program transmission of receiving this Linux user's space is examined in described Linux control, send strategy according to the type selecting of this data message, will comprise then and wake the message of reception up and send on the fast message network FMN from the function pointer information of waking up of nuclear and this reception from nuclear information;
(3) described reception promptly is waken up after stone grafting is received message on the described FMN, extracts the described function pointer information of waking up from this FMN message, enters into this and wakes the business processing function that function pointer points to up, carries out business processing by its professional thread.
2, method according to claim 1, it is characterized in that, in the step (2) before, the socket system call of the application program of described Linux user's space by the Netlink protocol suite, with this linux kernel space communication, authorize to described Linux control and to send data message.
3, method according to claim 1 is characterized in that, in the step (2), the type of described data message is divided into control class and service class, and described transmission strategy is divided into " directive sending strategy " and " load balancing sends tactful ":
If the data message of control class then adopts " directive sending strategy ";
If the data message of service class then adopts " load balancing sends strategy ".
4, method according to claim 1 is characterized in that, in the step (1), also is provided with according to the difference of class of service and divides different processing from nuclear.
5, as method as described in the claim 4, it is characterized in that, in the step (2), after the data message of the application program transmission of receiving this Linux user's space is examined in described Linux control, at first judge corresponding which kind of business of this data message, determining it to handle, and then send strategy, will comprise and wake the message of reception up and send on the FMN from the function pointer information of waking up of nuclear and this reception from nuclear information according to the type selecting of this data message from nuclear.
6, as method as described in the claim 5, it is characterized in that, if described Linux control nuclear is received the data message of the service class that the application program of this Linux user's space sends, and after judging corresponding which kind of business of this data message, with the data storage of different business kind in different buffer queues, adopt " load balancing sends strategy " then, structure FMN message, comprise in this message and be used to wake up the wake function pointer information of reception from nuclear, receive the address of memory location described buffer queue from nuclear information and described service class data message of this FMN message, and send on the FMN.
7, method according to claim 1 is characterized in that, also comprises the steps:
(4) reception returns to described control kernel with result by FMN message from nuclear, is sent to the application program of described Linux user's space by this control kernel.
CN2008100961643A 2008-05-09 2008-05-09 Method for user and multi-inner core to perform communication in Linux system Expired - Fee Related CN101276289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100961643A CN101276289B (en) 2008-05-09 2008-05-09 Method for user and multi-inner core to perform communication in Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100961643A CN101276289B (en) 2008-05-09 2008-05-09 Method for user and multi-inner core to perform communication in Linux system

Publications (2)

Publication Number Publication Date
CN101276289A true CN101276289A (en) 2008-10-01
CN101276289B CN101276289B (en) 2010-06-16

Family

ID=39995756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100961643A Expired - Fee Related CN101276289B (en) 2008-05-09 2008-05-09 Method for user and multi-inner core to perform communication in Linux system

Country Status (1)

Country Link
CN (1) CN101276289B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077266A (en) * 2013-03-27 2014-10-01 华为技术有限公司 Multi-core operating system realization method, realization device and realization system
CN105302709A (en) * 2014-07-03 2016-02-03 阿里巴巴集团控股有限公司 Test data generating method and device
CN109271203A (en) * 2017-07-14 2019-01-25 龙芯中科技术有限公司 Kernel loads method, apparatus and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814179B2 (en) * 2003-10-24 2010-10-12 Microsoft Corporation Interface between mobile connectivity service and WWAN device
CN100435530C (en) * 2006-04-30 2008-11-19 西安交通大学 Method for realizing two-way load equalizing mechanism in multiple machine servicer system
CN100428171C (en) * 2006-12-08 2008-10-22 杭州华三通信技术有限公司 Communication method between data plane and control plane

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077266A (en) * 2013-03-27 2014-10-01 华为技术有限公司 Multi-core operating system realization method, realization device and realization system
WO2014154045A1 (en) * 2013-03-27 2014-10-02 华为技术有限公司 Method, apparatus and system for implementing multicore operating system
CN104077266B (en) * 2013-03-27 2017-07-07 华为技术有限公司 Many kernel operating system implementation methods and realize apparatus and system
CN105302709A (en) * 2014-07-03 2016-02-03 阿里巴巴集团控股有限公司 Test data generating method and device
CN105302709B (en) * 2014-07-03 2019-01-22 阿里巴巴集团控股有限公司 Test data generating method and equipment
CN109271203A (en) * 2017-07-14 2019-01-25 龙芯中科技术有限公司 Kernel loads method, apparatus and storage medium
CN109271203B (en) * 2017-07-14 2022-03-15 龙芯中科(西安)科技有限公司 Kernel loading method and device and storage medium

Also Published As

Publication number Publication date
CN101276289B (en) 2010-06-16

Similar Documents

Publication Publication Date Title
CN115599513B (en) Resource scheduling method and electronic equipment
Nishio et al. Service-oriented heterogeneous resource sharing for optimizing service latency in mobile cloud
US8667089B2 (en) Apparatus and method for executing an application
CN108173698B (en) Network service management method, device, server and storage medium
CN104584621B (en) Outside the wireless mixing field for reconnecting the time for reducing computing device/scene prediction calculating
CN106385468B (en) The predictable dynamic load balancing method of Web cluster
CN108628674A (en) Method for scheduling task, cloud platform based on cloud platform and computer storage media
US8310969B2 (en) Mobile device and power saving method thereof
CN107046508A (en) Message method of reseptance and the network equipment
WO2021258753A1 (en) Service processing method and apparatus, and electronic device and storage medium
JP2005323369A (en) Method for maintaining wireless network response time while saving wireless adapter power
WO2005091705A2 (en) Power management system and method for a wireless communications device
CN104102543A (en) Load regulation method and load regulation device in cloud computing environment
EP3268842A1 (en) METHODS AND SYSTEMS FOR COORDINATION OF OPERATING STATES AMONGST MULTIPLE SOCs WITHIN A COMPUTING DEVICE
CN111404931B (en) Remote data transmission method based on persistent memory
US20210149806A1 (en) Data prefetching method and terminal device
CN103581966A (en) Real-time monitoring optimizing configuration method for smart phone
Tianze et al. Consumption considered optimal scheme for task offloading in mobile edge computing
CN101276289B (en) Method for user and multi-inner core to perform communication in Linux system
CN114710571B (en) Data packet processing system
CN116028205B (en) Resource scheduling method and electronic equipment
CN104933009A (en) On-chip communication method for use in multi-core DSP and data communication apparatus
CN1326035C (en) Mobile application environment
CN111371848A (en) Request processing method, device, equipment and storage medium
CN100562864C (en) A kind of implementation method of chip-on communication of built-in isomerization multicore architecture

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20171222

Address after: 221300, Xuzhou, Jiangsu City, Pizhou province Pizhou Economic Development Zone on the north side of Liaohe Road, North Huashan Road West

Patentee after: Huang Shaowei

Address before: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20171222

Address after: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518057 Nanshan District high tech Industrial Park, Guangdong, South Road, science and technology, ZTE building, legal department

Patentee before: ZTE Corp.

TR01 Transfer of patent right

Effective date of registration: 20181025

Address after: 510640 2414-2416 of the main building 371, five mountain road, Tianhe District, Guangzhou, Guangdong.

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 221300 Jiangsu Xuzhou Pizhou Pizhou Economic Development Zone north of Liaohe West Road, west side of Huashan North Road.

Patentee before: Huang Shaowei

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20181101

Address after: 221300 room 103, student Pioneer Park, Pizhou, Xuzhou, Jiangsu

Patentee after: Jiangsu Sannong Tesco Agel Ecommerce Ltd.

Address before: 510640 2414-2416 of the main building 371, five mountain road, Tianhe District, Guangzhou, Guangdong.

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100616

Termination date: 20180509

CF01 Termination of patent right due to non-payment of annual fee