Socket cache resource management method and apparatus
A resource management and socket technology, applied in the field of communication, can solve problems such as network service bottlenecks in distribution rate, extended user waiting time, and reduced user experience, so as to avoid long waiting time, improve user experience, and avoid consuming system performance. Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0027] In order to solve the problem that the management of skb in the prior art must rely on the allocation of the kernel skb slab cache to consume system performance, resulting in large consumption of system performance, and because the network service has a relatively large demand for the use of skb, but to the kernel skb slab cache The rate of applying for skb will not increase as the user's demand for skb increases, so the network service encounters a bottleneck, and the data transmission rate is limited, which makes the user's waiting time longer and the user experience declines. This embodiment A socket cache resource management method will be proposed, which can be implemented by a socket cache resource management device, see below figure 1 :
[0028] S102. After receiving the skb allocation application, the socket cache resource management device extracts the recyclable skb from the buffer pool.
[0029] When skb needs to be used, the socket cache resource management...
Embodiment 2
[0059] Corresponding to the socket cache resource management method provided in Embodiment 1, this embodiment introduces the socket cache resource management device implementing the method, which will be described below in conjunction with the accompanying drawings, so that those skilled in the art can manage The strengths and details of the method are clearer, see Figure 4 :
[0060] The socket cache resource management device 40 provided in this embodiment includes an extracting module 402 , a modifying module 404 and an allocating module 406 . The extracting module 402 is used to extract reclaimable skb after receiving the skb allocation application; the modification module 404 increases and modifies the reference count value of the extracted reclaimable skb; the allocation module 406 is used to allocate reclaimable skb to respond to skb distribution Application.
[0061] When the skb needs to be used, the extraction module 402 receives the skb allocation application. Ac...
Embodiment 3
[0094] The following is a step-by-step introduction to the socket cache resource management method and device provided in Embodiment 1 and Embodiment 2 with a specific example. Please combine Figure 7 :
[0095] S701. Create a buffer pool and apply to the system kernel for storing the skb in the buffer pool.
[0096] In this embodiment, the buffer pool is managed in the form of a lock-free queue, which facilitates direct extraction after receiving an skb allocation application, thereby improving allocation efficiency.
[0097] The reference count value of the skb pre-allocated by the system kernel is equal to 1. Therefore, although the skb stored in the buffer pool has not yet participated in the data transmission work, that is, when it has not been referenced, its reference count value is no longer 0. These skb is a recyclable skb.
[0098] S702. When the skb allocation application is received, the recyclable skb is extracted from the buffer pool for allocation.
[0099] ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


