2004-03-06 00:40:24

by Daniel McNeil

[permalink] [raw]
Subject: [PATCH 2.6.3-mm4] writeback trylock patch

Andrew,

Here is update to the wb_rwsema patch that adds back the trylock.
It avoids the hang hugh was seeing by setting encountered_congestion
if the trylock fails and checking it in sync_sb_inodes(). Hugh
tested this and did not see the hang.

This prevents non-sync writebacks to from blocking behind sync
writebacks.

This patch applies to 2.6.4-rc1-mm2.

Thoguhts?

Daniel


Attachments:
263-mm4.writeback.trylock.patch (1.83 kB)

2004-03-06 01:01:21

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 2.6.3-mm4] writeback trylock patch

Daniel McNeil <[email protected]> wrote:
>
> Here is update to the wb_rwsema patch that adds back the trylock.
> It avoids the hang hugh was seeing by setting encountered_congestion
> if the trylock fails and checking it in sync_sb_inodes(). Hugh
> tested this and did not see the hang.
>
> This prevents non-sync writebacks to from blocking behind sync
> writebacks.
>
> This patch applies to 2.6.4-rc1-mm2.
>
> Thoguhts?

spose so. One concern is with writer throttling: if the caller of write(2)
is simply skipping a large file then it should throttle in
balance_dirty_pages() or block on i_sem I guess. This code is getting
pretty sticky.

Why are you setting wbc->encountered_congestion in sync_sb_inodes()?

And why are you doing a trylock in __filemap_fdatawrite()? That only
affects fadvise(), and probably we want to block in there anyway. It
doesn't matter really but less code is better code.