Hlist_head, List_head, Hlist_node structures in the Linux kernel

Source: Internet
Author: User
Tags prev

These structures are often seen in the Linux kernel:

struct List_head;

struct Hlist_head;

struct Hlist_node;


These three structures are defined in the Linux kernel source code as follows:

struct List_head

{

struct List_head *prev;

struct List_head *next;

}

struct Hlist_node

{

struct Hlist_node **prev;

struct Hlist_node *next;

}


struct Hlist_head

{

struct Hlist_node *first;

}


The role of these three structures in the kernel:

struct List_head is used to build a doubly linked list in the kernel. This structure is included in the process descriptor struct task_struct of the processes, which is used to make process descriptors in the kernel a process list to manage the processes used in the system.


struct Hlist_head and struct hlist_node are used to build hash lists in the kernel, with the names of these two structures known, the struct hlist_head is used to point to the hash table's head, and the struct hlist_ node is the element in the hash array, which is then hung in a linked list to hold the process descriptor using the same hash index.


This article is from the "FAI Aberdeen" blog, please make sure to keep this source http://weiguozhihui.blog.51cto.com/3060615/1565069

Hlist_head, List_head, Hlist_node structures in the Linux kernel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.