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

Tag ABD pages for exclusion in kernel crash dumps #8899

Merged
merged 1 commit into from
Aug 28, 2019
Merged

Tag ABD pages for exclusion in kernel crash dumps #8899

merged 1 commit into from
Aug 28, 2019

Conversation

don-brady
Copy link
Contributor

Motivation and Context

Tag the ABD data pages so that they can be identified for exclusion from kernel crash dumps. Eliminating the zfs file data allows for significantly smaller crash dump files. Note that ZFS in illumos has always excluded the zfs data pages from a kernel crash dump.

Description

This change tags ARC scatter data pages so they can be identified from the makedumpfile(8) command. That command is used to create smaller dump files by ignoring some memory regions and using compression. It already filters file data from the VFS page cache and will now be able to exclude ZFS file data pages from the dump file.

A corresponding change to makeumpfile(8) is required to identify ZFS data pages.

How Has This Been Tested?

ztest

generated kernel crash dumps using a modified makeumpfile and confirmed that zfs data pages were being excluded.

Sample summary:

  Excluded pages   : 0x0000000000165a4e
    Pages filled with zero  : 0x000000000000bda5
    Non-private cache pages : 0x000000000000a296
    Private cache pages     : 0x0000000000000007
    ZFS ARC file data pages : 0x00000000000802e8
    User process data pages : 0x0000000000066b3e
    Free pages              : 0x0000000000068be6
    Hwpoison pages          : 0x0000000000000000
  Remaining pages  : 0x000000000003a541
  (The number of pages is reduced to 14%.)
Memory Hole     : 0x00000000000e0071
--------------------------------------------------
Total pages     : 0x0000000000280000

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:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jun 13, 2019
module/zfs/abd.c Outdated
@@ -251,6 +251,27 @@ abd_chunkcnt_for_bytes(size_t size)
#define __GFP_RECLAIM __GFP_WAIT
#endif

#define ABD_FILE_CACHE_PAGE 0x2F5ABDF11ECAC4E
Copy link
Contributor

Choose a reason for hiding this comment

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

You're going to need to define a smaller value for 32-bit platforms to resolve the build failures on arm/ppc/i386.

/var/lib/buildbot/slaves/buildslave1/Debian_8_arm__BUILD_/build/zfs/module/zfs/abd.c: In function ‘abd_mark_zfs_page’:
include/linux/mm.h:319:54: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 #define set_page_private(page, v) ((page)->private = (v))
                                                      ^
/var/lib/buildbot/slaves/buildslave1/Debian_8_arm__BUILD_/build/zfs/module/zfs/abd.c:264:2: note: in expansion of macro ‘set_page_private’
  set_page_private(page, ABD_FILE_CACHE_PAGE);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I limited the page tagging to 64-bit platforms.

@behlendorf behlendorf added Status: Revision Needed Changes are required for the PR to be accepted and removed Status: Code Review Needed Ready for review and testing labels Aug 20, 2019
Signed-off-by: Don Brady <don.brady@delphix.com>
@behlendorf behlendorf added Status: Code Review Needed Ready for review and testing and removed Status: Revision Needed Changes are required for the PR to be accepted labels Aug 28, 2019
@codecov
Copy link

codecov bot commented Aug 28, 2019

Codecov Report

Merging #8899 into master will increase coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8899      +/-   ##
==========================================
+ Coverage   72.47%   72.69%   +0.21%     
==========================================
  Files         371      371              
  Lines      119441   119449       +8     
==========================================
+ Hits        86569    86830     +261     
+ Misses      32872    32619     -253
Flag Coverage Δ
#kernel 72.45% <100%> (+0.06%) ⬆️
#user 63.45% <ø> (+0.35%) ⬆️

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 e6203d2...4b18808. Read the comment docs.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 28, 2019
@behlendorf behlendorf merged commit 28c91ab into openzfs:master Aug 28, 2019
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants