Skip to contentSkip to conversation

2.6.23-rc7-mm1: r/o mounts joke with lockdep

DISCUSSION Alexey Dobriyan 3 participants 3 messages Sep 24, 2007

lore
Share & tools
lore
#0 lore raw

static void lock_and_coalesce_cpu_mnt_writer_counts(void)

{
	int cpu;
	struct mnt_writer *cpu_writer;

	for_each_possible_cpu(cpu) {
		cpu_writer = &per_cpu(mnt_writers, cpu);
		spin_lock_nested(&cpu_writer->lock, 42);
		                                   ^^^^

What the heck is going on? Given that MAX_LOCKDEP_SUBCLASSES is only 8, this reliably turns off lockdep at boot.

#1 lore raw
Quoted 11 lines · On Mon, 24 Sep 2007 13:51:05 +0400 Alexey Dobriyan <[email protected]> wrote:

static void lock_and_coalesce_cpu_mnt_writer_counts(void)

{
	int cpu;
	struct mnt_writer *cpu_writer;

	for_each_possible_cpu(cpu) {
		cpu_writer = &per_cpu(mnt_writers, cpu);
		spin_lock_nested(&cpu_writer->lock, 42);
		                                   ^^^^

What the heck is going on?

that was some random 2:00AM hack by me to make the warnings go away.

Quoted 2 lines

Given that MAX_LOCKDEP_SUBCLASSES is only 8,
this reliably turns off lockdep at boot.

that explains why it worked so well.

#2 lore raw
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Mon, 24 Sep 2007 13:51:05 +0400 Alexey Dobriyan <[email protected]> wrote:

static void lock_and_coalesce_cpu_mnt_writer_counts(void)

{
	int cpu;
	struct mnt_writer *cpu_writer;

	for_each_possible_cpu(cpu) {
		cpu_writer = &per_cpu(mnt_writers, cpu);
		spin_lock_nested(&cpu_writer->lock, 42);
		                                   ^^^^
Quoted 8 lines
Quoted 1 line

What the heck is going on?

that was some random 2:00AM hack by me to make the warnings go away.

Quoted 2 lines

Given that MAX_LOCKDEP_SUBCLASSES is only 8,
this reliably turns off lockdep at boot.

that explains why it worked so well.

Arjan gave me some ideas on how to fix this more properly. I'm trying to reproduce it and working on a patch now.

-- Dave