Re: [PATCH-cpuset v7 0/2] Add Union-Find and use it to optimize cpuset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux