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

Removing ZERO_PAGE abd_alloc_zero_scatter #10428

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

bwatkinson
Copy link
Contributor

@bwatkinson bwatkinson commented Jun 9, 2020

For MIPS architectures on Linux the ZERO_PAGE macro references
empty_zero_page, which is exported as a GPL symbol. The call to
ZERO_PAGE in abd_alloc_zero_scatter has been removed and a single
zero'd page is now allocated for each of the pages in abd_zero_scatter
in the kernel ABD code path.

Signed-off-by: Brian Atkinson [email protected]

For MIPS architectures in Linux the ZERO_PAGE macro references empty_zero_page. This is a GPL only symbol.

Motivation and Context

Removes a dependency on a GPL symbol for MIPS architectures.

Description

In order to fix this, I have removed the call to ZERO_PAGE in the Linux abd_os.c for allocating the abd_zero_scatter ABD. Instead I just allocate a single page and pass the __GP_ZERO flag to zero out the page.

How Has This Been Tested?

I tested with zloop.sh (ran for 30 mins) and ZTS test.

Test on CentOS Linux kernel 4.18.5.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

bwatkinson referenced this pull request Jun 9, 2020
Adding the gang ABD type, which allows for linear and scatter ABDs to
be chained together into a single ABD.

This can be used to avoid doing memory copies to/from ABDs. An example
of this can be found in vdev_queue.c in the vdev_queue_aggregate()
function.

Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Co-authored-by: Brian <[email protected]>
Co-authored-by: Mark Maybee <[email protected]>
Signed-off-by: Brian Atkinson <[email protected]>
Closes #10069
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jun 9, 2020
For MIPS architectures on Linux the ZERO_PAGE macro references
empty_zero_page, which is exported as a GPL symbol. The call to
ZERO_PAGE in abd_alloc_zero_scatter has been removed and a single
zero'd page is now allocated for each of the pages in abd_zero_scatter
in the kernel ABD code path.

Signed-off-by: Brian Atkinson <[email protected]>
@codecov
Copy link

codecov bot commented Jun 10, 2020

Codecov Report

Merging #10428 into master will decrease coverage by 0.00%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10428      +/-   ##
==========================================
- Coverage   79.46%   79.46%   -0.01%     
==========================================
  Files         391      391              
  Lines      123632   123638       +6     
==========================================
+ Hits        98245    98246       +1     
- Misses      25387    25392       +5     
Flag Coverage Δ
#kernel 79.92% <85.71%> (-0.03%) ⬇️
#user 65.65% <100.00%> (-0.61%) ⬇️
Impacted Files Coverage Δ
include/sys/abd.h 100.00% <ø> (ø)
module/os/linux/zfs/abd_os.c 97.60% <85.71%> (-0.27%) ⬇️
module/os/linux/spl/spl-kmem-cache.c 75.22% <0.00%> (-8.50%) ⬇️
module/zfs/space_map.c 93.06% <0.00%> (-4.96%) ⬇️
module/zfs/spa_checkpoint.c 93.78% <0.00%> (-4.35%) ⬇️
module/lua/lmem.c 83.33% <0.00%> (-4.17%) ⬇️
module/zfs/dsl_synctask.c 92.40% <0.00%> (-2.54%) ⬇️
module/zfs/vdev_raidz.c 91.17% <0.00%> (-2.51%) ⬇️
module/os/linux/zfs/vdev_file.c 80.37% <0.00%> (-1.87%) ⬇️
lib/libzfs/os/linux/libzfs_mount_os.c 62.30% <0.00%> (-1.58%) ⬇️
... and 46 more

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 32f26ea...33cea7d. Read the comment docs.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) Type: Architecture Indicates an issue is specific to a single processor architecture Type: Building Indicates an issue related to building binaries and removed Status: Code Review Needed Ready for review and testing labels Jun 11, 2020
@behlendorf behlendorf merged commit e08b993 into openzfs:master Jun 11, 2020
lundman referenced this pull request in openzfsonosx/openzfs Jun 12, 2020
For MIPS architectures on Linux the ZERO_PAGE macro references
empty_zero_page, which is exported as a GPL symbol. The call to
ZERO_PAGE in abd_alloc_zero_scatter has been removed and a single
zero'd page is now allocated for each of the pages in abd_zero_scatter
in the kernel ABD code path.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Brian Atkinson <[email protected]>
Closes #10428
@bwatkinson bwatkinson deleted the abd_zero_page branch November 23, 2020 22:36
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
For MIPS architectures on Linux the ZERO_PAGE macro references
empty_zero_page, which is exported as a GPL symbol. The call to
ZERO_PAGE in abd_alloc_zero_scatter has been removed and a single
zero'd page is now allocated for each of the pages in abd_zero_scatter
in the kernel ABD code path.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Brian Atkinson <[email protected]>
Closes openzfs#10428
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
For MIPS architectures on Linux the ZERO_PAGE macro references
empty_zero_page, which is exported as a GPL symbol. The call to
ZERO_PAGE in abd_alloc_zero_scatter has been removed and a single
zero'd page is now allocated for each of the pages in abd_zero_scatter
in the kernel ABD code path.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Brian Atkinson <[email protected]>
Closes openzfs#10428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested) Type: Architecture Indicates an issue is specific to a single processor architecture Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants