Re: [PATCHv4 17/17] writeback: lessen sync_supers wakeup count

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nick Piggin
Date: Thursday, May 27, 2010 - 8:44 am

On Thu, May 27, 2010 at 06:21:33PM +0300, Artem Bityutskiy wrote:

Well your previous code had the same issue (ie. it could loop again
in sync_supers). But fair point perhaps.

But we cannot do the above, because again the timer might go off
before we set current state. We'd lose the wakeup and never wake
up again.

Putting it inside set_current_state() should be OK. I suppose.



Oh sure, get rid of the "(below)"

 

It's a bit tricky. spin_lock only gives an acquire barrier, which
prevents CPU executing instructions inside the critical section
before acquiring the lock. It actually allows stores to be deferred
from becoming visible to other CPUs until inside the critical section.
So the load of sb->s_dirty could indeed still happen before the
store is seen.

Locks do allow you to avoid thinking about barriers, but *only* when
all memory accesses to all shared variables are inside the locks
(or when a section has just a single access, which by definition don't
need ordering with another access).

 

Sure.

 

I'm not concerned. You contributed more to the idea+implementation,
so record yourself as author.

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

Messages in current thread:
[PATCHv4 00/17] kill unnecessary SB sync wake-ups, Artem Bityutskiy, (Tue May 25, 6:48 am)
[PATCHv4 01/17] VFS: introduce helpers for the s_dirty flag, Artem Bityutskiy, (Tue May 25, 6:48 am)
[PATCHv4 02/17] AFFS: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:48 am)
[PATCHv4 04/17] BTRFS: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:48 am)
[PATCHv4 05/17] EXOFS: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 06/17] EXT2: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 07/17] EXT4: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 08/17] FAT: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 09/17] HFS: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 10/17] HFSPLUS: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 11/17] JFFS2: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 12/17] reiserfs: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 13/17] SYSV: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 14/17] UDF: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 15/17] UFS: do not manipulate s_dirt directly, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 16/17] VFS: rename s_dirt to s_dirty, Artem Bityutskiy, (Tue May 25, 6:49 am)
[PATCHv4 17/17] writeback: lessen sync_supers wakeup count, Artem Bityutskiy, (Tue May 25, 6:49 am)
Re: [PATCHv4 17/17] writeback: lessen sync_supers wakeup count, Nick Piggin, (Thu May 27, 8:44 am)
Re: [PATCHv4 01/17] VFS: introduce helpers for the s_dirty ..., Artem Bityutskiy, (Sat May 29, 12:59 am)