Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastio #178

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fastio #178

wants to merge 4 commits into from

Conversation

lundman
Copy link
Collaborator

@lundman lundman commented Oct 11, 2019

No description provided.

Instead of littering source file with #ifdef _WIN32, we create
a wrapper for the POSIX calls that uses "int fd;". As we need to
use HANDLEs to open devices, we implement alternate versions of the
POSIX functions that take HANDLEs instead.

Currently the implementation uses simple cast between HANDLE and int,
should we find that the missing bits (64bit -> 32bit) to be a problem
the shim layer could further be enhanced to handle this case.

The functions that have a whole WIN32 replacement are left to use
WIN32 specific code, but as much as possible remains unchanged from
upstream.
Implement minimal skeleton code for fastio ability, mostly to test if it
changes anything with the long-time standing issues.

It does not, appears to be optional as it says on the tin.
@lundman
Copy link
Collaborator Author

lundman commented Oct 17, 2019

Something goes wrong here with writes; if we start a simple:

dd if=/dev/random if=/e/file.txt bs=128k

It will initially write as expected, but eventually we end up in a peculiar state.

The writing thread appears to do:

fastio_write()
{
ret = FsRtlCopyWrite(FileObject, FileOffset, Length, Wait, LockKey, Buffer, IoStatus,
}

Where FsRtlCopyWrite() returns false all the time ( it appears full ).

We do get calls to fs_write(), which end up taking the path

			if (!CcCopyWriteEx(fileObject,

Ie, this write should go to cache, as IRP_PAGING_IO is not set.

I totally also expect to see calls to fs_write(IRP_PAGING_IO) which actually calls zfs_write() to commit the data to disk, but this is not happening. Why?

So it would appear we get fastio writes until memory is exhausted and it stalled. Meanwhile, we do not get the lazywrites, they appear to not happen. We do not seem to have any threads stuck waiting on locks, nor are the lazy/fastio lock calls even called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant