public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: linux-kernel@vger.kernel.org, h.mitake@gmail.com,
	Dmitry Torokhov <dtor@mail.ru>, Vojtech Pavlik <vojtech@ucw.cz>,
	Ingo Molnar <mingo@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH v2] lockdep: check the depth of subclass
Date: Wed, 13 Oct 2010 10:48:29 +0200	[thread overview]
Message-ID: <1286959709.29097.124.camel@twins> (raw)
In-Reply-To: <1286958626-986-1-git-send-email-mitake@dcl.info.waseda.ac.jp>

On Wed, 2010-10-13 at 17:30 +0900, Hitoshi Mitake wrote:
> Current look_up_lock_class() doesn't check the parameter "subclass".
> This rarely rises problems because the main caller of this function,
> register_lock_class(), checks it.
> But register_lock_class() is not the only function which calls
> look_up_lock_class(). lock_set_class() and its callees also call it.
> And lock_set_class() doesn't check this parameter.
> 
> This will rise problems when the the value of subclass is larger than
> MAX_LOCKDEP_SUBCLASSES. Because the address (used as the key of class)
> caliculated with too large subclass has a possibility to point
> another key in different lock_class_key.
> Of course this problem depends on the memory layout and
> occurs with really low possibility.
> 
> And mousedev_create() calles lockdep_set_subclass() and
> sets class of mousedev->mutex as MOUSEDEV_MIX(== 31).
> And if my understanding is correct,
> this subclass doesn't have to be MOUSEDEV_MIX,
> so I modified this value to SINGLE_DEPTH_NESTING.
> 
> v2: Based on Peter Zijlstra's advice, I removed the
> checking of the subclass value from __lock_acquire().
> Because this is already a redundant thing.
> 
> # If you need devided version for mousedev.c and lockdep.c,
> # feel free to tell me.

I've taken the patch without the mousedev hunk, as Dmitry said he'd take
that.

Thanks!

  reply	other threads:[~2010-10-13  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  9:01 [PATCH 1/2] lockdep: check the depth of subclass Hitoshi Mitake
2010-10-05  9:01 ` [RFC PATCH 2/2] lockdep: caching subclasses Hitoshi Mitake
2010-10-12 10:36   ` Peter Zijlstra
2010-10-18 19:17   ` [tip:core/locking] lockdep: Add improved subclass caching tip-bot for Hitoshi Mitake
2010-10-12 10:27 ` [PATCH 1/2] lockdep: check the depth of subclass Peter Zijlstra
2010-10-12 16:03   ` Dmitry Torokhov
2010-10-13  2:27     ` Hitoshi Mitake
2010-10-13 18:18       ` Dmitry Torokhov
2010-10-13  2:26   ` Hitoshi Mitake
2010-10-13  7:33     ` Peter Zijlstra
2010-10-13  8:13       ` Hitoshi Mitake
2010-10-13  8:30         ` [PATCH v2] " Hitoshi Mitake
2010-10-13  8:48           ` Peter Zijlstra [this message]
2010-10-18 19:17           ` [tip:core/locking] lockdep: Check " tip-bot for Hitoshi Mitake

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=1286959709.29097.124.camel@twins \
    --to=peterz@infradead.org \
    --cc=dtor@mail.ru \
    --cc=fweisbec@gmail.com \
    --cc=h.mitake@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --cc=vojtech@ucw.cz \
    /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