Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 8 years ago

Closed 5 years ago

#398 closed defect (fixed)

Improve the hash table implementation

Reported by: Jakub Jermář Owned by: Jakub Jermář
Priority: major Milestone: 0.7.0
Component: helenos/kernel/generic Version: mainline
Keywords: gsoc12 Cc:
Blocker for: Depends on:
See also:

Description (last modified by Jakub Jermář)

Improve the kernel's (and possibly also the uspace's) implementation of the generic hash table.

Details
The current HelenOS hash table implementation is very simple. It uses a predefined number of buckets and chaining of items. It is used in many places including the global page hash table, IRQ handling, generic range allocator, inter-process communication, device drivers, file systems and networking.

Unlike the current implementation, the new hash table should scale with the number of hashed items, i.e. the hash table should be able to grow/shrink as items are added to or removed from it. Implementation details of how this is achieved are not that important, with the following remarks:

  • the way the hash table is used should remain the same, i.e. use buckets with linked lists
  • number of links needed for an item to be hashed should remain 1, even though internally, there could be more instances of the hash table (e.g. for the old size and the new size)
  • the hash table needs to remain usable for the implementation of the global page hash table
  • insert should not break lockless find operation of page table mappings

Integrating the new hash table with the current code shall be considered an integral part of the solution of this project.

What Gains and Benefits will this bring?
This will basically move us from using a poor-man's hash table implementation to using an advanced data structure with constant-time lookup operation. Given the key role of the hash table in various HelenOS subsystems, the benefit of realizing this project will be quite significant.
Difficulty
Medium to difficult. The solution needs to be able to work in the delicate environment of various kernel subsystems, especially with respect to synchronization.
Required skills
A successful applicant will have good skills of programming in the C language and will be familiar with advanced data structures. He or she will also need to be able to asses the synchronization needs of various hash table uses throughout the system.
Documentation
Possible mentors
HelenOS Core Team, Jakub Jermar

Change History (5)

comment:1 Changed 7 years ago by Jakub Jermář

Keywords: gsoc12 added
Milestone: 0.5.00.5.1

comment:2 Changed 7 years ago by Jakub Jermář

Description: modified (diff)

comment:3 Changed 7 years ago by Jakub Jermář

Description: modified (diff)

comment:4 Changed 5 years ago by Jakub Jermář

Milestone: 0.6.00.7.0

comment:5 Changed 5 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

Fix merged in mainline,2297.

Note: See TracTickets for help on using tickets.