From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: single-threaded wq lockdep is broken
Date: Tue, 13 Jun 2017 12:06:16 -0400 [thread overview]
Message-ID: <20170613160616.GE28327@htj.duckdns.org> (raw)
In-Reply-To: <1495999993.3578.1.camel@sipsolutions.net>
Hello,
Johannes reported that lockdep warning on single threaded workqueues
doesn't work anymore. Nothing really changed there and all the
relevant lockdep annotaitons are being invoked correctly. The
following is the extracted lockdep-only reproducer.
The culprit seems to be lock_map_acquire_read() being mapped to
lock_map_acquire_shared_recursive() instead of
lock_map_acquire_shared(). Is the following expected to not trigger
lockdep warning? Should workqueue be using
rwsem_acquire[_read]/release() instead of lock_map*()?
Thanks.
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/module.h>
DEFINE_MUTEX(mtx);
static int init(void)
{
static struct lock_class_key key;
struct lockdep_map *map;
printk("XXX lockdep test start\n");
map = kzalloc(sizeof(*map), GFP_KERNEL);
lockdep_init_map(map, "test_map", &key, 0);
mutex_lock(&mtx);
lock_map_acquire(map);
lock_map_release(map);
mutex_unlock(&mtx);
lock_map_acquire_read(map);
mutex_lock(&mtx);
mutex_unlock(&mtx);
lock_map_release(map);
printk("XXX lockdep test end\n");
return 0;
}
module_init(init);
prev parent reply other threads:[~2017-06-13 16:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-28 19:33 Johannes Berg
2017-05-31 8:34 ` Lai Jiangshan
2017-05-31 8:36 ` Johannes Berg
2017-05-31 8:47 ` Johannes Berg
2017-06-02 7:03 ` Lai Jiangshan
2017-06-02 8:51 ` Johannes Berg
2017-05-31 18:19 ` Tejun Heo
2017-05-31 19:15 ` Johannes Berg
2017-06-13 16:06 ` Tejun Heo [this message]
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=20170613160616.GE28327@htj.duckdns.org \
--to=tj@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®