All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files
@ 2026-11-19 11:47 Denis V. Lunev
  2026-11-19 12:12 ` Alexander Ivanov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Denis V. Lunev @ 2026-11-19 11:47 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis; +Cc: devel

From: Denis V. Lunev <den@openvz.org>

ploop_add_delta() sizes each slot of the per-runner clone array with
sizeof(*file), a whole struct file, although the array holds struct
file pointers. With nkt_runners equal to nr_cpu_ids, a host with a few
hundred possible CPUs asks for a costly-order contiguous allocation,
which can fail under fragmentation and takes the table load down the
error path.

Size the slots by the element type.

https://virtuozzo.atlassian.net/browse/VSTOR-156035

Fixes: 762b90ec3324 ("dm-ploop: use filp per thread")
Feature: dm-ploop: ploop target driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---

Applies on top of "dm-ploop: fix a double fput of the delta file when
ploop_add_delta() fails".

 drivers/md/dm-ploop-bat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-ploop-bat.c b/drivers/md/dm-ploop-bat.c
index a2799f4aeb17..3a44f7480ff2 100644
--- a/drivers/md/dm-ploop-bat.c
+++ b/drivers/md/dm-ploop-bat.c
@@ -504,8 +504,8 @@ int ploop_add_delta(struct ploop *ploop, u32 level, struct file *file, bool is_r
 
 	ploop_apply_delta_mappings(ploop, deltas, level, &md_root, nr_be);
 
-	deltas[level].mtfile = kcalloc(ploop->nkt_runners, sizeof(*file),
-					GFP_KERNEL);
+	deltas[level].mtfile = kcalloc(ploop->nkt_runners,
+				       sizeof(*deltas[level].mtfile), GFP_KERNEL);
 	if (!deltas[level].mtfile) {
 		ret = -ENOMEM;
 		goto out;
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files
  2026-11-19 11:47 [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files Denis V. Lunev
@ 2026-11-19 12:12 ` Alexander Ivanov
  2026-11-19 16:05 ` Konstantin Khorenko
  2026-11-19 16:05 ` Konstantin Khorenko
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Ivanov @ 2026-11-19 12:12 UTC (permalink / raw)
  To: Denis V. Lunev, vasileios.almpanis; +Cc: devel

LGTM


Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files
  2026-11-19 11:47 [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files Denis V. Lunev
  2026-11-19 12:12 ` Alexander Ivanov
@ 2026-11-19 16:05 ` Konstantin Khorenko
  2026-11-19 16:05 ` Konstantin Khorenko
  2 siblings, 0 replies; 4+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 16:05 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: devel

Applying as is, after the double fput fix.

On Thu, 19 Nov 2026 12:47:29 +0100, Denis V. Lunev wrote:
> Size the slots by the element type.

Thanks.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files
  2026-11-19 11:47 [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files Denis V. Lunev
  2026-11-19 12:12 ` Alexander Ivanov
  2026-11-19 16:05 ` Konstantin Khorenko
@ 2026-11-19 16:05 ` Konstantin Khorenko
  2 siblings, 0 replies; 4+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 16:05 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis, Denis V. Lunev; +Cc: devel

On Thu, 19 Nov 2026 12:47:29 +0100, Denis V. Lunev wrote:
> dm-ploop: allocate the mtfile array as pointers, not struct files

Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.4.vz10, thanks!

[1/1] dm-ploop: allocate the mtfile array as pointers, not struct files
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e735e1a59942

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-19 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 11:47 [Devel] [PATCH hci-8.2] dm-ploop: allocate the mtfile array as pointers, not struct files Denis V. Lunev
2026-11-19 12:12 ` Alexander Ivanov
2026-11-19 16:05 ` Konstantin Khorenko
2026-11-19 16:05 ` Konstantin Khorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.