[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52a7baf4-5235-4b51-b1fb-d9bc9250794d@lucifer.local>
Date: Tue, 18 Mar 2025 15:18:41 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
David Hildenbrand <david@...hat.com>,
Matthew Wilcox <willy@...radead.org>, Rik van Riel <riel@...riel.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] tools/testing: add PROCMAP_QUERY helper functions in
mm self tests
On Mon, Mar 17, 2025 at 09:15:04PM +0000, Lorenzo Stoakes wrote:
> The PROCMAP_QUERY ioctl() is very useful - it allows for binary access to
> /proc/$pid/[s]maps data and thus convenient lookup of data contained there.
>
> This patch exposes this for convenient use by mm self tests so the state of
> VMAs can easily be queried.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Quick fix on this:
----8<----
>From 02d674de3736e3726a97a27625d4598c3d49d08a Mon Sep 17 00:00:00 2001
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Date: Tue, 18 Mar 2025 15:16:29 +0000
Subject: [PATCH] correctly return errno
---
tools/testing/selftests/mm/vm_util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c
index 891ce17453cd..1357e2d6a7b6 100644
--- a/tools/testing/selftests/mm/vm_util.c
+++ b/tools/testing/selftests/mm/vm_util.c
@@ -440,7 +440,7 @@ int open_procmap(pid_t pid, struct procmap_fd *procmap_out)
procmap_out->query.size = sizeof(procmap_out->query);
procmap_out->fd = open(path, O_RDONLY);
if (procmap_out < 0)
- ret = errno;
+ ret = -errno;
return ret;
}
@@ -451,7 +451,7 @@ int query_procmap(struct procmap_fd *procmap)
int ret = 0;
if (ioctl(procmap->fd, PROCMAP_QUERY, &procmap->query) == -1)
- ret = errno;
+ ret = -errno;
return ret;
}
--
2.48.1
Powered by blists - more mailing lists