On Tue 09-08-16 15:08:27, Josef Bacik wrote: > Provide a mechanism for file systems to indicate how much dirty metadata they > are holding. This introduces a few things > > 1) Zone stats for dirty metadata, which is the same as the NR_FILE_DIRTY. > 2) WB stat for dirty metadata. This way we know if we need to try and call into > the file system to write out metadata. This could potentially be used in the > future to make balancing of dirty pages smarter. > 3) A super callback to handle writing back dirty metadata. > > A future patch will take advantage of this work in btrfs. Thanks, Hum, I once had a patch to allow filesystems to hook more into writeback where a filesystem was just asked to do writeback and it could decide what to do with it (it could use generic helpers to essentially replicate what current writeback code does) but it could also choose some smarter strategy of picking inodes to write. This scheme could easily accommodate your metadata writeback as well and there are also other uses for it. But that patch got broken by Tejun's cgroup aware writeback so one would have to start from scratch. We certainly have to think how to integrate this with cgroup aware writeback. I guess your ->writeback_metadata() just does not bother and would write anything in the root cgroup, right? After all you don't even pass the information for which memcg the metadata writeback should be performed down to the fs callback (that is encoded in the bdi_writeback structure). And for now I think we could get away with that although it would need to be handled properly in future I think. If we created a generic filesystem writeback callback as I suggest, proper integration with memcg writeback in unavoidable. But I have to think how to do that best. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html