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>,
Steven Rostedt <rostedt@goodmis.org>,
Uladzislau Rezki <urezki@gmail.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: [PATCH v2 5/7] mm: vmalloc: Use trace_purge_vmap_area_lazy event
Date: Tue, 18 Oct 2022 20:10:51 +0200 [thread overview]
Message-ID: <20221018181053.434508-6-urezki@gmail.com> (raw)
In-Reply-To: <20221018181053.434508-1-urezki@gmail.com>
This is for debug purpose and is called when all outstanding
areas are removed back to the vmap space. It gives some extra
information about:
- a start:end range where set of vmap ares were freed;
- a number of purged areas which were backed off.
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
mm/vmalloc.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index aa86f21bfad0..4292f44ae670 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1731,6 +1731,7 @@ static void purge_fragmented_blocks_allcpus(void);
static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end)
{
unsigned long resched_threshold;
+ unsigned int num_purged_areas = 0;
struct list_head local_purge_list;
struct vmap_area *va, *n_va;
@@ -1742,7 +1743,7 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end)
spin_unlock(&purge_vmap_area_lock);
if (unlikely(list_empty(&local_purge_list)))
- return false;
+ goto out;
start = min(start,
list_first_entry(&local_purge_list,
@@ -1777,12 +1778,16 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end)
va->va_start, va->va_end);
atomic_long_sub(nr, &vmap_lazy_nr);
+ num_purged_areas++;
if (atomic_long_read(&vmap_lazy_nr) < resched_threshold)
cond_resched_lock(&free_vmap_area_lock);
}
spin_unlock(&free_vmap_area_lock);
- return true;
+
+out:
+ trace_purge_vmap_area_lazy(start, end, num_purged_areas);
+ return num_purged_areas > 0 ? true:false;
}
/*
--
2.30.2
next prev parent reply other threads:[~2022-10-18 18:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 18:10 [PATCH v2 0/7] Add basic trace events for vmap/vmalloc (v2) Uladzislau Rezki (Sony)
2022-10-18 18:10 ` [PATCH v2 1/7] mm: vmalloc: Add alloc_vmap_area trace event Uladzislau Rezki (Sony)
2022-10-20 11:22 ` Christoph Hellwig
2022-11-14 15:53 ` Steven Rostedt
2022-11-14 16:55 ` Uladzislau Rezki
2022-10-18 18:10 ` [PATCH v2 2/7] mm: vmalloc: Add purge_vmap_area_lazy " Uladzislau Rezki (Sony)
2022-10-20 11:22 ` Christoph Hellwig
2022-10-18 18:10 ` [PATCH v2 4/7] mm: vmalloc: Use trace_alloc_vmap_area event Uladzislau Rezki (Sony)
2022-10-20 11:23 ` Christoph Hellwig
2022-10-18 18:10 ` Uladzislau Rezki (Sony) [this message]
2022-10-20 11:25 ` [PATCH v2 5/7] mm: vmalloc: Use trace_purge_vmap_area_lazy event Christoph Hellwig
2022-10-20 12:55 ` Uladzislau Rezki
2022-10-23 22:51 ` kernel test robot
2022-10-24 12:48 ` Uladzislau Rezki
2022-10-18 18:10 ` [PATCH v2 6/7] mm: vmalloc: Use trace_free_vmap_area_noflush event Uladzislau Rezki (Sony)
2022-10-20 11:25 ` Christoph Hellwig
2022-10-18 18:10 ` [PATCH v2 7/7] vmalloc: Add reviewers for vmalloc code Uladzislau Rezki (Sony)
2022-10-20 11:25 ` Christoph Hellwig
2022-10-18 18:23 ` [PATCH v2 0/7] Add basic trace events for vmap/vmalloc (v2) Steven Rostedt
2022-10-18 18:25 ` Steven Rostedt
2022-10-19 11:49 ` Uladzislau Rezki
[not found] ` <20221018181053.434508-4-urezki@gmail.com>
2022-10-20 11:22 ` [PATCH v2 3/7] mm: vmalloc: Add free_vmap_area_noflush trace event Christoph Hellwig
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=20221018181053.434508-6-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