OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox