From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965433AbbBCNOk (ORCPT ); Tue, 3 Feb 2015 08:14:40 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59997 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932286AbbBCNOi (ORCPT ); Tue, 3 Feb 2015 08:14:38 -0500 Date: Tue, 3 Feb 2015 14:14:37 +0100 From: Michal Hocko To: pasi.sjoholm@jolla.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pasi =?iso-8859-1?Q?Sj=F6holm?= Subject: Re: [PATCH] mm/swapfile.c: use spin_lock_bh with swap_lock to avoid deadlocks Message-ID: <20150203131437.GA8914@dhcp22.suse.cz> References: <1422894328-23051-1-git-send-email-pasi.sjoholm@jolla.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1422894328-23051-1-git-send-email-pasi.sjoholm@jolla.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 02-02-15 18:25:28, pasi.sjoholm@jolla.com wrote: > From: Pasi Sjöholm > > 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 > [] (unwind_backtrace+0x0/0x11c) from [] (do_raw_spin_lock+0x48/0x154) > [] (do_raw_spin_lock+0x48/0x154) from [] (si_swapinfo+0x10/0x90) > [] (si_swapinfo+0x10/0x90) from [] (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