From: Sasha Levin <sasha.levin@oracle.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: mingo@redhat.com, peterz@infradead.org, paulus@samba.org,
acme@ghostprotocols.net, penberg@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] liblock: public headers for mutex implementation
Date: Fri, 01 Feb 2013 09:20:25 -0500 [thread overview]
Message-ID: <510BCF29.7000104@oracle.com> (raw)
In-Reply-To: <20130201095701.GA23061@gmail.com>
On 02/01/2013 04:57 AM, Ingo Molnar wrote:
>
> * Sasha Levin <sasha.levin@oracle.com> wrote:
>
>> These headers provide the same API as their pthread mutex counterparts.
>>
>> The design here is to allow to easily switch to liblock lock validation
>> just by adding a "liblock_" to pthread_mutex_*() calls, which means that
>> it's easy to integrate liblock into existing codebases.
>
> I'd suggest to name the user-space counterpart 'liblockdep', to
> make it clear that this is user-space lockdep.
Agreed. Pekka also mentioned that liblock sounds to much like lib-block, so
renaming it to liblockdep will take care of that :)
> Regarding pthread_mutex_t checking, I think what we *really*
> want is a wrapper that can be activated via:
>
> #define __USE_LIBLOCKDEP
>
> And which then takes over the pthread primitives via:
>
> #define pthread_mutex_lock liblockdep_pthread_mutex_lock
>
> or so.
>
> That way the source code only needs a __USE_LIBLOCKDEP in one or
> two key places and checking is activated.
There are 2 issues I see with that:
- api calls which are liblockdep specific (liblockdep_init() for example) would
still have to be wrapped somehow in the new code.
- LIBLOCKDEP_PTHREAD_MUTEX_INIT(mtx) doesn't only change the name of the original
pthread mutex initializer, it also starts requiring the mutex name as parameter so
that it could pass it on to lockdep.
Dealing with these two will mean that there's a '#ifdef __USE_LIBLOCKDEP' both in
the lib and in the source code that uses it, which might be a bit confusing.
Either way, I'll resend the patch with these changes so we'll have a better view
of how it would look.
Thanks,
Sasha
next prev parent reply other threads:[~2013-02-01 14:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 4:47 [PATCH 0/7] liblock: userspace lockdep Sasha Levin
2013-02-01 4:47 ` [PATCH 1/7] liblock: wrap kernel/lockdep.c to allow usage from userspace Sasha Levin
2013-02-01 4:47 ` [PATCH 2/7] liblock: public headers for mutex implementation Sasha Levin
2013-02-01 9:57 ` Ingo Molnar
2013-02-01 14:20 ` Sasha Levin [this message]
2013-02-01 4:47 ` [PATCH 3/7] liblock: mutex test suite Sasha Levin
2013-02-01 4:47 ` [PATCH 4/7] liblock: public headers for rwlock implementation Sasha Levin
2013-02-01 4:47 ` [PATCH 5/7] liblock: rwlock test suite Sasha Levin
2013-02-01 4:47 ` [PATCH 6/7] liblock: add a MAINTAINERS entry Sasha Levin
2013-02-01 4:47 ` [PATCH 7/7] perf: integrate liblock support into perf Sasha Levin
2013-02-01 7:35 ` [PATCH 0/7] liblock: userspace lockdep Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=510BCF29.7000104@oracle.com \
--to=sasha.levin@oracle.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=penberg@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.