linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Andre Ramos <acastroramos1987@gmail.com>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, david@kernel.org,
	rostedt@goodmis.org
Subject: Re: [PATCH] mm: add Adaptive Memory Pressure Signaling (AMPRESS)
Date: Mon, 2 Mar 2026 11:48:33 +0000	[thread overview]
Message-ID: <7d5da04f-600b-41c6-8316-e86b0c3d00cc@lucifer.local> (raw)
In-Reply-To: <CALXtAv3u1hgLkBEbEgR3=r_iz3=KrnHB8B-=tg8Q3CEOWAPFiA@mail.gmail.com>

NAK.

This is a super questionable conceptual idea that isn't appropriate to submit as
a non-RFC patch.

I'm with David on this.

On Mon, Mar 02, 2026 at 12:45:33AM -0300, Andre Ramos wrote:
> Introduce /dev/ampress, a bidirectional fd-based interface for
> cooperative memory reclaim between the kernel and userspace.

There's just absolutely no way we'd expose anything like this as a character
device.

>
> Userspace processes open /dev/ampress and block on read() to receive
> struct ampress_event notifications carrying a graduated urgency level
> (LOW/MEDIUM/HIGH/FATAL), the NUMA node of the pressure source, and a
> suggested reclaim target in KiB. After freeing memory the process
> issues AMPRESS_IOC_ACK to close the feedback loop.

This is really not how we want to expose kernel interfaces. This seems like a
hack you'd implement internally rather than something we'd consider having in
mainline.

You're also inserting some new lock acquisitions and a linked list waking up
some unlimited number of threads on a core reclaim path - no.

>
> The feature hooks into balance_pgdat() in mm/vmscan.c, mapping the
> kswapd scan priority to urgency bands:
>   priority 10-12 -> LOW
>   priority  7-9  -> MEDIUM
>   priority  4-6  -> HIGH
>   priority  1-3  -> FATAL
>
> ampress_notify() is IRQ-safe (read_lock_irqsave + spin_lock_irqsave,
> no allocations) so it can be called from any reclaim context.
> Per-subscriber events overwrite without queuing to prevent unbounded
> backlog. A debugfs trigger at /sys/kernel/debug/ampress/inject allows
> testing without real memory pressure.

This is far too little description, especially given you're submitting
everything as one patch (which is not how kernel development is done).

The patch doesn't deal with MGLRU, and feels like a 'let's hook into one
specific part of mm and just dump out information to a random place'.

You could reasonably obtain the same information from BPF no?

>
> New files:
>   include/uapi/linux/ampress.h   - UAPI structs and ioctl definitions
>   include/linux/ampress.h        - internal header and ampress_notify()
>   include/trace/events/ampress.h - tracepoints for notify and ack
>   mm/ampress.c                   - miscdevice driver and core logic
>   mm/ampress_test.c              - KUnit tests (3/3 passing)
>   tools/testing/ampress/         - userspace integration and stress tests

This doesn't belong in a commit message.

>
> Signed-off-by: André Castro Ramos <acastroramos1987@gmail.com>
> ---
>  MAINTAINERS                            |  11 +
>  include/linux/ampress.h                |  34 +++
>  include/trace/events/ampress.h         |  70 ++++++
>  include/uapi/linux/ampress.h           |  40 ++++
>  mm/Kconfig                             |  26 ++
>  mm/Makefile                            |   2 +
>  mm/ampress.c                           | 320 +++++++++++++++++++++++++
>  mm/ampress_test.c                      | 124 ++++++++++
>  mm/vmscan.c                            |  27 +++
>  tools/testing/ampress/.gitignore       |   2 +
>  tools/testing/ampress/Makefile         |  21 ++
>  tools/testing/ampress/ampress_stress.c | 199 +++++++++++++++
>  tools/testing/ampress/ampress_test.c   | 212 ++++++++++++++++
>  13 files changed, 1088 insertions(+)

This is not how you submit patches, this needed to be broken up into a series,
submitting a single patch changing 13 files and adding 1,088 lines isn't how
kernel development works.

>  create mode 100644 include/linux/ampress.h
>  create mode 100644 include/trace/events/ampress.h
>  create mode 100644 include/uapi/linux/ampress.h
>  create mode 100644 mm/ampress.c
>  create mode 100644 mm/ampress_test.c
>  create mode 100644 tools/testing/ampress/.gitignore
>  create mode 100644 tools/testing/ampress/Makefile
>  create mode 100644 tools/testing/ampress/ampress_stress.c
>  create mode 100644 tools/testing/ampress/ampress_test.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 61bf550fd37..ea4d7861ff9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -16629,6 +16629,17 @@ F:    mm/memremap.c
>  F:    mm/memory_hotplug.c
>  F:    tools/testing/selftests/memory-hotplug/
>
> +ADAPTIVE MEMORY PRESSURE SIGNALING (AMPRESS)
> +M:    Darabat <playbadly1@gmail.com>
> +L:    linux-mm@kvack.org
> +S:    Maintained
> +F:    include/linux/ampress.h
> +F:    include/trace/events/ampress.h
> +F:    include/uapi/linux/ampress.h
> +F:    mm/ampress.c
> +F:    mm/ampress_test.c
> +F:    tools/testing/ampress/

As David said, it's really not proper to add yourself as a maintainer without a
track record in the kernel and community trust.

Maintainership is a serious responsibility and really requires that you have
both demonstrated consistent technical understanding and an ability to work with
the community.

Obviously as a new contributor, neither have been demonstrated.

Also there's an existing convention of 'MEMORY MANAGEMENT - xxx' for mm entries
in MAINTAINERS.

Thanks, Lorenzo


  parent reply	other threads:[~2026-03-02 11:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02  3:45 Andre Ramos
2026-03-02  8:52 ` David Hildenbrand (Arm)
2026-03-02 11:48 ` Lorenzo Stoakes [this message]
2026-03-02 15:11 ` Johannes Weiner
2026-03-02 15:38   ` Andre Ramos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d5da04f-600b-41c6-8316-e86b0c3d00cc@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=acastroramos1987@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox