Skip to content

xenbus/backend: Add a memory pressure handler callback

SeongJae Park linux-block lkml xen-devel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest4 patches 3 repliesIn review
  2. v83 patches 2 repliesSuperseded
  3. v7 posting 2/23 patches 10 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v7 posting 1/20 of 2 patches0 repliesSuperseded
v6 posting 2/23 patches4 repliesSuperseded
v6 posting 1/20 of 2 patches0 repliesSuperseded
v52 patches11 repliesSuperseded

Changes in v9 from the cover letter

(https://lore.kernel.org/xen-devel/[email protected]/)
- Drop 'Reviewed-by: Juergen' from the second patch
(suggested by Roger Pau Monné)
- Update contact of the new module param to SeongJae Park <[email protected]> (suggested by Roger Pau Monné)
- Wordsmith the description of the parameter
(suggested by Roger Pau Monné)
- Fix dumb bugs
(suggested by Roger Pau Monné)
- Move module param definition to xenbus.c and reduce the number of lines for this change
(suggested by Roger Pau Monné)
- Add a comment for the new callback, reclaim_memory, as other callbacks also have
- Add another trivial cleanup of xenbus.c file (4th patch)

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xenbus/backend: Add memory pressure handler callbackdrivers/xen/xenbus/xenbus_probe_backend.c include/xen/xenbus.h+33 -00 replies
2/4xen/blkback: Squeeze page pools if a memory pressure is detectedDocumentation/ABI/testing/sysfs-driver-xen-blkback drivers/block/xen-blkback/blkback.c drivers/block/xen-blkback/common.h +1 more+36 -32 replies
3/4xen/blkback: Remove unnecessary static variable name prefixesdrivers/block/xen-blkback/blkback.c+17 -200 replies
4/4xen/blkback: Consistently insert one empty line between functionsdrivers/block/xen-blkback/xenbus.c+2 -51 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJuergen GrossRoger Pau Monné
1/4R-b R-b
2/4R-b
3/4R-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v9 thread

Cover letter [PATCH v9 0/4] xenbus/backend: Add a memory pressure handler callback

Granting pages consumes backend system memory. In systems configured with insufficient spare memory for those pages, it can cause a memory pressure situation. However, finding the optimal amount of the spare memory is challenging for large systems having dynamic resource utilization patterns. Also, such a static configuration might lack flexibility.

To mitigate such problems, this patchset adds a memory reclaim callback to 'xenbus_driver' (patch 1) and use it to mitigate the problem in 'xen-blkback' (patch 2). The third patch is a trivial cleanup of variable names.

Base Version
------------

This patch is based on v5.4. A complete tree is also available at my public git repo:
https://github.com/sjp38/linux/tree/blkback_squeezing_v9

Patch History
-------------

Changes from v8
(https://lore.kernel.org/xen-devel/[email protected]/)
- Drop 'Reviewed-by: Juergen' from the second patch
(suggested by Roger Pau Monné)
- Update contact of the new module param to SeongJae Park <[email protected]> (suggested by Roger Pau Monné)
- Wordsmith the description of the parameter
(suggested by Roger Pau Monné)
- Fix dumb bugs
(suggested by Roger Pau Monné)
- Move module param definition to xenbus.c and reduce the number of lines for this change
(suggested by Roger Pau Monné)
- Add a comment for the new callback, reclaim_memory, as other callbacks also have
- Add another trivial cleanup of xenbus.c file (4th patch)

Changes from v7
(https://lore.kernel.org/xen-devel/[email protected]/)
- Update sysfs-driver-xen-blkback for new parameter (suggested by Roger Pau Monné)
- Use per-xen_blkif buffer_squeeze_end instead of global variable (suggested by Roger Pau Monné)

Changes from v6
(https://lore.kernel.org/linux-block/[email protected]/)
- Remove more unnecessary prefixes (suggested by Roger Pau Monné)
- Constify a variable (suggested by Roger Pau Monné)
- Rename 'reclaim' into 'reclaim_memory' (suggested by Roger Pau Monné)
- More wordsmith of the commit message (suggested by Roger Pau Monné)

Changes from v5
(https://lore.kernel.org/linux-block/[email protected]/)
- Wordsmith the commit messages (suggested by Roger Pau Monné)
- Change the reclaim callback return type (suggested by Roger Pau Monné)
- Change the type of the blkback squeeze duration variable (suggested by Roger Pau Monné)
- Add a patch for removal of unnecessary static variable name prefixes (suggested by Roger Pau Monné)
- Fix checkpatch.pl warnings

Changes from v4
(https://lore.kernel.org/xen-devel/[email protected]/)
- Remove domain id parameter from the callback (suggested by Juergen Gross)
- Rename xen-blkback module parameter (suggested by Stefan Nuernburger)

Changes from v3
(https://lore.kernel.org/xen-devel/[email protected]/)
- Add general callback in xen_driver and use it (suggested by Juergen Gross)

Changes from v2
(https://lore.kernel.org/linux-block/[email protected])
- Rename the module parameter and variables for brevity (aggressive shrinking -> squeezing)

Changes from v1
(https://lore.kernel.org/xen-devel/[email protected]/)
- Adjust the description to not use the term, arbitrarily (suggested by Paul Durrant)
- Specify time unit of the duration in the parameter description, (suggested by Maximilian Heyne)
- Change default aggressive shrinking duration from 1ms to 10ms
- Merge two patches into one single patch

SeongJae Park (4):
xenbus/backend: Add memory pressure handler callback xen/blkback: Squeeze page pools if a memory pressure is detected xen/blkback: Remove unnecessary static variable name prefixes xen/blkback: Consistently insert one empty line between functions

 .../ABI/testing/sysfs-driver-xen-blkback      | 10 +++++
 drivers/block/xen-blkback/blkback.c           | 42 +++++++++----------
 drivers/block/xen-blkback/common.h            |  1 +
 drivers/block/xen-blkback/xenbus.c            | 26 +++++++++---
 drivers/xen/xenbus/xenbus_probe_backend.c     | 32 ++++++++++++++
 include/xen/xenbus.h                          |  1 +
 6 files changed, 86 insertions(+), 26 deletions(-)
Signature · 1 line
2.17.1