* [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt
@ 2008-08-25 15:37 Jan Kiszka
2008-08-25 16:43 ` Philippe Gerum
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2008-08-25 15:37 UTC (permalink / raw)
To: xenomai-core
Hi,
next issue on my way towards fast native mutexes: as mutexes are now
mostly acquired in user space, the recursion counter lockcnt will only
be maintained in the context of the owning thread (at best: its process)
in user space. No update on the kernel-side lockcnt will take place
anymore, thus rt_mutex_inquire can only return 0 or 1, no > 1. Is it OK
to break the ABI here?
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt
2008-08-25 15:37 [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt Jan Kiszka
@ 2008-08-25 16:43 ` Philippe Gerum
2008-08-25 16:45 ` Jan Kiszka
2008-08-25 16:51 ` Jan Kiszka
0 siblings, 2 replies; 6+ messages in thread
From: Philippe Gerum @ 2008-08-25 16:43 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> Hi,
>
> next issue on my way towards fast native mutexes: as mutexes are now
> mostly acquired in user space, the recursion counter lockcnt will only
> be maintained in the context of the owning thread (at best: its process)
> in user space. No update on the kernel-side lockcnt will take place
> anymore, thus rt_mutex_inquire can only return 0 or 1, no > 1. Is it OK
> to break the ABI here?
>
I think so, we might lose some debug information, but that's the price for much
better performances. I can't imagine any sane code iterating lockcnt-times
blindly to unlock a mutex it owns until it is free. Nah, of course not...
Btw, I guess that the /proc information about mutexes would have to be reworked
as well.
> Jan
>
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt
2008-08-25 16:43 ` Philippe Gerum
@ 2008-08-25 16:45 ` Jan Kiszka
2008-08-25 16:53 ` Philippe Gerum
2008-08-25 16:51 ` Jan Kiszka
1 sibling, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2008-08-25 16:45 UTC (permalink / raw)
To: rpm; +Cc: xenomai-core
Philippe Gerum wrote:
> Jan Kiszka wrote:
>> Hi,
>>
>> next issue on my way towards fast native mutexes: as mutexes are now
>> mostly acquired in user space, the recursion counter lockcnt will only
>> be maintained in the context of the owning thread (at best: its process)
>> in user space. No update on the kernel-side lockcnt will take place
>> anymore, thus rt_mutex_inquire can only return 0 or 1, no > 1. Is it OK
>> to break the ABI here?
>>
>
> I think so, we might lose some debug information, but that's the price for much
> better performances. I can't imagine any sane code iterating lockcnt-times
> blindly to unlock a mutex it owns until it is free. Nah, of course not...
>
> Btw, I guess that the /proc information about mutexes would have to be reworked
> as well.
Haven't looked into this yet (or haven't stumbled over any issue). What
conflict / lack of data do you have in mind here?
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt
2008-08-25 16:45 ` Jan Kiszka
@ 2008-08-25 16:53 ` Philippe Gerum
2008-08-25 16:55 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2008-08-25 16:53 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> Philippe Gerum wrote:
>> Jan Kiszka wrote:
>>> Hi,
>>>
>>> next issue on my way towards fast native mutexes: as mutexes are now
>>> mostly acquired in user space, the recursion counter lockcnt will only
>>> be maintained in the context of the owning thread (at best: its process)
>>> in user space. No update on the kernel-side lockcnt will take place
>>> anymore, thus rt_mutex_inquire can only return 0 or 1, no > 1. Is it OK
>>> to break the ABI here?
>>>
>> I think so, we might lose some debug information, but that's the price for much
>> better performances. I can't imagine any sane code iterating lockcnt-times
>> blindly to unlock a mutex it owns until it is free. Nah, of course not...
>>
>> Btw, I guess that the /proc information about mutexes would have to be reworked
>> as well.
>
> Haven't looked into this yet (or haven't stumbled over any issue). What
> conflict / lack of data do you have in mind here?
>
Basically, exporting the lock owner and the locking depth is likely no more
possible for userland optimized mutexes.
> Jan
>
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt
2008-08-25 16:53 ` Philippe Gerum
@ 2008-08-25 16:55 ` Jan Kiszka
0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2008-08-25 16:55 UTC (permalink / raw)
To: rpm; +Cc: xenomai-core
Philippe Gerum wrote:
> Jan Kiszka wrote:
>> Philippe Gerum wrote:
>>> Jan Kiszka wrote:
>>>> Hi,
>>>>
>>>> next issue on my way towards fast native mutexes: as mutexes are now
>>>> mostly acquired in user space, the recursion counter lockcnt will only
>>>> be maintained in the context of the owning thread (at best: its process)
>>>> in user space. No update on the kernel-side lockcnt will take place
>>>> anymore, thus rt_mutex_inquire can only return 0 or 1, no > 1. Is it OK
>>>> to break the ABI here?
>>>>
>>> I think so, we might lose some debug information, but that's the price for much
>>> better performances. I can't imagine any sane code iterating lockcnt-times
>>> blindly to unlock a mutex it owns until it is free. Nah, of course not...
>>>
>>> Btw, I guess that the /proc information about mutexes would have to be reworked
>>> as well.
>> Haven't looked into this yet (or haven't stumbled over any issue). What
>> conflict / lack of data do you have in mind here?
>>
>
> Basically, exporting the lock owner and the locking depth is likely no more
> possible for userland optimized mutexes.
Ah, that's also visible at that place. But the owner is still available
as userland writes its own xnthread_t into the lock variable. We just
face the same issue as with RT_MUTEX_INFO.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt
2008-08-25 16:43 ` Philippe Gerum
2008-08-25 16:45 ` Jan Kiszka
@ 2008-08-25 16:51 ` Jan Kiszka
1 sibling, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2008-08-25 16:51 UTC (permalink / raw)
To: rpm; +Cc: xenomai-core
Philippe Gerum wrote:
> Jan Kiszka wrote:
>> Hi,
>>
>> next issue on my way towards fast native mutexes: as mutexes are now
>> mostly acquired in user space, the recursion counter lockcnt will only
>> be maintained in the context of the owning thread (at best: its process)
>> in user space. No update on the kernel-side lockcnt will take place
>> anymore, thus rt_mutex_inquire can only return 0 or 1, no > 1. Is it OK
>> to break the ABI here?
>>
>
> I think so, we might lose some debug information, but that's the price for much
> better performances. I can't imagine any sane code iterating lockcnt-times
> blindly to unlock a mutex it owns until it is free. Nah, of course not...
Hmm, we could rename 'lockcnt' to 'locked' so that no one can stumble
accidentally over this change...
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-08-25 16:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-25 15:37 [Xenomai-core] Fast native mutexes vs. RT_MUTEX_INFO.lockcnt Jan Kiszka
2008-08-25 16:43 ` Philippe Gerum
2008-08-25 16:45 ` Jan Kiszka
2008-08-25 16:53 ` Philippe Gerum
2008-08-25 16:55 ` Jan Kiszka
2008-08-25 16:51 ` Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.