IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
The problem was strncpy() doesn't stop after writing the terminating
NUL; by definition it goes on to zero the entire buffer.
I spy another use of strncpy in udev_device_add_property_from_string(),
which is responsible for another ~1% user cpu time...
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Since we already know the length, use memcpy() instead.
Measured 2% _user_ cpu time reduction on EeePC coldplug.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Use calloc to request cleared memory instead.
Kernel and libc conspire to make this more efficient.
Also, replace one malloc() + strcpy() with strdup().
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Unfortunately the linux rmdir implementation unhashes the dentry
even when the directory is not removed. This is apparently by
design (for filesystems that don't allow deleting open files).
Results from time(1) and oprofile follow.
Before:
0.35user 0.90system
samples % image name symbol name
608 9.6738 vmlinux shrink_dcache_parent
293 4.6619 vmlinux copy_page_c
271 4.3119 vmlinux copy_page_range
257 4.0891 udevd udev_rules_iter_next
After:
0.31user 0.67system
samples % image name symbol name
361 5.0419 vmlinux copy_page_range
322 4.4972 udevd udev_rules_iter_next
300 4.1899 vmlinux copy_page_c
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>