From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from castle.nmd.msu.ru (castle.nmd.msu.ru [193.232.112.53]) by kvack.org (8.8.7/8.8.7) with SMTP id EAA11222 for ; Sat, 9 Jan 1999 04:43:30 -0500 Message-ID: <19990109124304.C26523@castle.nmd.msu.ru> Date: Sat, 9 Jan 1999 12:43:04 +0300 From: Savochkin Andrey Vladimirovich Subject: MM deadlock [was: Re: arca-vm-8...] References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: ; from "Linus Torvalds" on Thu, Jan 07, 1999 at 02:57:34PM Sender: owner-linux-mm@kvack.org To: Linus Torvalds Cc: Andrea Arcangeli , steve@netplus.net, "Eric W. Biederman" , brent verner , "Garst R. Reese" , Kalle Andersson , Zlatko Calusic , Ben McCann , Alan Cox , bredelin@ucsd.edu, "Stephen C. Tweedie" , linux-kernel@vger.rutgers.edu, Rik van Riel , linux-mm@kvack.org List-ID: Hi, I've found an another deadlock. Two processes were locked trying to grab an inode write semaphore. Their call traces are (in diff format): Using `map-2.2.0pre5-1' to map addresses to symbols. Trace: c010f038 <__down+58/90> Trace: c018d080 <__down_failed+8/c> Trace: c011abaa Trace: c011acad Trace: c011e2ae Trace: c011e45a Trace: c011e521 Trace: c011e60b Trace: c011e75b Trace: c011ef61 <__get_free_pages+b5/1dc> -Trace: c0119cd7 -Trace: c011a970 -Trace: c0118888 -Trace: c01189e4 +Trace: c0118375 +Trace: c0118a3a Trace: c010ce9f I suspect that one of the processes grabbed the semaphore and then deadlocked trying to do it again. Probably the process invoked write() with the data having been swapped out. The page fault handler tried to free some memory and try_to_free_pages decided to write out dirty pages of a shared mapping. By accident the dirty pages happened to belong to the file the process had started to write to. A simple solution will be to check if the inode semaphore is held before trying to write pages out and skip the mapping if it is. However it doesn't seem to be a very good solution because if the most memory is occupied by dirty pages of a shared mapping then writing the pages out is the most right thing to do. Best wishes Andrey V. Savochkin On Thu, Jan 07, 1999 at 02:57:34PM -0800, Linus Torvalds wrote: [snip] > Confirmed. Hpa was good enough to reproduce this, and my debugging code > caught the (fairly deep) deadlock: > > system_call -> > sys_write -> > ext2_file_write -> > ext2_getblk -> > ext2_alloc_block -> ** gets superblock lock ** > ext2_new_block -> > getblk -> > refill_freelist -> > grow_buffers -> > __get_free_pages -> > try_to_free_pages -> > swap_out -> > swap_out_process -> > swap_out_vma -> > try_to_swap_out -> > filemap_swapout -> > filemap_write_page -> > ext2_file_write -> > ext2_getblk -> > ext2_alloc_block -> > __wait_on_super ** BOOM - we want the superblock lock again ** -- This is a majordomo managed list. To unsubscribe, send a message with the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org