Bug 987136
Summary: | RFE: add 'discard' swap option support for /etc/fstab | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Carl Roth <roth> |
Component: | systemd | Assignee: | Jan Synacek <jsynacek> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | johannbg, jsynacek, lnykryn, msekleta, plautrba, roth, rvokal, systemd-maint, vpavlin, zbyszek |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | systemd-216-4.fc21 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-10-17 17:10:58 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Carl Roth
2013-07-22 19:11:00 UTC
If the dmesg results are to be believed, I think this is the difference between 'discard' and 'no discard' (see the 'D' flag): # swapon /dev/disk/by-uuid/d8e4b4bf-9f1e-446a-a5b0-0325c4ef7d73 # dmesg | grep swap | tail -1 [773331.002898] Adding 8388604k swap on /dev/mapper/M4_CT256_AF15-scruffy_f18_swap. Priority:-1 extents:1 across:8388604k SS # swapon --discard /dev/disk/by-uuid/d8e4b4bf-9f1e-446a-a5b0-0325c4ef7d73 # dmesg | grep swap | tail -1 [773346.691092] Adding 8388604k swap on /dev/mapper/M4_CT256_AF15-scruffy_f18_swap. Priority:-1 extents:1 across:8388604k SSD More importantly, my /etc/fstab lists that partition with the 'discard' option, and at boot time the option is ignored (presumably because of systemd): # dmesg | grep swap | head -1 [ 2.527089] Adding 8388604k swap on /dev/mapper/M4_CT256_AF15-scruffy_f18_swap. Priority:-1 extents:1 across:8388604k SS So this is more of a general systemd/bootup problem. As per http://cgit.freedesktop.org/systemd/systemd/tree/src/core/swap.c this is not currently a supported feature in systemd. (In reply to Carl Roth from comment #1) > If the dmesg results are to be believed, I think this is the difference > between 'discard' and 'no discard' (see the 'D' flag): Found it at http://lxr.free-electrons.com/source/mm/swapfile.c?v=3.9#L2136 Does "swapon -a" read this from fstab? We should probably support the same syntax. (In reply to Lennart Poettering from comment #4) > Does "swapon -a" read this from fstab? We should probably support the same > syntax. Yes, see https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/sys-utils/swapon.c#n640 http://cgit.freedesktop.org/systemd/systemd/commit/?id=86b23b07c96b185126bfbf217227dad362a20c25 http://cgit.freedesktop.org/systemd/systemd/commit/?id=4f52d3fe2da7c3449b7fbfaa7c64a83354d3b56c http://cgit.freedesktop.org/systemd/systemd/commit/?id=cdc8982030271785d650af410230397bbb5a4be9 http://cgit.freedesktop.org/systemd/systemd/commit/?id=4afbccded23f5144e39a7f7b243393799186ba39 |