[Uclinux-h8-devel] [PATCH 00/11] Introduce kernel_clone(), kill _do_fork()

Back to archive index
Matthew Wilcox willy****@infra*****
2020年 8月 20日 (木) 00:45:21 JST


On Wed, Aug 19, 2020 at 03:41:48PM +0000, David Laight wrote:
> Does linux have an O(1) (or do I mean o(1)) pid allocator?
> Or does it have to do a linear scan to find a gap??

O(log(n)).  It uses the IDR allocator, so 'n' in this case is the
number of PIDs currently allocated, and it's log_64 rather than log_2
(which makes no difference to O() but does make a bit of a difference
to performance)



Uclinux-h8-devel メーリングリストの案内
Back to archive index