Re: [PATCH 2/3] Fix fsync livelock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mikulas Patocka
Date: Monday, October 6, 2008 - 1:44 pm

On Mon, 6 Oct 2008, Arjan van de Ven wrote:


If you add a list to an inode, you need to protect it with a spinlock. So 
you take one more spinlock for any write bio submitted --- a lot of 
developers would hate it.

Another problem: how do you want to walk all dirty pages and submit bio 
for them?

The act of allocating and submission of bio can block (if you run out of 
some mempool) and in this case it wait until some other bio is finished. 
During this time, more dirty pages can be created.

Also, if you find a page that is both dirty and under writeback, you need 
to wait until a writeback finishes and then initiate another writeback 
(because the old writeback may be writing stale data). You again, block, 
and more dirty pages can appear.

And if you block and more dirty pages appear, you are prone to the 
livelock.

[ In Nick Piggin's patch, it is needed to lock the whole address space, 
mark dirty pages in one non-blocking pass and write marked pages again in 
a blocking pass --- so that if more dirty pages appear while bios are 
submitted, the new pages will be skipped ]

Mikulas
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Memory management livelock, Mikulas Patocka, (Mon Sep 22, 2:10 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Mon Sep 22, 5:48 pm)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Tue Sep 23, 3:34 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Tue Sep 23, 3:49 pm)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Tue Sep 23, 4:11 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Tue Sep 23, 4:46 pm)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Wed Sep 24, 11:50 am)
[PATCH 1/3] Memory management livelock, Mikulas Patocka, (Wed Sep 24, 11:51 am)
[PATCH 2/3] Memory management livelock, Mikulas Patocka, (Wed Sep 24, 11:52 am)
[PATCH 3/3] Memory management livelock, Mikulas Patocka, (Wed Sep 24, 11:53 am)
Re: [PATCH 2/3] Memory management livelock, Andrew Morton, (Wed Oct 1, 10:54 pm)
Re: [PATCH] Memory management livelock, Nick Piggin, (Thu Oct 2, 7:32 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Thu Oct 2, 7:40 pm)
Re: [PATCH] Memory management livelock, Nick Piggin, (Thu Oct 2, 7:54 pm)
Re: [PATCH] Memory management livelock, Nick Piggin, (Thu Oct 2, 7:59 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Thu Oct 2, 8:14 pm)
Re: [PATCH] Memory management livelock, Nick Piggin, (Thu Oct 2, 8:47 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Thu Oct 2, 8:56 pm)
Re: [PATCH] Memory management livelock, Nick Piggin, (Thu Oct 2, 9:07 pm)
Re: [PATCH] Memory management livelock, Andrew Morton, (Thu Oct 2, 9:17 pm)
Re: [PATCH] Memory management livelock, Nick Piggin, (Thu Oct 2, 9:29 pm)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Fri Oct 3, 4:26 am)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Fri Oct 3, 4:43 am)
Re: [PATCH] Memory management livelock, Nick Piggin, (Fri Oct 3, 5:27 am)
Re: [PATCH] Memory management livelock, Nick Piggin, (Fri Oct 3, 5:31 am)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Fri Oct 3, 6:50 am)
Re: [PATCH] Memory management livelock, Mikulas Patocka, (Fri Oct 3, 6:53 am)
Re: [PATCH] Memory management livelock, Alasdair G Kergon, (Fri Oct 3, 7:36 am)
Re: [PATCH] Memory management livelock, Alasdair G Kergon, (Fri Oct 3, 7:50 am)
[PATCH 1/3] bit mutexes, Mikulas Patocka, (Sun Oct 5, 3:14 pm)
[PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Sun Oct 5, 3:14 pm)
[PATCH 3/3] Fix fsync-vs-write misbehavior, Mikulas Patocka, (Sun Oct 5, 3:16 pm)
Re: [PATCH 2/3] Fix fsync livelock, Arjan van de Ven, (Sun Oct 5, 3:33 pm)
Re: [PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Sun Oct 5, 4:02 pm)
Re: [PATCH 2/3] Fix fsync livelock, Arjan van de Ven, (Sun Oct 5, 4:07 pm)
Re: [PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Sun Oct 5, 4:18 pm)
Re: [PATCH 2/3] Fix fsync livelock, Arjan van de Ven, (Sun Oct 5, 4:28 pm)
Re: [PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Sun Oct 5, 5:01 pm)
Re: [PATCH 2/3] Fix fsync livelock, Arjan van de Ven, (Sun Oct 5, 5:30 pm)
Re: [PATCH 2/3] Fix fsync livelock, Dave Chinner, (Sun Oct 5, 7:51 pm)
Re: [PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Sun Oct 5, 8:30 pm)
Re: [PATCH 2/3] Fix fsync livelock, Arjan van de Ven, (Sun Oct 5, 9:20 pm)
Re: [PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Mon Oct 6, 6:00 am)
Re: [PATCH 2/3] Fix fsync livelock, Arjan van de Ven, (Mon Oct 6, 6:50 am)
Re: [PATCH 2/3] Fix fsync livelock, Mikulas Patocka, (Mon Oct 6, 1:44 pm)
Re: [PATCH 2/3] Fix fsync livelock, Pavel Machek, (Wed Oct 8, 3:56 am)
[PATCH] documentation: explain memory barriers, Randy Dunlap, (Wed Oct 8, 6:12 pm)
Re: [PATCH] documentation: explain memory barriers, Chris Snook, (Wed Oct 8, 6:17 pm)
Re: [PATCH] documentation: explain memory barriers, Andrew Morton, (Wed Oct 8, 6:31 pm)
Re: [PATCH] documentation: explain memory barriers, Valdis.Kletnieks, (Wed Oct 8, 6:50 pm)
Re: [PATCH] documentation: explain memory barriers, Chris Snook, (Wed Oct 8, 10:51 pm)
Re: [PATCH] documentation: explain memory barriers, Valdis.Kletnieks, (Wed Oct 8, 11:52 pm)
Re: [PATCH] documentation: explain memory barriers, Ben Hutchings, (Thu Oct 9, 2:58 am)
Re: [PATCH] documentation: explain memory barriers, Nick Piggin, (Thu Oct 9, 10:29 am)
Re: [PATCH] documentation: explain memory barriers, Nick Piggin, (Thu Oct 9, 10:35 am)
Re: [PATCH] documentation: explain memory barriers, Nick Piggin, (Thu Oct 9, 2:27 pm)