All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>,
	Maciej Rutecki <maciej.rutecki@gmail.com>,
	Alexander Beregalov <a.beregalov@gmail.com>,
	Alexander Viro <viro@ftp.linux.org.uk>
Subject: Re: [Bug #15805] reiserfs locking
Date: Sat, 10 Jul 2010 10:24:28 -0700	[thread overview]
Message-ID: <AANLkTimvtvrQuIPCZwzPNgVqGWTecay5RktRzBgcf4fu@mail.gmail.com> (raw)
In-Reply-To: <20100710070650.GA16248@elte.hu>

On Sat, Jul 10, 2010 at 12:06 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> Since it's a reproducible deadlock maybe the fix should go upstream faster
> than v2.6.36?

As far as I know, it's only a lockdep warning, not an actual deadlock.
And it's in a class of lockdep warnings that we've had for a long
time, and has never actually triggered as a read deadlock afaik.

I also don't think it's a new warning - or at least I don't see why it
would have started triggering after 2.6.34.

My preferred fix in many ways would be to make the locking in the VM
layer less incestuous. For example, we could fairly easily move the
final

  if (vma->vm_file)
    fput(vma->vm_file);

outside the actual mmap_sem lock (well, "fairly easily" here means
keeping the list of free'd vmas around for longer, probably in the
task_struct thing, and then replacing all the
"up_write(&mm->mmap_sem)" things with a "unlock_mm(mm)" looking
something like

  static void unlock_mm(struct mm_struct *mm)
  {
    struct vm_area_struct *vma_list = current->vma_to_free;
    if (vma_list)
      current->vma_to_free = NULL;
    up_write(&mm->mmap_sem);
    while (vma_list) {
      struct vm_area_struct *vma = vma_list;
      vma_list = vma_list->next;
      fput(vma_list->vm_file);
      kmem_cache_free(vm_area_cachep, vma);
    }
  }

which would fairly trivially delay the actual 'fput()' to after we
hold no locks.

I dunno if it's really worth it, but it doesn't look all that
complicated, and it would avoid at least _some_ lock dependencies.

                     Linus

                     Linus

WARNING: multiple messages have this Message-ID (diff)
From: Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
Cc: Frederic Weisbecker
	<fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Kernel Testers List
	<kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Maciej Rutecki
	<maciej.rutecki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexander Beregalov
	<a.beregalov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexander Viro <viro-rfM+Q5joDG/XmaaqVzeoHQ@public.gmane.org>
Subject: Re: [Bug #15805] reiserfs locking
Date: Sat, 10 Jul 2010 10:24:28 -0700	[thread overview]
Message-ID: <AANLkTimvtvrQuIPCZwzPNgVqGWTecay5RktRzBgcf4fu@mail.gmail.com> (raw)
In-Reply-To: <20100710070650.GA16248-X9Un+BFzKDI@public.gmane.org>

On Sat, Jul 10, 2010 at 12:06 AM, Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:
>
> Since it's a reproducible deadlock maybe the fix should go upstream faster
> than v2.6.36?

As far as I know, it's only a lockdep warning, not an actual deadlock.
And it's in a class of lockdep warnings that we've had for a long
time, and has never actually triggered as a read deadlock afaik.

I also don't think it's a new warning - or at least I don't see why it
would have started triggering after 2.6.34.

My preferred fix in many ways would be to make the locking in the VM
layer less incestuous. For example, we could fairly easily move the
final

  if (vma->vm_file)
    fput(vma->vm_file);

outside the actual mmap_sem lock (well, "fairly easily" here means
keeping the list of free'd vmas around for longer, probably in the
task_struct thing, and then replacing all the
"up_write(&mm->mmap_sem)" things with a "unlock_mm(mm)" looking
something like

  static void unlock_mm(struct mm_struct *mm)
  {
    struct vm_area_struct *vma_list = current->vma_to_free;
    if (vma_list)
      current->vma_to_free = NULL;
    up_write(&mm->mmap_sem);
    while (vma_list) {
      struct vm_area_struct *vma = vma_list;
      vma_list = vma_list->next;
      fput(vma_list->vm_file);
      kmem_cache_free(vm_area_cachep, vma);
    }
  }

which would fairly trivially delay the actual 'fput()' to after we
hold no locks.

I dunno if it's really worth it, but it doesn't look all that
complicated, and it would avoid at least _some_ lock dependencies.

                     Linus

                     Linus

  parent reply	other threads:[~2010-07-10 17:25 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-10  0:24 2.6.35-rc4-git4: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-07-10  0:24 ` Rafael J. Wysocki
2010-07-10  0:25 ` [Bug #15664] Graphics hang and kernel backtrace when starting Azureus with Compiz enabled Rafael J. Wysocki
2010-07-10  0:25   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #15805] reiserfs locking Rafael J. Wysocki
2010-07-10  1:45   ` Frederic Weisbecker
2010-07-10  7:06     ` Ingo Molnar
2010-07-10  7:06       ` Ingo Molnar
2010-07-10 13:56       ` Frederic Weisbecker
2010-07-10 13:56         ` Frederic Weisbecker
2010-07-10 17:24       ` Linus Torvalds [this message]
2010-07-10 17:24         ` Linus Torvalds
2010-07-10  0:33 ` [Bug #15977] WARNING: at lib/dma-debug.c:866 check_for_stack Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #15673] 2.6.34-rc2: "ima_dec_counts: open/free imbalance"? Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  8:41   ` Thomas Meyer
2010-07-10 12:56     ` Rafael J. Wysocki
2010-07-10 12:56       ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #15862] 2.6.34-rc4/5: iwlagn unusable until reload Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #15912] Audio/video sync and crackling issues with snd-hda-intel (AD1981 codec) Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #15704] [r8169] WARNING: at net/sched/sch_generic.c Rafael J. Wysocki
2010-07-10  9:52   ` Sergey Senozhatsky
2010-07-10  9:52     ` Sergey Senozhatsky
2010-07-10 12:59     ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16007] x86/pci Oops with CONFIG_SND_HDA_INTEL Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16035] Incorrect initial resolution of (external) vga monitor with KMS Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16050] The ibmcam driver is not working Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16097] 2.6.34 on Samsung P460: reset after "Waiting for /dev to be fully populated" Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16137] Ooops in BTRFS in 2.6.34 / x86_64 when mounting subvolume by name Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16082] host panic on kernel 2.6.34 Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16170] Leadtek Winfast DTV Dongle (STK7700P based) is not working in 2.6.34 Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16158] winxp guest hangs after idle for ~30 minutes Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16139] wait_even_interruptible_timeout(), signal, spin_lock() = system hang Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16206] PROBLEM: PPP and other serial port related application hangs in kernel space Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16233] Fwd: [2.6.34] INFO: task rsync:20019 blocked for more than 120 seconds Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16207] Suspend and VT switch hangs since 2.6.34 Rafael J. Wysocki
2010-07-12 16:20   ` Jesse Barnes
2010-07-12 16:20     ` Jesse Barnes
2010-07-12 19:08     ` Tino Keitel
2010-07-10  0:33 ` [Bug #16300] [2.6.34 regression] mplayer gets out of sync due to problems with ALSA Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16270] Image is a hit-or-a-miss. Often displayed green+purple Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16348] kswapd continuously active when doing IO Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16320] iwl3945 crashes, seems to be disconnecting from the PCI bus Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16318] macbook pro 5,1 does not boot with acpi Rafael J. Wysocki
2010-07-10  0:33   ` Rafael J. Wysocki
2010-07-10  0:33 ` [Bug #16357] acpi-cpufreq fails to load (No such device) Rafael J. Wysocki
2010-07-10  3:06 ` 2.6.35-rc4-git4: Reported regressions 2.6.33 -> 2.6.34 Luis R. Rodriguez
  -- strict thread matches above, loose matches on Subject: below --
2010-06-20 22:32 2.6.35-rc3: " Rafael J. Wysocki
2010-06-20 22:34 ` [Bug #15805] reiserfs locking Rafael J. Wysocki
2010-06-20 22:34   ` Rafael J. Wysocki
2010-06-13 14:45 2.6.35-rc3: Reported regressions 2.6.33 -> 2.6.34 Rafael J. Wysocki
2010-06-13 14:48 ` [Bug #15805] reiserfs locking Rafael J. Wysocki
2010-05-09 21:13 2.6.34-rc6-git6: Reported regressions from 2.6.33 Rafael J. Wysocki
2010-05-09 21:17 ` [Bug #15805] reiserfs locking Rafael J. Wysocki
2010-05-09 22:10   ` Frederic Weisbecker
2010-05-09 22:10     ` Frederic Weisbecker
2010-05-04 20:49 2.6.34-rc6-git2: Reported regressions from 2.6.33 Rafael J. Wysocki
2010-05-04 21:21 ` [Bug #15805] reiserfs locking Rafael J. Wysocki
2010-04-20  3:15 2.6.34-rc5: Reported regressions from 2.6.33 Rafael J. Wysocki
2010-04-20  3:19 ` [Bug #15805] reiserfs locking Rafael J. Wysocki
2010-04-20  3:19   ` Rafael J. Wysocki
2010-04-22  2:52   ` Frederic Weisbecker
2010-04-22  2:52     ` Frederic Weisbecker
2010-04-18  7:11 [Bug 15805] New: " bugzilla-daemon
2010-04-18  7:11 ` [Bug 15805] " bugzilla-daemon
2010-04-20  3:40 ` bugzilla-daemon
2010-06-13 12:16 ` bugzilla-daemon
2010-07-10 13:02 ` bugzilla-daemon
2010-07-10 13:02 ` bugzilla-daemon
2010-07-10 13:03 ` bugzilla-daemon

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=AANLkTimvtvrQuIPCZwzPNgVqGWTecay5RktRzBgcf4fu@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=a.beregalov@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=viro@ftp.linux.org.uk \
    /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.