From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>,
Matthew Wilcox <willy@infradead.org>,
Nicholas Piggin <npiggin@gmail.com>,
Uladzislau Rezki <urezki@gmail.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 6/7] mm/vmalloc: Use a trace_free_vmap_area_noflush event
Date: Mon, 17 Oct 2022 18:02:32 +0200 [thread overview]
Message-ID: <20221017160233.16582-9-urezki@gmail.com> (raw)
In-Reply-To: <20221017160233.16582-1-urezki@gmail.com>
It is for a debug purpose and is called when a vmap area
gets freed. This event gives some indication about:
- a start address of released area;
- a current number of outstanding pages;
- a maximum number of allowed outstanding pages.
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
mm/vmalloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 912abcd6e8b4..df4fd6674ced 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1822,6 +1822,8 @@ static void drain_vmap_area_work(struct work_struct *work)
*/
static void free_vmap_area_noflush(struct vmap_area *va)
{
+ unsigned long nr_lazy_max = lazy_max_pages();
+ unsigned long va_start = va->va_start;
unsigned long nr_lazy;
spin_lock(&vmap_area_lock);
@@ -1839,8 +1841,10 @@ static void free_vmap_area_noflush(struct vmap_area *va)
&purge_vmap_area_root, &purge_vmap_area_list);
spin_unlock(&purge_vmap_area_lock);
+ trace_free_vmap_area_noflush(va_start, nr_lazy, nr_lazy_max);
+
/* After this point, we may free va at any time */
- if (unlikely(nr_lazy > lazy_max_pages()))
+ if (unlikely(nr_lazy > nr_lazy_max))
schedule_work(&drain_vmap_work);
}
--
2.30.2
next prev parent reply other threads:[~2022-10-17 16:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 16:02 [PATCH 0/7] Add basic trace events for vmap/vmalloc Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 1/7] mm: vmap: Add alloc_vmap_area trace event Uladzislau Rezki (Sony)
2022-10-18 16:41 ` Steven Rostedt
2022-10-18 16:57 ` Uladzislau Rezki
2022-10-17 16:02 ` [PATCH 2/7] mm: vmap: Add a purge_vmap_area_lazy " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 2/7] mm: vmap: Add " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 3/7] mm: vmap: Add a free_vmap_area_noflush " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 3/7] mm: vmap: Add " Uladzislau Rezki (Sony)
2022-10-17 16:02 ` [PATCH 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event Uladzislau Rezki (Sony)
2022-10-17 19:12 ` kernel test robot
2022-10-18 16:17 ` Uladzislau Rezki
2022-10-18 16:44 ` Steven Rostedt
2022-10-18 16:55 ` Uladzislau Rezki
2022-10-17 16:02 ` [PATCH 5/7] mm/vmalloc: Use a trace_purge_vmap_area_lazy event Uladzislau Rezki (Sony)
2022-10-17 16:02 ` Uladzislau Rezki (Sony) [this message]
2022-10-17 16:02 ` [PATCH 7/7] vmalloc: Add reviewers for vmalloc code Uladzislau Rezki (Sony)
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=20221017160233.16582-9-urezki@gmail.com \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@gmail.com \
--cc=oleksiy.avramchenko@sony.com \
--cc=rostedt@goodmis.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).