Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Conversation

@egernst
Copy link

@egernst egernst commented Aug 28, 2017

By default the mmap command for 9p is read only

Reason: generic_file_readonly_mmap is used by 9pfs Kernel side client
code, in case there is no caching.

For the guest OS, we need to ensure:

  1. CONFIG_9P_FSCACHE is enabled in the guest kernel
  2. v9f2_file_mmap is used instead of generic_file_readonly_mmap

For 2, we want cache=fscache to enable writable mmaps. This patch
addresses this requirement.

Fixes #92.

Signed-off-by: Eric Ernst [email protected]

@jcvenegas
Copy link
Contributor

depends on clearcontainers/linux#3

@sboeuf
Copy link
Contributor

sboeuf commented Aug 28, 2017

LGTM

Approved with PullApprove Approved with PullApprove

@mcastelino
Copy link
Contributor

mcastelino commented Aug 28, 2017

LGTM

Approved with PullApprove Approved with PullApprove

@mcastelino
Copy link
Contributor

Does this need clearcontainers/linux#3

What will happen if we have an older kernel.

@egernst
Copy link
Author

egernst commented Aug 29, 2017

As I look at this closer, I noticed a couple things:

  1. we could use cache=mmap or
  2. cache=fscache

I actually saw the failure go away in either case (seemingly the mmap resolves as rw), regardless of the guest kernel's config update. I'm asking Arindam for clarity on this next.

I'm hoping to take a look @ the performance numbers for this PR -- @grahamwhaley - can you help point me in the right direction (or help with a run if you aren't tracking this repo w/ localci?)

@grahamwhaley
Copy link
Contributor

@egernst
Reading @rarindam's info on #92, the statement there is that the mmap will be readonly with un-cached 9p mounts, and thus it would seem either mmap or fscache caching would enable the rw mmap.
The relevant code I think will be these fs ops tables in the kernel 9p:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/9p/vfs_file.c#n669

Thus, I'm not convinced the kernel config update is necessary (but I have not dug into it). I'll let @rarindam comment on that.

For performance, sure, we can run the fs metrics. I will note here also, this msize setting improvement in the same area never did land in the hyperstart repo, and I believe it is not in our local agent either - that is also stuck on getting 'metrics'. We should combine the efforts:
clearcontainers/hyperstart#25

@egernst
Copy link
Author

egernst commented Aug 29, 2017

From my measurements, mmap is slightly more performant relative to fscache and meets our RW needs. Will update the PR to use this cache mode instead.

By default the mmap command for 9p is read only

Reason: generic_file_readonly_mmap is used by 9pfs Kernel side client
code in case there is no caching.

Based on this, we should enable caching for our 9p mounts.
There are two verified options for this:
 1. cache=fscache
 2. cache=mmap

After running FIO tests (random and linear read/write i/o), I see mmap
providing slightly better performance, and it does not require any
additional kernel config options to be enabled.

Currently the value of cache=none (the default for mount). Enabling
caching gives performance that is on parity with no caching, and slight
improvements for random write IO.

Fixes #92.

Signed-off-by: Eric Ernst <[email protected]>
@rarindam
Copy link

rarindam commented Aug 29, 2017 via email

@egernst
Copy link
Author

egernst commented Aug 29, 2017

Thanks @rarindam

The issue is observed in 3.0 -- this pull request is being made to address and fix it. with cache=mmap, my issue is resolved.

@devimc devimc merged commit cd7e092 into clearcontainers:master Aug 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants