Re: Write-back from inside FS - need suggestions

2007-09-30 Thread Jörn Engel
On Sat, 29 September 2007 13:00:11 -0700, Andrew Morton wrote: > > err, it's basically an open-coded mutex via which one thread can get > exclusive access to some parts of an inode's internals. Perhaps it could > literally be replaced with a mutex. Exactly what I_LOCK protects has not > been doc

Re: Write-back from inside FS - need suggestions

2007-09-30 Thread Artem Bityutskiy
Andrew, thank you for this help. Andrew Morton wrote: writepage under i_mutex is commonly done on the sys_write->alloc_pages->direct-reclaim path. It absolutely has to work, and you'll be fine relying upon that. However ->prepare_write() is called with the page locked, so you are vulnerable to

Re: Write-back from inside FS - need suggestions

2007-09-29 Thread Andrew Morton
On Sat, 29 Sep 2007 22:10:42 +0300 Artem Bityutskiy <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > I'd have thought that a suitable wrapper around a suitably-modified > > sync_sb_inodes() would be appropriate for both filesystems? > > Ok, I've modified sync_inodes_sb() so that I can pass i

Re: Write-back from inside FS - need suggestions

2007-09-29 Thread Artem Bityutskiy
Andrew Morton wrote: I'd have thought that a suitable wrapper around a suitably-modified sync_sb_inodes() would be appropriate for both filesystems? Ok, I've modified sync_inodes_sb() so that I can pass it my own wbc, where I set wcb->nr_to_write = 20. It gives me _exactly_ what I want. It just

Re: Write-back from inside FS - need suggestions

2007-09-29 Thread Artem Bityutskiy
Andrew Morton wrote: I'd have thought that a suitable wrapper around a suitably-modified sync_sb_inodes() would be appropriate for both filesystems? Hmm, OK, I'll try to do this. Thanks. -- Best Regards, Artem Bityutskiy (Артём Битюцкий) - To unsubscribe from this list: send the line "unsubscr

Re: Write-back from inside FS - need suggestions

2007-09-29 Thread Andrew Morton
On Sat, 29 Sep 2007 12:56:55 +0300 Artem Bityutskiy <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > This is precisely the problem which needs to be solved for delayed > > allocation on ext2/3/4. This is because it is infeasible to work out how > > much disk space an ext2 pagecache page will

Re: Write-back from inside FS - need suggestions

2007-09-29 Thread Artem Bityutskiy
Andrew Morton wrote: This is precisely the problem which needs to be solved for delayed allocation on ext2/3/4. This is because it is infeasible to work out how much disk space an ext2 pagecache page will take to write out (it will require zero to three indirect blocks as well). When I did dela

Re: Write-back from inside FS - need suggestions

2007-09-28 Thread Andrew Morton
On Fri, 28 Sep 2007 12:16:54 +0300 Artem Bityutskiy <[EMAIL PROTECTED]> wrote: > Hi, > > we are writing anew flash FS (UBIFS) and need some advise/suggestion. > Brief FS info and the code are available at > http://www.linux-mtd.infradead.org/doc/ubifs.html. > > At any point of time we may have a

Write-back from inside FS - need suggestions

2007-09-28 Thread Artem Bityutskiy
Hi, we are writing anew flash FS (UBIFS) and need some advise/suggestion. Brief FS info and the code are available at http://www.linux-mtd.infradead.org/doc/ubifs.html. At any point of time we may have a plenty of cached stuff which have to be written back later to the flash media: dirty pages a