HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: Allocation of PIDs on Tru64 5.1
Operating System - Tru64 Unix
1829662
Members
10066
Online
109992
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 06:02 AM
05-08-2003 06:02 AM
Allocation of PIDs on Tru64 5.1
Does anybody know how Tru64 allocates the next PID number ?
The reason that I am asking, is that I have noticed that the PIDs are not always greater than the last one used, as on most other O/S and I think this is causing me grief when I store these in an internal table.
Is there some sort of re-allocating of PIDs going on ?
Is there a kernel parameter to control this ?
Is this a feature/problem with 5.1 only ?
Any info would be appreciated.
Kevin
The reason that I am asking, is that I have noticed that the PIDs are not always greater than the last one used, as on most other O/S and I think this is causing me grief when I store these in an internal table.
Is there some sort of re-allocating of PIDs going on ?
Is there a kernel parameter to control this ?
Is this a feature/problem with 5.1 only ?
Any info would be appreciated.
Kevin
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 09:43 AM
05-08-2003 09:43 AM
Re: Allocation of PIDs on Tru64 5.1
Hi Kevin,
I did a quick look and found a couple of things.
PIDs do get reused but they (pid_entry's) should get tacked to the end of the free pid list when the process exits.
This certainly could produce out-of-order PIDs upon new process creation. I'm not aware of a tuneable to change this behavior.
Here are a couple of data structures you can look at on your system to see more of what's going on:
(dbx) p pid_data
struct {
pd_npids = 0x4000
pd_ntabs = 0x1
pd_nents = 0x4000
pd_ebits = 0xe
pd_pidtab = 0xfffffc0000ce05c0
pd_ptbases = (nil)
pd_freelock = 0x0
pd_freelist = 0xfffffc0000d31f80
pd_taillink = 0xfffffc0000d327d0
pd_usecount = 0x5a
pd_expwait = 0x0
pd_expbusy = (nil)
}
(dbx) p *pid_data.pd_freelist
struct {
pe_pid = 0x6a934
pe_gen = 0x1a
pe_ibn = '^N'
pe_flag = '^@'
pe_proc = (nil)
pe_link = 0xfffffc0000d32940
pe_lock = 0x0
}
Hope this helps.
Greg
I did a quick look and found a couple of things.
PIDs do get reused but they (pid_entry's) should get tacked to the end of the free pid list when the process exits.
This certainly could produce out-of-order PIDs upon new process creation. I'm not aware of a tuneable to change this behavior.
Here are a couple of data structures you can look at on your system to see more of what's going on:
(dbx) p pid_data
struct {
pd_npids = 0x4000
pd_ntabs = 0x1
pd_nents = 0x4000
pd_ebits = 0xe
pd_pidtab = 0xfffffc0000ce05c0
pd_ptbases = (nil)
pd_freelock = 0x0
pd_freelist = 0xfffffc0000d31f80
pd_taillink = 0xfffffc0000d327d0
pd_usecount = 0x5a
pd_expwait = 0x0
pd_expbusy = (nil)
}
(dbx) p *pid_data.pd_freelist
struct {
pe_pid = 0x6a934
pe_gen = 0x1a
pe_ibn = '^N'
pe_flag = '^@'
pe_proc = (nil)
pe_link = 0xfffffc0000d32940
pe_lock = 0x0
}
Hope this helps.
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 07:50 PM
05-08-2003 07:50 PM
Re: Allocation of PIDs on Tru64 5.1
Yes, pid entries are reused. And there's an algorithm we use to ensure the same PIDs are not reused too quickly.
They're assigned distinct PIDs by adding 2pe_ibn for each new generation. (i.e. newpid = pid + pe_gen * 2 pe_ibn ).
We verify whether the entry in the pid table belongs to "our PID" by checking the pe_pid value (in pidtab array) once the entry is located.
The algorithm to locate your pidtab by PID is:
(kdbx) p PID & (pid_data.pd_nents -1)
That will give you the index into pidtab - p pidtab[index]. You should print it in hex so you can read the pe_ibn index. This will also give you the address to the proc structure where all things related may be found.
My pe_ibn is 0xc which would be 2^12, which equals 4096. So, we add that to our specific PID and compare that to the pe_pid to determine whether this slot belongs to this PID, or if the slot is being reused.
I am aware that certain code will scan the pidtab and if we find a slot that isn't in use (I believe we determine this by determining if the pd_proc field is null) then it's a candidate for re-use.
Regards,
Phil
They're assigned distinct PIDs by adding 2pe_ibn for each new generation. (i.e. newpid = pid + pe_gen * 2 pe_ibn ).
We verify whether the entry in the pid table belongs to "our PID" by checking the pe_pid value (in pidtab array) once the entry is located.
The algorithm to locate your pidtab by PID is:
(kdbx) p PID & (pid_data.pd_nents -1)
That will give you the index into pidtab - p pidtab[index]. You should print it in hex so you can read the pe_ibn index. This will also give you the address to the proc structure where all things related may be found.
My pe_ibn is 0xc which would be 2^12, which equals 4096. So, we add that to our specific PID and compare that to the pe_pid to determine whether this slot belongs to this PID, or if the slot is being reused.
I am aware that certain code will scan the pidtab and if we find a slot that isn't in use (I believe we determine this by determining if the pd_proc field is null) then it's a candidate for re-use.
Regards,
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2003 06:23 AM
05-09-2003 06:23 AM
Re: Allocation of PIDs on Tru64 5.1
Thanks for the info.
I'm going to change the way that I process my internal table.
Just for the record, a log file that I was checking seemed to indicate that I had a re-used PID 35 seconds after the original.
I'm going to change the way that I process my internal table.
Just for the record, a log file that I was checking seemed to indicate that I had a re-used PID 35 seconds after the original.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP