Hello, Xavier. On Sun, Jun 23, 2024 at 10:38:59AM +0800, Xavier wrote: > I think I understand your point now. I have modified the Union-Find > implementation so that the allocation and deallocation are handled by the > user, providing only the initialization interface. Thanks for your > suggestion. I recommend spending more time studying the existing data structures. The pattern is pretty universal. The element is often embedded in a containing structure. Macros and init methods are provided to initialize the element along with operations which implement the data structure operations, and then we use container_of() to obtain the embedding structure. We very rarely allocate data structure members by themselves. Also, the cleanup in cpuset seems nice but, if you can think of other use cases, that'd be great too. Thanks. -- tejun