using writepage to start io
Quoted 7 lines · On Wednesday, August 01, 2001 04:57:35 PM +0200 Daniel Phillips…
Quoted 3 lines · Chris Mason
This has been tested a little more now, both ext2 (1k, 4k) and reiserfs. dbench and iozone testing don't show any difference, but I need to spend a little more time on the benchmarks.
It's impressive that such seemingly radical surgery on the vm innards is a) possible and b) doesn't make the system perform noticably worse.
radical surgery is always possible ;-) But, I was expecting better performance results than I got. I'm trying a few other things out here, more details will come if they work.
My real motivation for the patch is to allow better filesystem control of how things get written though. If I can do this without making things slower, I've won. The big drawback is how muddy writepage has gotten with the patch, as I've more or less required checks for partial page writes.
Quoted 10 lines
Quoted 5 lines
The idea is that using
flush_dirty_buffersto start i/o under memory pressure is less than optimal.flush_dirty_buffersknows the oldest dirty buffer, but has no page aging info, so it might not flush a page that we actually want to free.Note that the fact that buffers dirtied by ->writepage are ordered by time-dirtied means that the
dirty_bufferslist really does have indirect knowledge of page aging. There may well be benefits to your approach but I doubt this is one of them.
A problem is that under memory pressure, we'll flush a buffer that has been dirty for a long time, even if we are constantly redirtying it and have it more or less pinned. This might not be common enough to cause problems, but it still isn't optimal. Yes, it is a good idea to flush that page at some time, but under memory pressure we want to do the least amount of work that will lead to a freeable page.
Quoted 5 lines
It's surprising that 1K buffer size isn't bothered by being grouped by page in their IO requests. I'd have thought that this would cause a significant number of writes to be blocked waiting on the page lock held by an unrelated buffer writeout.
Well, for non-buffer cache pages, we're getting a poor man's write clustering. If this doesn't slow down ext2 its because of good disk layout.
ext2 probably doesn't use the buffer cache enough to show bad results here. reiserfs on ia64 or alpha might.
Quoted 9 lines
The most interesting part of your patch to me is the
anon_space_mapping. It's nice to make buffer handling look more like page cache handling, and get rid of some special cases in the vm scanning. On the other hand, buffers are different from pages in that, once buffers heads are removed, nobody can find them any more, so they can not be rescued. Now, if I'm reading this correctly, buffer pages *will* progress on to theinactive_cleanlist from theinactive_dirtylist instead of jumping that queue and being directly freed by thepage_cache_release.
Without my patch, it looks to me like refill_inactive_scan will put buffer cache pages on the inactive dirty list by calling deactivate_page_nolock. page_launder catches these by checking page->buffers, and calling try_to_free_buffers which starts the io.
So, the big difference now is just that page_launder sees the page is dirty, and uses writepage to start the io and try_to_free_buffers only waits on it. The rest should work more or less the same.
Quoted 5 lines
Maybe
this is good because it avoids the expensive-looking__free_pages_ok.This looks scary:
Quoted 8 lines
+ index =
atomic_read(&buffermem_pages);Because
buffermem_pagesisn't unique. This must mean you're never doing page cache lookups foranon_space_mapping, because the mapping+index key isn't unique. There is a danger here of overloading some hash buckets, which becomes a certainty if you use 0 or some other constant for the index. If you're never doing page cache lookups, why even enter it into the page hash?
path of least surprise I suppose; I knew add_to_page_cache_locked() would do what I wanted in terms of page setup, if there's a better way feel free to advise ;-) No page lookups are done on the buffer cache pages.
Quoted 1 line
That's all for now. It's a very interesting patch.
thanks for the comments ;-)
-chris
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 6 lines · Chris Mason
Quoted 4 lines · I wrote:
Note that the fact that buffers dirtied by ->writepage are ordered by time-dirtied means that the
dirty_bufferslist really does have indirect knowledge of page aging. There may well be benefits to your approach but I doubt this is one of them.
Quoted 6 lines
A problem is that under memory pressure, we'll flush a buffer that has been dirty for a long time, even if we are constantly redirtying it and have it more or less pinned. This might not be common enough to cause problems, but it still isn't optimal. Yes, it is a good idea to flush that page at some time, but under memory pressure we want to do the least amount of work that will lead to a freeable page.
But we don't have a choice. The user has set an explicit limit on how long a dirty buffer can hang around before being flushed. The old-buffer rule trumps the need to allocate new memory. As you noted, it doesn't cost a lot because if the system is that heavily loaded then the rate of dirty buffer production is naturally throttled.
Quoted 10 lines
Quoted 9 lines
The most interesting part of your patch to me is the
anon_space_mapping. It's nice to make buffer handling look more like page cache handling, and get rid of some special cases in the vm scanning. On the other hand, buffers are different from pages in that, once buffers heads are removed, nobody can find them any more, so they can not be rescued. Now, if I'm reading this correctly, buffer pages *will* progress on to theinactive_cleanlist from theinactive_dirtylist instead of jumping that queue and being directly freed by thepage_cache_release.
Quoted 8 lines
Without my patch, it looks to me like
refill_inactive_scanwill put buffer cache pages on the inactive dirty list by callingdeactivate_page_nolock.page_laundercatches these by checkingpage->buffers, and callingtry_to_free_bufferswhich starts the io.So, the big difference now is just that
page_laundersees the page is dirty, and uses writepage to start the io andtry_to_free_buffersonly waits on it. The rest should work more or less the same.
And with your patch, buffers are no longer freed by page launder, they are moved on to the inactive_clean list instead where they are picked up by reclaim_page. I'm just wondering if that's a little more efficient than going through __free_pages_ok/__alloc_pages_limit.
Quoted 15 lines
Quoted 6 lines
Maybe
this is good because it avoids the expensive-looking__free_pages_ok.This looks scary:
Quoted 8 lines
+ index =
atomic_read(&buffermem_pages);Because
buffermem_pagesisn't unique. This must mean you're never doing page cache lookups foranon_space_mapping, because the mapping+index key isn't unique. There is a danger here of overloading some hash buckets, which becomes a certainty if you use 0 or some other constant for the index. If you're never doing page cache lookups, why even enter it into the page hash?
Quoted 4 lines
path of least surprise I suppose; I knew
add_to_page_cache_locked()would do what I wanted in terms of page setup, if there's a better way feel free to advise ;-) No page lookups are done on the buffer cache pages.
If you must enter it into the page hash you'd be safer generating a random number for the page index. But why not just take what you need from add_to_page_cache_locked:
page_cache_get(page); spin_lock(&pagecache_lock); add_page_to_inode_queue(mapping, page); lru_cache_add(page); spin_unlock(&pagecache_lock);
--
Daniel
Quoted 14 lines · On Monday, August 06, 2001 12:38:01 AM +0200 Daniel Phillips…
Quoted 6 lines · Chris Mason
Quoted 4 lines · I wrote:
Note that the fact that buffers dirtied by ->writepage are ordered by time-dirtied means that the
dirty_bufferslist really does have indirect knowledge of page aging. There may well be benefits to your approach but I doubt this is one of them.Quoted 6 lines
A problem is that under memory pressure, we'll flush a buffer that has been dirty for a long time, even if we are constantly redirtying it and have it more or less pinned. This might not be common enough to cause problems, but it still isn't optimal. Yes, it is a good idea to flush that page at some time, but under memory pressure we want to do the least amount of work that will lead to a freeable page.
Quoted 5 lines
But we don't have a choice. The user has set an explicit limit on how long a dirty buffer can hang around before being flushed. The old-buffer rule trumps the need to allocate new memory. As you noted, it doesn't cost a lot because if the system is that heavily loaded then the rate of dirty buffer production is naturally throttled.
there are at least 3 reasons to write buffers to disk
1) they are too old
2) the percentage of dirty buffers is too high
3) you need to reclaim them due to memory pressure
There are 3 completely different things; there's no trumping of priorities. Under memory pressure you write buffers you have a high chance of freeing, during write throttling you write buffers that won't get dirty again right away, and when writing old buffers you write the oldest first.
This doesn't mean you can always make the right decision on all 3 cases, or that making the right decision is worth the effort ;-)
Quoted 4 lines
If you must enter it into the page hash you'd be safer generating a random number for the page index. But why not just take what you need from
add_to_page_cache_locked:
Mostly to keep down on the cut n' pasted code in the patch. But I'll try this out...
-chris
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 25 lines · Chris Mason
On Monday, August 06, 2001 12:38:01 AM +0200 Daniel Phillips
Quoted 15 lines · <[email protected]> wrote:
Quoted 6 lines · Chris Mason
Quoted 4 lines · I wrote:
Note that the fact that buffers dirtied by ->writepage are ordered by time-dirtied means that the
dirty_bufferslist really does have indirect knowledge of page aging. There may well be benefits to your approach but I doubt this is one of them.Quoted 7 lines
A problem is that under memory pressure, we'll flush a buffer that has been dirty for a long time, even if we are constantly redirtying it and have it more or less pinned. This might not be common enough to cause problems, but it still isn't optimal. Yes, it is a good idea to flush that page at some time, but under memory pressure we want to do the least amount of work that will lead to a freeable page.
Quoted 6 lines
But we don't have a choice. The user has set an explicit limit on how long a dirty buffer can hang around before being flushed. The old-buffer rule trumps the need to allocate new memory. As you noted, it doesn't cost a lot because if the system is that heavily loaded then the rate of dirty buffer production is naturally throttled.
Quoted 8 lines
there are at least 3 reasons to write buffers to disk
1) they are too old
2) the percentage of dirty buffers is too high
3) you need to reclaim them due to memory pressureThere are 3 completely different things; there's no trumping of priorities.
There is. If your heavily loaded machine goes down and you lose edits from 1/2 an hour ago even though your bdflush parms specify a 30 second update cycle you'll call the system broken, whereas if it runs 5% slower under heavy write+swap load that's just life.
Quoted 7 lines
Under memory pressure you write buffers you have a high chance of freeing, during write throttling you write buffers that won't get dirty again right away, and when writing old buffers you write the oldest first.
This doesn't mean you can always make the right decision on all 3 cases, or that making the right decision is worth the effort ;-)
If we need to do write throttling we should do it at the point where we still know its a write, i.e., somewhere in sys_write. Some time after writes are throttled (specified by bdflush parms) all the old write buffers will have worked their way through to the drives and your case
(3) gets all the bandwidth. I don't see a conflict, except that we don't have such an upstream write throttling mechanism yet. We sort-of have one in that a writer will busy itself trying to help out with lru scanning when it can't get a free page for the page cache. This has the ugly result that we have bunches of processes spinning on the lru lock and we have no idea what the queue scanning rates really are. We can do something much more intelligent and predictable there and we'll be a lot closer to being able to balance intelligently between your cases.
By the way, I think you should combine (2) and (3) using an and, which gets us back to the "kupdate thing" vs the "bdflush thing".
--
Daniel
Quoted 6 lines · On Monday, August 06, 2001 07:39:47 AM +0200 Daniel Phillips…
Quoted 6 lines
there are at least 3 reasons to write buffers to disk
1) they are too old
2) the percentage of dirty buffers is too high
3) you need to reclaim them due to memory pressure
Quoted 7 lines
Quoted 2 lines
There are 3 completely different things; there's no trumping of priorities.
There is. If your heavily loaded machine goes down and you lose edits from 1/2 an hour ago even though your bdflush parms specify a 30 second update cycle you'll call the system broken, whereas if it runs 5% slower under heavy write+swap load that's just life.
Ok, we're getting caught up in semantics here. I'm not saying kupdate should switch over to write buffers that might get reclaimed instead of old buffers. There still needs to be proper flushing of old data.
I am saying that it should be possible to have the best buffer flushed under memory pressure (by kswapd/bdflush) and still get the old data to disk in time through kupdate.
Quoted 11 lines
Quoted 8 lines
Under memory pressure you write buffers you have a high chance of freeing, during write throttling you write buffers that won't get dirty again right away, and when writing old buffers you write the oldest first.
This doesn't mean you can always make the right decision on all 3 cases, or that making the right decision is worth the effort ;-)
If we need to do write throttling we should do it at the point where we still know its a write, i.e., somewhere in
sys_write.
The rest of the stuff below does make sense, but we need to keep in mind that sys_write isn't the only way to dirty file pages.
Quoted 12 lines
Some time after
writes are throttled (specified by bdflush parms) all the old write buffers will have worked their way through to the drives and your case
(3) gets all the bandwidth. I don't see a conflict, except that we don't have such an upstream write throttling mechanism yet. We sort-of have one in that a writer will busy itself trying to help out with lru scanning when it can't get a free page for the page cache. This has the ugly result that we have bunches of processes spinning on the lru lock and we have no idea what the queue scanning rates really are. We can do something much more intelligent and predictable there and we'll be a lot closer to being able to balance intelligently between your cases.
Quoted 2 lines
By the way, I think you should combine (2) and (3) using an and, which gets us back to the "kupdate thing" vs the "bdflush thing".
Perhaps, since I think they would be handled in roughly the same way.
-chris
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 16 lines · Chris Mason
Quoted 7 lines · On Monday, August 06, 2001 07:39:47 AM +0200 Daniel Phillips wrote:
Quoted 6 lines · Chris Mason
there are at least 3 reasons to write buffers to disk
1) they are too old
2) the percentage of dirty buffers is too high
3) you need to reclaim them due to memory pressureQuoted 7 lines
Quoted 2 lines
There are 3 completely different things; there's no trumping of priorities.
There is. If your heavily loaded machine goes down and you lose edits from 1/2 an hour ago even though your bdflush parms specify a 30 second update cycle you'll call the system broken, whereas if it runs 5% slower under heavy write+swap load that's just life.
Quoted 7 lines
Ok, we're getting caught up in semantics here. I'm not saying kupdate should switch over to write buffers that might get reclaimed instead of old buffers. There still needs to be proper flushing of old data.
I am saying that it should be possible to have the best buffer flushed under memory pressure (by kswapd/bdflush) and still get the old data to disk in time through kupdate.
Yes, to phrase this more precisely, after we've submitted all the too-old buffers we then gain the freedom to select which of the younger buffers to flush. When there is memory pressure we could benefit by skipping over some of the sys_write buffers in favor of page_launder buffers. We may well be able to recognize the latter by looking for !bh->b_page->age. This method would be an alternative to your writepage approach.
Quoted 4 lines
Quoted 2 lines
By the way, I think you should combine (2) and (3) using an and, which gets us back to the "kupdate thing" vs the "bdflush thing".
Perhaps, since I think they would be handled in roughly the same way.
(warning: I'm going to drift pretty far off the original topic now...)
I don't see why it makes sense to have both a kupdate and a bdflush thread. We should complete the process of merging these (sharing flush_dirty buffers was a big step) and look into the possibility of adding more intelligence about what to submit next. The proof of the pudding is to come up with a throughput-improving patch, not so easy since the ore in these hills has been sought after for a good number of years by many skilled prospectors.
Note that bdflush also competes with an unbounded number of threads doing wakeup_bdflush(1)->flush_dirty_buffers.
These are called through balance_dirty:
mark_buffer_dirty->balance_dirty
__block_commit_write->balance_dirty
refill_freelist->balance_dirty
(Curiously, refill_freelist also calls wakeup_bdflush(1) directly.) You can see that each of these paths is very popular, and as soon as we pass the hard_dirty_limit everybody will jump in to try to help with buffer writeout.
As I recall, the current arrangement was arrived at after a flurry of dbench-inspired tweaking last fall and hasn't changed much since then. I think we need to take another look at this. My instinct is that it's wrong to ever have more than one instance of flush_dirty_buffers active per spindle, and that the current arrangement is an attempt to reduce context switches or perhaps to keep buffer submission flowing even when page_launder blocks on writepage-><read metadata synchronously>. There has to be a cleaner way to approach this.
--
Daniel
Quoted 7 lines · On Monday, August 06, 2001 06:13:20 PM +0200 Daniel Phillips…
Quoted 3 lines
I am saying that it should be possible to have the best buffer flushed under memory pressure (by kswapd/bdflush) and still get the old data to disk in time through kupdate.
Yes, to phrase this more precisely, after we've submitted all the too-old buffers we then gain the freedom to select which of the younger buffers to flush.
Almost ;-) memory pressure doesn't need to care about how long a buffer has been dirty, that's kupdate's job. kupdate doesn't care if the buffer it is writing is a good candidate for freeing, that's taken care of elsewhere. The two never need to talk (aside from optimizations).
Quoted 5 lines
When there is memory pressure we could benefit by skipping over some of the
sys_writebuffers in favor ofpage_launderbuffers. We may well be able to recognize the latter by looking for !bh->b_page->age. This method would be an alternative to your writepage approach.
Yes, I had experimented with this in addition to the writepage patch, it would probably be better to try it as a standalone idea.
Quoted 10 lines
Quoted 5 lines
Quoted 3 lines
By the way, I think you should combine (2) and (3) using an and, which gets us back to the "kupdate thing" vs the "bdflush thing".
Perhaps, since I think they would be handled in roughly the same way.
(warning: I'm going to drift pretty far off the original topic now...)
I don't see why it makes sense to have both a kupdate and a bdflush thread.
Having two threads is exactly what allows memory pressure to not be concerned about how long a buffer has been dirty.
Quoted 9 lines
We should complete the process of merging these (sharing
flush_dirtybuffers was a big step) and look into the possibility of adding more intelligence about what to submit next. The proof of the pudding is to come up with a throughput-improving patch, not so easy since the ore in these hills has been sought after for a good number of years by many skilled prospectors.Note that bdflush also competes with an unbounded number of threads doing wakeup_bdflush(1)->flush_dirty_buffers.
Nods. Of course, processes could wait on bdflush instead, but bdflush might not be able to keep up. It would be interesting to experiment with a bdflush thread per device, one that uses write_unlocked_buffers to get the io done. I'll start by switching from flush_dirty_buffers to write_unlocked_buffers in the current code...
-chris
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 11 lines · Chris Mason
On Monday, August 06, 2001 06:13:20 PM +0200 Daniel Phillips
Quoted 7 lines · <[email protected]> wrote:
Quoted 3 lines
I am saying that it should be possible to have the best buffer flushed under memory pressure (by kswapd/bdflush) and still get the old data to disk in time through kupdate.
Yes, to phrase this more precisely, after we've submitted all the too-old buffers we then gain the freedom to select which of the younger buffers to flush.
Quoted 5 lines
Almost ;-) memory pressure doesn't need to care about how long a buffer has been dirty, that's kupdate's job. kupdate doesn't care if the buffer it is writing is a good candidate for freeing, that's taken care of elsewhere. The two never need to talk (aside from optimizations).
My point is, they should talk, in fact they should be the same function. It's never right for bdflush to submit younger buffers when there are dirty buffers whose flush time has already passed.
Quoted 5 lines
Quoted 2 lines
I don't see why it makes sense to have both a kupdate and a bdflush thread.
Having two threads is exactly what allows memory pressure to not be concerned about how long a buffer has been dirty.
I'm missing something. How is it impossible for a single thread to act this way?
--
Daniel
Quoted 10 lines · On Monday, August 06, 2001 09:45:12 PM +0200 Daniel Phillips…
Quoted 5 lines
Almost ;-) memory pressure doesn't need to care about how long a buffer has been dirty, that's kupdate's job. kupdate doesn't care if the buffer it is writing is a good candidate for freeing, that's taken care of elsewhere. The two never need to talk (aside from optimizations).
My point is, they should talk, in fact they should be the same function. It's never right for bdflush to submit younger buffers when there are dirty buffers whose flush time has already passed.
Grin, we're talking in circles. My point is that by having two threads, bdflush is allowed to skip over older buffers in favor of younger ones because somebody else is responsible for writing the older ones out.
Take away the kupdate thread and bdflush must write the older buffer. I believe this limits optimizations, unless kswapd is changed to handle all memory pressure flushes.
-chris
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 9 lines · Chris Mason
On Monday, August 06, 2001 09:45:12 PM +0200 Daniel Phillips
Quoted 6 lines · <[email protected]> wrote:
Quoted 5 lines
Almost ;-) memory pressure doesn't need to care about how long a buffer has been dirty, that's kupdate's job. kupdate doesn't care if the buffer it is writing is a good candidate for freeing, that's taken care of elsewhere. The two never need to talk (aside from optimizations).
Quoted 8 lines
Quoted 3 lines
My point is, they should talk, in fact they should be the same function. It's never right for bdflush to submit younger buffers when there are dirty buffers whose flush time has already passed.
Grin, we're talking in circles. My point is that by having two threads, bdflush is allowed to skip over older buffers in favor of younger ones because somebody else is responsible for writing the older ones out.
Yes, and you can't imagine an algorithm that could do that with *one* thread?
--
Daniel
Quoted 22 lines · Anton Altaparmakov
Quoted 9 lines · Stephen C. Tweedie
On Mon, Aug 06, 2001 at 11:18:26PM +0200, Daniel Phillips wrote:
FWIW, we've seen big performance degradations in the past when testing different ext3 checkpointing modes. You can't reuse a disk block in the journal without making sure that the data in it has been flushed to disk, so ext3 does regular checkpointing to flush journaled blocks out. That can interact very badly with normal VM writeback if you're not careful: having two threads doing the same thing at the same time can just thrash the disk.Quoted 3 lines
Parallel
sync()calls from multiple processes has shown up the same behaviour on ext2 in the past. I'd definitely like to see at most one thread of writeback per disk to avoid that.Why not have a facility with which each fs can register their own writeback functions with a time interval? The daemon would be doing the writing to the device and would be invoking the fs registered writers every <time interval> seconds. That would avoid the problem of having two fs trying to write in parallel but that ignores the problem of having two parallel writers on separate partitions of the same disk but that could be solved at the fs writeback function level.
Quoted 5 lines
At least for NTFS TNG I was thinking of having a daemon running every 5 seconds and committing dirty data to disk but it would be iterating over all mounted ntfs volumes in sequence and flushing all dirty data for each, thus avoiding concurrent writing to the same disk, which I had thought might cause a problem and you just confirmed it...[1]
Let me see:
Ext3 has its own writeback daemon
ReiserFS has its own writeback daemon
NTFS quite possibly will have its own writeback daemon Tux2 has its own writeback daemon
xfs... does it?
jfs?
And then there is kupdate, which is a writeback daemon for all those filesystems too dumb to have their own.
I think I see a pattern here. We must come up with a model for efficient interaction between these writeback daemons, or better yet, provide a generic mechanism that provides the scheduling for all fs writeback, and knows about the fs->device topology.
Quoted 3 lines
[1] I am aware this probably doesn't scale too well but considering a volume can span several disk partitions on the same disk or across several disks I don't see how to parallelize at the fs level.
One thread per block device; flushes across mounts on the same device are serialized. This model works well for fs->device graphs that are strict trees. For a non-strict tree (acyclic graph) its not clear what to do, but you could argue that such a configuration is stupid, so any kind of punt would do.
--
Daniel
Quoted 5 lines · Daniel Phillips
One thread per block device; flushes across mounts on the same device are serialized. This model works well for
fs->devicegraphs that are strict trees. For a non-strict tree (acyclic graph) its not clear what to do, but you could argue that such a configuration is stupid, so any kind of punt would do.
Except that you can have a part of fs structures on a separate device. Journal, for one thing. Now think of two disks, both partitioned. Two filesystems. Each has data on the first partition of its own disk. And journal on the second of another.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 11 lines · Alexander Viro
Quoted 5 lines · Daniel Phillips
One thread per block device; flushes across mounts on the same device are serialized. This model works well for
fs->devicegraphs that are strict trees. For a non-strict tree (acyclic graph) its not clear what to do, but you could argue that such a configuration is stupid, so any kind of punt would do.Except that you can have a part of fs structures on a separate device. Journal, for one thing. Now think of two disks, both partitioned. Two filesystems. Each has data on the first partition of its own disk. And journal on the second of another.
And you want the write scheduling to not interfere when both are active? Good luck. I'd call this a dumb configuration from the point of view of performance.
That said, the update daemon can just ignore the connection between data and journal partitions and let the fs take case of that itself if it needs to. Ext3 doesn't need to, the usual kupdate rules are good enough.
So the parallel/serial update strategy survives this case just fine, however something tells me your fevered imagination is capable of coming up with yet another bizarre configuration or two...
--
Daniel
Hi,
Quoted 1 line · Daniel Phillips
Ext3 has its own writeback daemon
Ext3 has a daemon to schedule commits to the journal, but it uses the normal IO scheduler for unforced writebacks.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 7 lines · Stephen C. Tweedie
Hi,
Quoted 1 line · Daniel Phillips
Ext3 has its own writeback daemon
Ext3 has a daemon to schedule commits to the journal, but it uses the normal IO scheduler for unforced writebacks.
Yes. The currently favored journalling mode uses a writeback journal, no? In other words the ext3 journal daemon seems to fit the description pretty well, especially if you have several of them on one disk.
--
Daniel
Hi,
Quoted 9 lines · Daniel Phillips
Quoted 5 lines · Stephen C. Tweedie
Quoted 1 line · Daniel Phillips
Ext3 has its own writeback daemon
Ext3 has a daemon to schedule commits to the journal, but it uses the normal IO scheduler for unforced writebacks.
Yes. The currently favored journalling mode uses a writeback journal, no?
It's lazy commit, but that's not really writeback --- when you're journaling, you write once to the journal, then after commit you write again to primary storage. The commit is lazy, sure, but it's not doing the writeback.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Hi,
Quoted 9 lines · Daniel Phillips
Quoted 6 lines
On Monday, August 06, 2001 09:45:12 PM +0200 Daniel Phillips
Grin, we're talking in circles. My point is that by having two threads, bdflush is allowed to skip over older buffers in favor of younger ones because somebody else is responsible for writing the older ones out.
Yes, and you can't imagine an algorithm that could do that with *one* thread?
FWIW, we've seen big performance degradations in the past when testing different ext3 checkpointing modes. You can't reuse a disk block in the journal without making sure that the data in it has been flushed to disk, so ext3 does regular checkpointing to flush journaled blocks out. That can interact very badly with normal VM writeback if you're not careful: having two threads doing the same thing at the same time can just thrash the disk.
Parallel sync() calls from multiple processes has shown up the same behaviour on ext2 in the past. I'd definitely like to see at most one thread of writeback per disk to avoid that.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Hi,
Quoted 9 lines · Stephen C. Tweedie
On Mon, Aug 06, 2001 at 11:18:26PM +0200, Daniel Phillips wrote:
FWIW, we've seen big performance degradations in the past when testing different ext3 checkpointing modes. You can't reuse a disk block in the journal without making sure that the data in it has been flushed to disk, so ext3 does regular checkpointing to flush journaled blocks out. That can interact very badly with normal VM writeback if you're not careful: having two threads doing the same thing at the same time can just thrash the disk.
Quoted 3 lines
Parallel
sync()calls from multiple processes has shown up the same behaviour on ext2 in the past. I'd definitely like to see at most one thread of writeback per disk to avoid that.
Why not have a facility with which each fs can register their own writeback functions with a time interval? The daemon would be doing the writing to the device and would be invoking the fs registered writers every <time interval> seconds. That would avoid the problem of having two fs trying to write in parallel but that ignores the problem of having two parallel writers on separate partitions of the same disk but that could be solved at the fs writeback function level.
At least for NTFS TNG I was thinking of having a daemon running every 5 seconds and committing dirty data to disk but it would be iterating over all mounted ntfs volumes in sequence and flushing all dirty data for each, thus avoiding concurrent writing to the same disk, which I had thought might cause a problem and you just confirmed it...[1]
Just a thought,
Anton
[1] I am aware this probably doesn't scale too well but considering a volume can span several disk partitions on the same disk or across several disks I don't see how to parallelize at the fs level.
Signature · 10 lines
"Nothing succeeds like success." - Alexandre Dumas -- Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/ ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/
Quoted 21 lines · Stephen C. Tweedie
Hi,
Quoted 9 lines · Daniel Phillips
Quoted 6 lines
On Monday, August 06, 2001 09:45:12 PM +0200 Daniel Phillips
Grin, we're talking in circles. My point is that by having two threads, bdflush is allowed to skip over older buffers in favor of younger ones because somebody else is responsible for writing the older ones out.
Yes, and you can't imagine an algorithm that could do that with *one* thread?
FWIW, we've seen big performance degradations in the past when testing different ext3 checkpointing modes. You can't reuse a disk block in the journal without making sure that the data in it has been flushed to disk, so ext3 does regular checkpointing to flush journaled blocks out. That can interact very badly with normal VM writeback if you're not careful: having two threads doing the same thing at the same time can just thrash the disk.
Quoted 3 lines
Parallel
sync()calls from multiple processes has shown up the same behaviour on ext2 in the past. I'd definitely like to see at most one thread of writeback per disk to avoid that.
Be carefull here. I have a system (solaris) at the office that has 96 drives on it. Do we really want 96 writeback threads? With 96 drives, suspect the bus bandwidth would be the limiting factor.
Ed Tomlinson
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/
Quoted 10 lines · Ed Tomlinson
Quoted 9 lines · Stephen C. Tweedie
On Mon, Aug 06, 2001 at 11:18:26PM +0200, Daniel Phillips wrote:
FWIW, we've seen big performance degradations in the past when testing different ext3 checkpointing modes. You can't reuse a disk block in the journal without making sure that the data in it has been flushed to disk, so ext3 does regular checkpointing to flush journaled blocks out. That can interact very badly with normal VM writeback if you're not careful: having two threads doing the same thing at the same time can just thrash the disk.
Quoted 7 lines
Quoted 3 lines
Parallel
sync()calls from multiple processes has shown up the same behaviour on ext2 in the past. I'd definitely like to see at most one thread of writeback per disk to avoid that.Be carefull here. I have a system (solaris) at the office that has 96 drives on it. Do we really want 96 writeback threads? With 96 drives, suspect the bus bandwidth would be the limiting factor.
But we have that situation today already. - There is one thread running for each of the md devices in my file server (so I have six threads at moment each with the name raid1d) so if you were using the md driver extensively to say mirror half of your drives onto the other half you would have 48 threads running already...
Anton
Signature · 10 lines
"Nothing succeeds like success." - Alexandre Dumas -- Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/ ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/
Quoted 20 lines · Ed Tomlinson
Quoted 19 lines · Stephen C. Tweedie
Quoted 9 lines · Daniel Phillips
Quoted 6 lines
On Monday, August 06, 2001 09:45:12 PM +0200 Daniel Phillips
Grin, we're talking in circles. My point is that by having two threads, bdflush is allowed to skip over older buffers in favor of younger ones because somebody else is responsible for writing the older ones out.
Yes, and you can't imagine an algorithm that could do that with *one* thread?
FWIW, we've seen big performance degradations in the past when testing different ext3 checkpointing modes. You can't reuse a disk block in the journal without making sure that the data in it has been flushed to disk, so ext3 does regular checkpointing to flush journaled blocks out. That can interact very badly with normal VM writeback if you're not careful: having two threads doing the same thing at the same time can just thrash the disk.
Quoted 7 lines
Quoted 3 lines
Parallel
sync()calls from multiple processes has shown up the same behaviour on ext2 in the past. I'd definitely like to see at most one thread of writeback per disk to avoid that.Be carefull here. I have a system (solaris) at the office that has 96 drives on it. Do we really want 96 writeback threads? With 96 drives, suspect the bus bandwidth would be the limiting factor.
Surely these are grouped into some kind of raid? You'd have one queue per raid. Since the buffer submission is nonblocking[1] it's a matter of taste whether that translates into multiple threads or not.
[1] So long as you don't run into the low level request limits which should never happen if you pay attention to how much IO is in flight.
--
Daniel
Quoted 8 lines · Chris Mason
Quoted 5 lines · On Wednesday, August 01, 2001 04:57:35 PM +0200 Daniel Phillips…
Quoted 3 lines · Chris Mason
This has been tested a little more now, both ext2 (1k, 4k) and reiserfs. dbench and iozone testing don't show any difference, but I need to spend a little more time on the benchmarks.
Quoted 6 lines
Quoted 2 lines
It's impressive that such seemingly radical surgery on the vm innards is a) possible and b) doesn't make the system perform noticably worse.
radical surgery is always possible ;-) But, I was expecting better performance results than I got. I'm trying a few other things out here, more details will come if they work.
Hmm. I would expect that could could entirely avoid the issue of which hash chain to put pages on if you did the block devices in the page cache
thing. The the current buffer cache interface becomes just a
backwards compatibility layer which should make things cleaner.
Eric
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/