swap: allowing a more flexible DISCARD policy

Solution Verified - Updated -

Issue

Introducing SWAP_FLAG_DISCARD_PAGES and SWAP_FLAG_DISCARD_ONCE flags to allow more flexible swap discard policies being flagged through swapon(8).

The default behaviour is to keep both single-time, or batched, area discards (SWAP_FLAG_DISCARD_ONCE) and fine-grained discards for page-clusters (SWAP_FLAG_DISCARD_PAGES) enabled, in order to keep consistency with older kernel behaviour, as well as maintain compatibility with older swapon(8). However, through the new introduced flags the best suitable discard policy can be selected accordingly to any given swap device constraint.

Please note that swap discards are disabled by default. Those which would prefer to use discard on swap areas will have to deliberately turn it on.

Environment

  • Red Hat Enterprise Linux 6.7
  • Red Hat Enterprise Linux 7.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.