On Wednesday 29 December 2010 15:42:36 Hillf Danton wrote:
Most of the file systems are for compatibility with other operating systems.
The ones that duplicate Linux-only functionality are there in order to provide
backwards-compatibility with existing users. We can't remove them in the
same way that we would remove code that is only used in the kernel itself.
There are more of these, and they partly exist because it has been hard
to change all the old users. We did remove some others though.
These two are subtly different, timers are optimized for not expiring, while
hrtimer is optimized for actually expiring.
That could be changed using the C implementation everywhere,
but there are other problems.
There are three classes of semaphore users today:
1. Those that initialize the semaphore to >1, guarding access to a
resource that has multiple users: acpi/osl, mthca, mlx4, megaraid,
comedi/vmk80xx, udlfb, usblc, usb-skeleton, blizzard, hwa742, and 9p.
2. Those that use the semaphore as some sort of completion, or a combination
of completion and mutex.
3. Those that can and should be converted to mutex: most of the staging
drivers, plus some more.
IMHO it would be nice to separate the first two classes in some way, so we
can make the counting semaphores stricter and apply the same rules as
mutexes and make the completion-like semaphores non-counting.
There is currently no mutex_lock_timeout(), so that would be meaningless.
Doing this would be extremely inefficient, because now the mutex wait
function would wake up very frequently instead of just once when the
mutex has been released by another thread.
Arnd
--