Re: [PATCH] Memory management livelock

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Nick Piggin <nickpiggin@...>, <linux-kernel@...>, <agk@...>, <mbroz@...>, <chris@...>
Date: Friday, October 3, 2008 - 7:43 am

On Thu, 2 Oct 2008, Andrew Morton wrote:


That filemap_fdatawrite and filemap_fdatawait in fsync() aren't really 
called under i_mutex (see do_fsync).

So the possible solutions are:

1. Add jiffies when the page was diried and wroteback to struct page
+ no impact on locking and concurrency
- increases the structure by 8 bytes

2. Stop the writers when the starvation happens (what I did)
+ doesn't do any locking if the livelock doesn't happen
- locks writers when the livelock happens (I think it's not really serious 
--- because very few people complained about the livelock, very few people 
will see performance degradation from blocking the writers).

3. Add another bit to radix tree (what Nick did)
+ doesn't ever block writers
- unconditionally takes the lock on fsync path and serializates concurrent 
syncs/fsyncs. Probably low overhead too ... or I don't know, is there any 
possible situation when more processes execute sync() in parallel and user 
would see degradations if those syncs were serialized?

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

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