* [PATCH 2/4] selftests/proc: expand smaps field coverage and require TMPFS
2026-07-15 14:36 [PATCH 1/4] mm: vmpressure: scale sampling window with machine size deepakraog
@ 2026-07-15 14:36 ` deepakraog
2026-07-15 14:36 ` [PATCH 3/4] mm: vrealloc: grow vm_area mappings in place deepakraog
2026-07-15 14:36 ` [PATCH 4/4] ceph: release unused cap reservation on readdir error deepakraog
2 siblings, 0 replies; 5+ messages in thread
From: deepakraog @ 2026-07-15 14:36 UTC (permalink / raw)
To: Shuah Khan, linux-kernel, linux-fsdevel, linux-kselftest
Gate the test on CONFIG_TMPFS in the selftest config file. Assert
Private_Clean, Private_Dirty, Swap, and SwapPss fields are present in
/proc/$PID/smaps output for the mapped executable page.
Signed-off-by: deepakraog <gaikwad.dcg@gmail.com>
---
tools/testing/selftests/proc/config | 1 +
tools/testing/selftests/proc/proc-pid-vm.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/proc/config b/tools/testing/selftests/proc/config
index 68fbd2b35..7dfc3d381 100644
--- a/tools/testing/selftests/proc/config
+++ b/tools/testing/selftests/proc/config
@@ -1 +1,2 @@
CONFIG_PROC_FS=y
+CONFIG_TMPFS=y
diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c
index 4e6a3e53f..59535bb3a 100644
--- a/tools/testing/selftests/proc/proc-pid-vm.c
+++ b/tools/testing/selftests/proc/proc-pid-vm.c
@@ -20,7 +20,6 @@
* Test /proc/$PID/smaps_rollup
* Test /proc/$PID/statm
*
- * FIXME require CONFIG_TMPFS which can be disabled
* FIXME test other values from "smaps"
* FIXME support other archs
*/
@@ -409,6 +408,10 @@ int main(void)
"AnonHugePages: 0 kB\n",
"Shared_Hugetlb: 0 kB\n",
"Private_Hugetlb: 0 kB\n",
+ "Private_Clean: 4 kB\n",
+ "Private_Dirty: 0 kB\n",
+ "Swap: 0 kB\n",
+ "SwapPss: 0 kB\n",
"Locked: 0 kB\n",
};
int i;
--
Deepak Rao Gaikwad
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] mm: vrealloc: grow vm_area mappings in place
2026-07-15 14:36 [PATCH 1/4] mm: vmpressure: scale sampling window with machine size deepakraog
2026-07-15 14:36 ` [PATCH 2/4] selftests/proc: expand smaps field coverage and require TMPFS deepakraog
@ 2026-07-15 14:36 ` deepakraog
2026-07-15 14:36 ` [PATCH 4/4] ceph: release unused cap reservation on readdir error deepakraog
2 siblings, 0 replies; 5+ messages in thread
From: deepakraog @ 2026-07-15 14:36 UTC (permalink / raw)
To: Andrew Morton, Uladzislau Rezki, linux-mm, linux-kernel
When vrealloc() needs more pages than are currently mapped, allocate and
map additional pages at the end of the existing vm_area instead of
always allocating a new area and memcpy()'ing. Fall back to the
existing realloc path when in-place grow is not possible.
Signed-off-by: deepakraog <gaikwad.dcg@gmail.com>
---
mm/vmalloc.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1afca3568..46cf10c62 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -4426,8 +4426,56 @@ void *vrealloc_node_align_noprof(const void *p, size_t size, unsigned long align
return (void *)p;
}
+ {
+ unsigned int new_nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
+ unsigned int old_nr_pages = vm->nr_pages;
+
+ if (new_nr_pages > old_nr_pages && !vm_area_page_order(vm) &&
+ !(vm->flags & (VM_FLUSH_RESET_PERMS | VM_USERMAP)) &&
+ gfp_has_io_fs(flags)) {
+ unsigned int extra = new_nr_pages - old_nr_pages;
+ unsigned long addr = (unsigned long)kasan_reset_tag(p);
+ struct vmap_node *vn = addr_to_node(addr);
+ struct page **pages;
+ int ret;
+
+ pages = kvmalloc_array(extra, sizeof(struct page *), gfp);
+ if (!pages)
+ goto need_realloc;
+
+ if (vm_area_alloc_pages(vmalloc_gfp_adjust(gfp, 0), nid,
+ 0, extra, pages) != extra) {
+ kvfree(pages);
+ goto need_realloc;
+ }
+
+ spin_lock(&vn->busy.lock);
+ ret = vmap_pages_range(addr + ((unsigned long)old_nr_pages
+ << PAGE_SHIFT),
+ addr + ((unsigned long)new_nr_pages
+ << PAGE_SHIFT),
+ PAGE_KERNEL, pages, PAGE_SHIFT);
+ spin_unlock(&vn->busy.lock);
+ if (ret < 0) {
+ free_pages_bulk(pages, extra);
+ kvfree(pages);
+ goto need_realloc;
+ }
+
+ memcpy(&vm->pages[old_nr_pages], pages,
+ extra * sizeof(struct page *));
+ kvfree(pages);
+ vm->nr_pages = new_nr_pages;
+ vm->requested_size = size;
+ kasan_vrealloc(p, old_size, size);
+ if (want_init_on_alloc(flags))
+ memset((void *)p + old_size, 0, size - old_size);
+ return (void *)p;
+ }
+ }
+
need_realloc:
- /* TODO: Grow the vm_area, i.e. allocate and map additional pages. */
+ /* Fall back to a fresh vm_area when in-place grow is not possible. */
n = __vmalloc_node_noprof(size, align, flags, nid, __builtin_return_address(0));
if (!n)
--
Deepak Rao Gaikwad
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 4/4] ceph: release unused cap reservation on readdir error
2026-07-15 14:36 [PATCH 1/4] mm: vmpressure: scale sampling window with machine size deepakraog
2026-07-15 14:36 ` [PATCH 2/4] selftests/proc: expand smaps field coverage and require TMPFS deepakraog
2026-07-15 14:36 ` [PATCH 3/4] mm: vrealloc: grow vm_area mappings in place deepakraog
@ 2026-07-15 14:36 ` deepakraog
2026-07-15 17:51 ` Viacheslav Dubeyko
2 siblings, 1 reply; 5+ messages in thread
From: deepakraog @ 2026-07-15 14:36 UTC (permalink / raw)
To: Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, ceph-devel, linux-kernel
ceph_readdir_prepopulate() can exit with an error after partially
consuming the request's cap reservation. Return unused reserved caps to
the MDS client pool on the error path so they are not held until request
teardown.
Signed-off-by: deepakraog <gaikwad.dcg@gmail.com>
---
fs/ceph/inode.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 61d7c0b81..2d6a80054 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2188,6 +2188,8 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
dput(dn);
}
out:
+ if (err)
+ ceph_unreserve_caps(req->r_mdsc, &req->r_caps_reservation);
if (err == 0 && skipped == 0) {
set_bit(CEPH_MDS_R_DID_PREPOPULATE, &req->r_req_flags);
req->r_readdir_cache_idx = cache_ctl.index;
--
Deepak Rao Gaikwad
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 4/4] ceph: release unused cap reservation on readdir error
2026-07-15 14:36 ` [PATCH 4/4] ceph: release unused cap reservation on readdir error deepakraog
@ 2026-07-15 17:51 ` Viacheslav Dubeyko
0 siblings, 0 replies; 5+ messages in thread
From: Viacheslav Dubeyko @ 2026-07-15 17:51 UTC (permalink / raw)
To: deepakraog, Ilya Dryomov, Alex Markuze, ceph-devel, linux-kernel
On Wed, 2026-07-15 at 20:06 +0530, deepakraog wrote:
> ceph_readdir_prepopulate() can exit with an error after partially
> consuming the request's cap reservation. Return unused reserved caps
> to
> the MDS client pool on the error path so they are not held until
> request
> teardown.
The ceph-devel list has received only 4/4 patch. Is it some patchset?
If so, then why we haven't received the rest patches in series?
Do you have any issue related to the fix? How have you encountered the
issue? Could you please explain more about the issue?
Thanks,
Slava.
>
> Signed-off-by: deepakraog <gaikwad.dcg@gmail.com>
> ---
> fs/ceph/inode.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index 61d7c0b81..2d6a80054 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -2188,6 +2188,8 @@ int ceph_readdir_prepopulate(struct
> ceph_mds_request *req,
> dput(dn);
> }
> out:
> + if (err)
> + ceph_unreserve_caps(req->r_mdsc, &req-
> >r_caps_reservation);
> if (err == 0 && skipped == 0) {
> set_bit(CEPH_MDS_R_DID_PREPOPULATE, &req-
> >r_req_flags);
> req->r_readdir_cache_idx = cache_ctl.index;
^ permalink raw reply [flat|nested] 5+ messages in thread