linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Yang Shi <yang.shi@linux.alibaba.com>,
	Arnd Bergmann <arnd@arndb.de>,
	chuhu@redhat.com
Subject: Re: [PATCH v2 2/2] debugobjects: Disable lockdep tracking of debugobjects internal locks
Date: Tue, 25 Sep 2018 12:20:05 -0400	[thread overview]
Message-ID: <e3275861-6fbe-70c6-c005-2bfe80cbba0b@redhat.com> (raw)
In-Reply-To: <20180925153241.GD29985@hirez.programming.kicks-ass.net>

On 09/25/2018 11:32 AM, Peter Zijlstra wrote:
> On Tue, Sep 25, 2018 at 10:41:09AM -0400, Waiman Long wrote:
>> diff --git a/lib/debugobjects.c b/lib/debugobjects.c
>> index 70935ed91125..68d72ed9ca22 100644
>> --- a/lib/debugobjects.c
>> +++ b/lib/debugobjects.c
>> @@ -1106,8 +1106,15 @@ void __init debug_objects_early_init(void)
>>  {
>>  	int i;
>>  
>> -	for (i = 0; i < ODEBUG_HASH_SIZE; i++)
>> +	/*
>> +	 * We don't need lockdep to verify correctness of debugobjects
>> +	 * internal locks.
>> +	 */
>> +	lockdep_set_novalidate_class(&pool_lock);
>> +	for (i = 0; i < ODEBUG_HASH_SIZE; i++) {
>>  		raw_spin_lock_init(&obj_hash[i].lock);
>> +		lockdep_set_novalidate_class(&obj_hash[i].lock);
>> +	}
>>  
>>  	for (i = 0; i < ODEBUG_POOL_SIZE; i++)
>>  		hlist_add_head(&obj_static_pool[i].node, &obj_pool);
> NAK, we do not _EVER_ set novalidate if it can at all be avoided.
>
> If there is a severe performance problem with lockdep, try and cure
> that. But really, who runs lockdep kernels on 8 sockets?

We do. It is part of our testing process to run both production and
debug kernels on a variety of different machines to see if anything
breaks. Some of them just happen to be 8-socket systems.

The internal locks in the debugobjects code don't interact with other
locks at all as memory allocation isn't called with those lock held. So
disabling lockdep for those locks won't materially affect the accuracy
of the lockdep code.

How about the ability to declare a class of locks as terminal in the
sense that no further lock acquisition is allowed while holding a
terminal lock? That will allow the the lockdep code to fast track the
handling of those locks and hopefully prevent hard lockup problem like that.

Cheers,
Longman





  reply	other threads:[~2018-09-25 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 14:41 [PATCH v2 0/2] debugobjects: Fix potential hard lockup by disabling lockdep Waiman Long
2018-09-25 14:41 ` [PATCH v2 1/2] locking/lockdep: Don't warn class/lock name mismatch for novalidate class Waiman Long
2018-09-25 14:41 ` [PATCH v2 2/2] debugobjects: Disable lockdep tracking of debugobjects internal locks Waiman Long
2018-09-25 15:32   ` Peter Zijlstra
2018-09-25 16:20     ` Waiman Long [this message]
2018-09-25 16:31       ` Peter Zijlstra
2018-09-25 16:36         ` Waiman Long
2018-09-28 18:33           ` Waiman Long

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=e3275861-6fbe-70c6-c005-2bfe80cbba0b@redhat.com \
    --to=longman@redhat.com \
    --cc=arnd@arndb.de \
    --cc=chuhu@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    --cc=yang.shi@linux.alibaba.com \
    /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;
as well as URLs for NNTP newsgroup(s).