Navigation Menu

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

[testing] use smaller filesize on 4KB pagesize systems #2132

Merged
merged 1 commit into from Feb 16, 2018

Conversation

tophj-ibm
Copy link
Contributor

Uses a much smaller value when creating this file to be used
as a loopback device on non-ppc64le platforms.

This file has to be so large on ppc64le, because mkfs.btrfs
uses the default architecture pagesize as blocksize, which is 64KB
on ppc64le, but only 4KB on amd64 and s390x.

Signed-off-by: Christopher Jones tophj@linux.vnet.ibm.com

@codecov-io
Copy link

codecov-io commented Feb 14, 2018

Codecov Report

Merging #2132 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2132   +/-   ##
=======================================
  Coverage   45.53%   45.53%           
=======================================
  Files          80       80           
  Lines        8726     8726           
=======================================
  Hits         3973     3973           
  Misses       4107     4107           
  Partials      646      646
Flag Coverage Δ
#linux 50.24% <ø> (ø) ⬆️
#windows 41.09% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa82d17...6e37011. Read the comment docs.

deviceName, cleanupDevice, err := testutil.NewLoopback(650 << 20) // 650 MB
loopbackSize := int64(100 << 20) // 100 MB
// mkfs.btrfs needs > 650MB space on ppc64le because of its larger default pagesize (64KB vs 4KB)
if os.Getenv("GOARCH") == "ppc64le" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime.GOARCH? (How is this env var set?)

@@ -29,7 +29,13 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshots.Snap

return func(ctx context.Context, root string) (snapshots.Snapshotter, func() error, error) {

deviceName, cleanupDevice, err := testutil.NewLoopback(650 << 20) // 650 MB
loopbackSize := int64(100 << 20) // 100 MB
// mkfs.btrfs needs > 650MB space on ppc64le because of its larger default pagesize (64KB vs 4KB)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sysconf(_SC_PAGESIZE)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkihiroSuda I'm not sure what you are asking. That is one of the ways to get the value, yes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant we can check pagesize rather than GOARCH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh yeah that would be probably be better

@tophj-ibm tophj-ibm force-pushed the lower-mkfs-size branch 2 times, most recently from 84a7891 to 2462ce8 Compare February 15, 2018 18:45
@tophj-ibm tophj-ibm changed the title [testing] use smaller file size for non-ppc64le systems [testing] use smaller filesize on 4KB pagesize systems Feb 15, 2018
Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp
Copy link
Member

estesp commented Feb 15, 2018

minor nit: given it's not implicitly clear why the linkage between page size and temp filesystem mount, a comment might be useful for someone else coming across this code

Use a smaller filesize on systems that have a default 4KB pagesize.

This is because mkfs.btrfs uses the default system pagesize as blocksize
when creating a device, so if the pagesize is larger, then the file needs
to be larger as well. This larger filesize is needed specifically for
systems where 64KB is default, such as ppc64le.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit ea58933 into containerd:master Feb 16, 2018
@tophj-ibm tophj-ibm deleted the lower-mkfs-size branch February 19, 2018 16:39
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.

None yet

5 participants