Bug 209563

Summary: Querying the options set up for a swap device
Product: Memory Management Reporter: Ulrich.Windl (Ulrich.Windl)
Component: OtherAssignee: Andrew Morton (akpm)
Status: NEW ---    
Severity: enhancement    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.3.18 Subsystem:
Regression: No Bisected commit-id:

Description Ulrich.Windl 2020-10-07 13:47:14 UTC
This enhancement request is related to bug 209543, and it is based on an answer (https://unix.stackexchange.com/a/613350/320598) to a corresponding question at unix.stackexchange.com.

Traditionally the only options for swap was "pri=".  More recently one is able to specify an "discard option", too.
However, while the priority can be queried via "swapon -s" or /proc/swaps, you cannot get the discard settings for a swap device (my experience and the answer cited seem to indicate).

Therefore I suggest to allow easy retrieval of the discard (actually: any) option for each swap device.