On Thu, Dec 19, 2013 at 11:17:28AM -0500, Theodore Ts'o wrote: > On Thu, Dec 19, 2013 at 08:20:49AM -0700, Matthew Wilcox wrote: > > We could have ext4_get_xip_mem() check buffer_unwritten(); if it's set, > > zero the blocks and call ext4_convert_unwritten_extents(). Would that > > work? > > That would work, but we'd be doing a double write to each data block > --- first writing all zero's, and then later, writing the actual data. > So this would halve our write bandwidth, and double the write wear on > the device. Once this patch is done that I'm working on in the other thread, the only place we'll be calling get_xip_mem() is in the page fault path, which always has to zero no matter whether it's a load or a store. As I said in my last reply to Dave: At this point, I'm thinking a custom ->fault handler that looks something like this: static int ext4_xip_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { return xip_fault(vma, vmf, ext4_get_block_write, ext4_end_io_dio); } ... I think it'll actually be ext4_get_block_fault, not _write, and it will include code to zero the returned blocks if they're uninitialised. -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html