From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a17d6b8c66-fa71b243-6c44-4564-80b3-75bfebb1f4ec-000000@eu-central-1.amazonses.com> Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11020126.outbound.protection.outlook.com [52.101.69.126]) by lore.virtuozzo.com (Postfix) with ESMTPS id 1338A8017D for ; Tue, 27 Oct 2026 12:52:49 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V4CcQXhRa5h14GZSg01Jh6gkwYVsxnWIDJ1zfbHfKWyhgTHDY0tL4ry/INnnAXCSE/R7zxp+qcQX2cVLbr6tNjai92xssU9VGWzqSFbnlnkS5km6Vwd2Ug8yvd5fhjecztD94xmYFIPT4eRF5DsBgfWgXgaSjcCyw8+41UW+jrw3GnYOpBG0FIPF1W8I7uEPiroAGTH/OPSVNQCWdYVdWzN4eObCcAIP+fpvOpLHNEfTk9m7VQAenaymANK0JSpc9vw3fLFQYuJQQapz+LSwH9wbtaXw0zJ2BruNGO3q5oUVYy6jwTpWNHyoBvInTwlBHkIW5xUPWjpyLQg4JsQF3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R5v0RdqCicfroWm76zqjEZpXPIQxW8nPFkt/TnysdE8=; b=ivA3kOlaRMcL9B9UE9KaojQDTeD4DUTzLINkFUYcDzcJaykhepXTgtqIKMrqrYA8b1Gi57BH1u14XN7AGKlRcR++4XaCKQGklbUzDBMzvJs6n5etlLUGUdXwkLdRS2lk0y1YTjL2RjID7fW2BPs+Zz36fjRVilfD47PwW5XAz7bar+4/41WLbMUAxAynvXH2J+ssdtilrxe3DM/e894lmxq3vA1VyXE+NnzKrceQVFtAhujLSZ3fS9ecf8I2/uYmyUfUKSNz4z9DBClnqd8W3ExuTm9roJyCzfOY75hY2et9jcdLXXR4GHUT3ODpoVYGdKRExXBVmruP/u8ourjRyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.2) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=eu-central-1.amazonses.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=amazonses.com; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R5v0RdqCicfroWm76zqjEZpXPIQxW8nPFkt/TnysdE8=; b=C7oCZpG/UtKFVPcNyqQp5q39wqMiN6Y6plNcZNKQBnck60fM/5AZ+VAQmyBlUvIGvg2G2oPktxULJvYP5lgwK6Hko/DjI0wwBLQ0oFTITPziaHRjhPdW+xW5qg+xRF406Id8T1jetcFr2Gd8mEGzRKmZQbBUJxw58+5qkQxvf0Q= Received: from AS4PR10CA0012.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::15) by AS4PR08MB7553.eurprd08.prod.outlook.com (2603:10a6:20b:4fb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Tue, 27 Oct 2026 12:52:43 +0000 Received: from AMS1EPF0000008D.eurprd05.prod.outlook.com (2603:10a6:20b:5dc:cafe::9) by AS4PR10CA0012.outlook.office365.com (2603:10a6:20b:5dc::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.546.22 via Frontend Transport; Tue, 27 Oct 2026 12:52:43 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.2) smtp.mailfrom=eu-central-1.amazonses.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com;dkim=pass (signature was verified) header.d=amazonses.com;dmarc=pass action=none header.from=sashiko.virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of eu-central-1.amazonses.com designates 69.169.224.2 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.2; helo=b224-2.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-2.smtp-out.eu-central-1.amazonses.com (69.169.224.2) by AMS1EPF0000008D.mail.protection.outlook.com (10.167.242.84) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.569.4 via Frontend Transport; Tue, 27 Oct 2026 12:52:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1793105562; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ruEJd9OKsTATPazLN12jPh5nSlbtFbTwKNB/+GXmVKs=; b=IPHwNHj8ekX9YkEQicXGZ2Qra4xcRQvH2Y8pzuqVHXQCL5Vifn6kUTHYoPblGzih HZZMNZw9n/O4cp56fvt0u5gtStHx50zu03vcwFhLv5hKtE68Q52Dw4Jodst7X3gYxXa PWmBIrt2VFI8R5rUz91eivIasSCd+pIp1x6382c9KtI0PlhorBFn6V0WjSMiinl2J5z nd3PN3kQx/phVOY0Dt7MEGAcGRHQA4T9CStrLYM2c4uLbnDk7Q9vnVyFxSG7YjrJJvO tV+NLQDIGxyZp0OeV/ALJlEq+FewdxaSZrBPcTtThtMFaMSnc1Xy+JNI5sGdUPR0+g6 h4dGCyTHGQ== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1793105562; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=ruEJd9OKsTATPazLN12jPh5nSlbtFbTwKNB/+GXmVKs=; b=aYPFLkyP8TZQYtsDbZ6GBrg90qiS7v/MJF6hVn9iBNcsN6jpoudoPbNA9EizuYSv Re0Nw5ie+asfq8rwvb0CJMSYdvY8+6ZSPe+EvkdkLvDFrpq1xEBbGHVWEH526tuOAgW cGYX/D0AHm7JM4oFyREJWD+l93fPBXj4da+dkrKQ= Message-ID: <010701a17d6b8c66-fa71b243-6c44-4564-80b3-75bfebb1f4ec-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH hci-8.1 v2 1/2] vhost-blk: create kernel threads with the mainstream worker ioctls To: andrey.zhadchenko@virtuozzo.com, Alexander Ivanov Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com In-Reply-To: <20261027124759.2979043-2-alexander.ivanov@virtuozzo.com> References: <20261027124759.2979043-1-alexander.ivanov@virtuozzo.com> <20261027124759.2979043-2-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 27 Oct 2026 12:52:42 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.27-69.169.224.2 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS1EPF0000008D:EE_|AS4PR08MB7553:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1eb5bc2f-26bf-4568-a481-08df3429311a X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704161411799003|376014|48200799018|61400799027|9140799003|32142699015|261026140227099003|5023799004|4143699003|56012099006|5063699009|261022105027099003|261009223027099003|261009221227099003|10067099003|261021121427099003|16102099003|18002099003|22082099003|55112099003|4113699003|5113699003|13003099007; X-Microsoft-Antispam-Message-Info: NxZq5isdlXRScL0MkssvLSny7/OT36vo3ziX4Xbi2HP3fhzVJgg8pOLYq0CfIeHJMwAOtn7HEr5pjidDeCfCutKzZtRR6g8UqveE94v9TjLVEQXF93C3WlYd3kCwzWT9wKYqVYNTnxIFVX7/9lROURHBosWrY08ExISdngB1eJNr24Ju7te6xyTT/tze7/Hn8njlGb/Z25jQPR8FqmeNEL8tTooBfz9XAIe1VyR2VIL3FTdKPRrxGfiCXyjWMhU38+5lJyqY/vocKTmMIC63/DK7oyTPXm1msWh0oNfRPQgxLfCANdPg3aZwWY5U5pNWhdTProcx5ef4sq2RQ7NPI8BHYAwJi5VCEQGfn2GlISWWfGGzWXffhWcLh7s0vwG0+8ogPWC7/i2+SAt++BMdIx/M/+PdP5pWINsWoHMzHjR58zWja4lkttGBE8+f02/VBj5auiyKjxSGY17yaatNa0GcMsncW9l2F+QXa3SDkpzXMxXIvDJPE9kQ9CX380sCPke3OQm8f+lIgUQxioIlbLNxGXABfmHunB5PEYKimOgCJNaDrGVpwBnk1NAAUYQef0vvvtVT9vc3ghx7L+sh7wNIzpqmprG+HkutRQumucB6ZNvZv45cW9J9YaB4n91/zEsN3Fu/PePhWDKcxppaUEWu12vCoW8zeOlntZ9dvKDsCynllgq69i98TIpn2YPEebhUP8v08jve+7cBwnTjYAtEu7B+FqyVsJhSAz+LFZ+4ThUloVnkesInOruAcLSaI6IbHlNzdtw29zk/1J9nWwUhPFi7mk6IF+xJVON/WM+orC69TwqIlJehWnBpSu40noYhjp10iNy7N/yijVih65vMRE4G6RzCu2lFkgIjpPq7obhkSzbjwM7Tx+d47pImSYsBSCb1zrlvHfI7u8zKTixS8IBaXoqknIutp+TIf9dkXEPnm/o0rZEhCTNYWyfB X-Forefront-Antispam-Report: CIP:69.169.224.2;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-2.smtp-out.eu-central-1.amazonses.com;PTR:b224-2.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(704161411799003)(376014)(48200799018)(61400799027)(9140799003)(32142699015)(261026140227099003)(5023799004)(4143699003)(56012099006)(5063699009)(261022105027099003)(261009223027099003)(261009221227099003)(10067099003)(261021121427099003)(16102099003)(18002099003)(22082099003)(55112099003)(4113699003)(5113699003)(13003099007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ckb6fT2PLCr93Kz/KnhZ/b5/DWWLMwVP60+0DLuhjDBg+zEhI/IFxt18HOTBihjlWBqUcD9+Qy8UVlfSovHayn9MYs1FdFxFemItlE5oUt35vg8q4U+dXxEQsPu1tIoU0BNXlxOfz0SujVjJtG29XxwoV3S7X/x/sbNr0kRja4lsFqy7CACqVjLo5U7ZNP3FncUDBBZoevjF/CCyxz3vN5jy+hdmfe/dMaR0Iul8Zaa0pLewiF0hlgZF/xM4JX4FlXvDaFRvGz4L/Sw/p5m3l5SSPSjJEm6kU4NYI0/DQPbAK0+ayqntfAk1mcKIzwfNnesazgscAMpD7GKxdhOdaUKby3fGRv0Y6hv4lfcDyP5P2PCu4dQJxXiTWBuI1TkETRsXl/2j3o5z8Bj/IA73D03xxch83P26gjn4hy4ITe32ErYQyj/xrWETPIuRk4jW X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2026 12:52:43.1365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1eb5bc2f-26bf-4568-a481-08df3429311a X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: AMS1EPF0000008D.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7553 Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] vhost-blk: num-threads=3D0 silently accepted as one thread, no vali= dation -- Commit b390c3229288ae4b409cac07cdeba78f79d9b1e7 Author: Alexander Ivanov vhost-blk: create kernel threads with the mainstream worker ioctls This patch replaces the VHOST_SET_NWORKERS ioctl in vhost_blk_start() with VHOST_SET_FORK_FROM_OWNER, VHOST_NEW_WORKER and VHOST_ATTACH_VRING_WORKER. It creates num-threads - 1 extra workers and attaches them to the virtqueues round-robin. If the kernel lacks these ioctls, it warns and runs a single thread. Link: https://virtuozzo.atlassian.net/browse/VSTOR-107537 > diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c > --- a/hw/block/vhost-blk.c > +++ b/hw/block/vhost-blk.c [ ... ] > @@ -51,15 +97,37 @@ static int vhost_blk_start(VirtIODevice *vdev) > return 0; > } > =20 > + nworkers =3D MIN(s->conf.num_threads, s->dev.nvqs); > + if (nworkers > 1) { [Severity: Low] This isn't a crash, but the new code changes how num-threads=3D0 and values above the queue count are handled. Is that intended? Before this patch, vhost_blk_start() passed nworkers to VHOST_SET_NWORKERS whenever it was not 1. A value of 0 was therefore passed to the kernel, and as far as I can tell start failed with "unable to set number of kernel threads". I could not check how the kernel handled 0. Now nworkers =3D MIN(num_threads, nvqs) evaluates to 0 for num-threads=3D0,= so "nworkers > 1" is false. The device starts silently with a single kernel thread, as if num-threads=3D1 had been given. The same happens when num-threads is larger than the number of queues. The count is clamped to nvqs and no diagnostic is printed. The num-threads property is DEFINE_PROP_UINT16 with a default of 1, and vhost_blk_device_realize() only validates num_queues. Nothing checks num_threads there either. Should realize reject num-threads=3D0, and should it warn or fail when num-threads exceeds num-queues? --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026102712475= 9.2979043-1-alexander.ivanov@virtuozzo.com?part=3D1