LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: pasi.sjoholm@jolla.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Pasi Sjöholm" <pasi.sjoholm@jollamobile.com>
Subject: Re: [PATCH] mm/swapfile.c: use spin_lock_bh with swap_lock to avoid deadlocks
Date: Tue, 3 Feb 2015 14:14:37 +0100	[thread overview]
Message-ID: <20150203131437.GA8914@dhcp22.suse.cz> (raw)
In-Reply-To: <1422894328-23051-1-git-send-email-pasi.sjoholm@jolla.com>

On Mon 02-02-15 18:25:28, pasi.sjoholm@jolla.com wrote:
> From: Pasi Sjöholm <pasi.sjoholm@jollamobile.com>
> 
> It is possible to get kernel in deadlock-state if swap_lock is not locked
> with spin_lock_bh by calling si_swapinfo() simultaneously through
> timer_function and registered vm shinker callback-function.
> 
> BUG: spinlock recursion on CPU#0, main/2447
> lock: swap_lock+0x0/0x10, .magic: dead4ead, .owner: main/2447, .owner_cpu: 0
> [<c010b938>] (unwind_backtrace+0x0/0x11c) from [<c03e9be0>] (do_raw_spin_lock+0x48/0x154)
> [<c03e9be0>] (do_raw_spin_lock+0x48/0x154) from [<c0226e10>] (si_swapinfo+0x10/0x90)
> [<c0226e10>] (si_swapinfo+0x10/0x90) from [<c04d7e18>] (timer_function+0x24/0x258)

Who is calling si_swapinfo from timer_function? AFAICS the vanilla
kernel doesn't do that. Or am I missing something?
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2015-02-03 13:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 16:25 pasi.sjoholm
2015-02-03 13:14 ` Michal Hocko [this message]
2015-02-03 23:48   ` Pasi Sjöholm
2015-02-04 12:26     ` Michal Hocko

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=20150203131437.GA8914@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasi.sjoholm@jolla.com \
    --cc=pasi.sjoholm@jollamobile.com \
    --subject='Re: [PATCH] mm/swapfile.c: use spin_lock_bh with swap_lock to avoid deadlocks' \
    /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

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).