Re: CIFS data coherency problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/9/12 Jeff Layton <jlayton@xxxxxxxxx>:
> write_begin/write_end are called on each page in a write syscall. So if
> your application is writing in 64k page-aligned chunks, write_end will
> be called 16 times. When you have no oplock with this patch, for each
> call to write_end, you're calling cifs_write which will flush each
> single page synchronously and only that single page to the server. Your
> 64k write will take 16 round trips to the server to complete.
>
> What you probably want to do instead is populate the pagecache with the
> write contents (as is done today), flush the write and wait on the
> result. Optionally, you could then invalidate the cache to free up the
> pagecache pages (though you'll need to take care not to race with other
> writers).

Ok, I understand you. What do you think about the following idea?

1) if we don't have an exclusive oplock, we write the data to the
server before do_sync_write but in cifs_write_end we don't mark the
page as dirty and don't write to the server;
2) if we have an exclusive oplock, we don't write the data before
do_sync_write and mark page as dirty in cifs_write_end (again we don't
write anything to the server in cifs_write_end);

-- 
Best regards,
Pavel Shilovsky.
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux