Re: Make sysctl_file more smp friendly

2015-05-11 Thread Philip Guenther
Vitaliy, As I told you directly last week, proposing changes in anticipation of future work requires some sort of plan about that future work. Without some sort of model for locking the access paths, it's impossible to judge whether the proposed change is useful or pointless. On Fri, 8 May

Re: Make sysctl_file more smp friendly

2015-05-08 Thread Vitaliy Makkoveev
I have questions about sysctl_file(): 1. Looks like sysctl_file() should do the same things for KERN_FILE_BYPID and KERN_FILE_BYUID cases. But pr->ps_textvp (vnode of executable) will be copied for KERN_FILE_BYPID case only. Is this copying missing for KERN_FILE_BYUID? 2. (arg < -1) check looks be

Re: Make sysctl_file more smp friendly

2015-05-08 Thread Vitaliy Makkoveev
Unfortunately, in 2 cases this diff will increase "needed" variable for non existing files too. This is the fixed version. Index: sys/kern/kern_sysctl.c === RCS file: /cvs/src/sys/kern/kern_sysctl.c,v retrieving revision 1.284 diff -u

Make sysctl_file more smp friendly

2015-05-08 Thread Vitaliy Makkoveev
sysctl_file() has 2 cases: KERN_FILE_BY_PID and KERN_FILE_BYUID. In these cases sysctl_file() can access file descriptor table from other processes. File descriptor table of caller process can be accessed by other threads too. The file instances from file descriptor table will be accessed too. So f