From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11023114.outbound.protection.outlook.com [40.107.162.114]) by lore.virtuozzo.com (Postfix) with ESMTPS id BBC528017D for ; Tue, 17 Nov 2026 17:47:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wQgMmwTRjZYx9kwRQaGKGFJOQM4dvKFmQXKCKuz8uNGU054mkwemHNZ13fIVtx0oG1sZ5FQdtHH7n9qBCSfvg8ZstEU8r1+7K6TlygC05LNqigkLq0lMltJnVFkWEi/KVai35URWqThtppXNYdHE2ySawJjmKohP4TimwPuMqYbNj/BqwnCG88W1yo3Fj/8oXhACjLCJbO1XFjwSrknFEULoqr9bnw0kewMFHF2HiwCOw8hP7iMX4S4NMmL5cHbHcx9DGW9FZjGBERSQ7T/zP/trco0A6cCgOofpQa4Icmflw4wXpwFd8HkMR68OwOvY5qWDqssGuRj7F9M+oYVkCw== 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=ottFG2/3DhwyoSVxhkuKYp6dVlI3ul0BImj1sEHF5Zo=; b=fLsMfip4HF3Xw8e1k3jgKMN0nPkjG+xkqd2KqONxZvc3Pt4NGsgxLgDuTEf268ZEKsahomRQ67v2O6Jc3l1cEjbMKqCXg8SbMQsr26e7B2WIfMSdyCf/Eb8EllXGTurGIuAjYYTVc6J9S4+mrz5ufCIYbIaA/4rVbaKvSwTls/niFfHOeCPw1bZqZ7xk5a7MN3Bd6Sfh8WNAmZcElbNpIblXrf/ZQvVaDK4+n+uC4lpKIAwcFUUvYZvvmwwrLD+NRpOtuXVHzodiscl1KIe0BrQVBWO3Ikj/4ItzbkRY+NZqKJAzz2E87EAzrx0o6NRg74zjXtokhQrt/U21kJ1uNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.6) 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=ottFG2/3DhwyoSVxhkuKYp6dVlI3ul0BImj1sEHF5Zo=; b=NP345tP5GOrNi6dbSIEWPx1xeosjUW8RF1pAVuH9uUSMKg0H323Pyl0QuyNdc3g0eyZEY3a1Czk1Zp0AdbL5Sgztm/S37OU4xvrrcGkedMDWldWKHOT9c23Ue/JJR+6dQXpibhDz/ThkN5WB3W9a2xUp51Q0I4wl3i0PsXYG6XI= Received: from DUZP191CA0027.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::16) by PAVPR08MB8941.eurprd08.prod.outlook.com (2603:10a6:102:328::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.14; Tue, 17 Nov 2026 17:47:52 +0000 Received: from DB1PEPF000509F7.eurprd02.prod.outlook.com (2603:10a6:10:4f8:cafe::19) by DUZP191CA0027.outlook.office365.com (2603:10a6:10:4f8::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.14 via Frontend Transport; Tue, 17 Nov 2026 17:47:50 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.6) 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.6 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.6; helo=b224-6.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-6.smtp-out.eu-central-1.amazonses.com (69.169.224.6) by DB1PEPF000509F7.mail.protection.outlook.com (10.167.242.153) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.4 via Frontend Transport; Tue, 17 Nov 2026 17:47:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1794937669; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=zs01xCCto3ZP0oQe43yNoN0SlC2M9UQDfrv0Nde5+HI=; b=xCUzoQrYPlfoC6YuZs2mHVDu7OVwCYu4YfPcbF++ijgL8wD+pCqdztY2qOckVmVJ lLop5NC0C9oSOiT1vKHPcQ9iT3S9TyLw9y/ZDB2Uy2GGWP5UoZU/OgSMjKitHoyDrhr HHugWVfAAMn928G353QuVpiC07D9TcOxzutEAF2J2YCd3mMjM1h0UNuZIDLx/mpT8Ts n++lDAev3429z5RaAArhdALYEiTkpEf4UoJbTc6r8jXVO7eGH/w4KJ1grhdipZ3Uq7f bvTgmhz4O7OYJyGayRUJNKbSGuNdnuKi6qLWDxSkW3gUv/p0bpYHgZRCOgc8ibViEKx xl/d+NZ56Q== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1794937669; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=zs01xCCto3ZP0oQe43yNoN0SlC2M9UQDfrv0Nde5+HI=; b=Fo+c+XlmbNY/ZcLwO9afCpRR/42OOIwkbOu5l5yDdk/0eSz9qp97LRpo0V9V2Dnw hxrtZC2x/pi5JvWKeVGGtESz2xbGtianVQXGwvzSBLVxkSDPaqrLuBvFRHbSD70vVzH L061n/+eOhNf2UqHpWqHtmM/zmPCvMn5Gv1E40sQ= Message-ID: <010701a1ea9f47c8-3aaae176-4d7e-4af5-a213-91567ef96db8-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH hci-8.1 v6 6/7] vhost-blk: create kernel threads with the mainstream worker ioctls To: Alexander Ivanov , andrey.zhadchenko@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com In-Reply-To: <20261117173734.3225443-7-alexander.ivanov@virtuozzo.com> References: <20261117173734.3225443-1-alexander.ivanov@virtuozzo.com> <20261117173734.3225443-7-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 17 Nov 2026 17:47:49 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.11.17-69.169.224.6 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F7:EE_|PAVPR08MB8941:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 44ee9461-8fb9-4928-a462-08df44d2e5f3 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|61400799027|376014|32142699015|48200799018|9140799003|18092099006|18002099003|22082099003|16102099003|4113699003|5113699003|261009221227099003|261009223027099003|55112099003|13003099007|5063699009|4143699003|56012099006|261102123227099003|261028144727099003|261026140227099003|261026121527099003|261021121427099003|261022075727099003|261022105027099003|10067099003; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ajRQUVlwemE1SmhSRE9tSm8rOGp5cEkva0NNRUN2VjNLOHBiRE1zSmVuRmts?= =?utf-8?B?djNiSkg0S1FCdnhDd25ZRXNSWHk5bUJxVUFRVGIvRGtPdVl4RzVpNlpMMGxx?= =?utf-8?B?Vjl2M2sySmgxZWNYM0l2L0N4SzU0ZWg2dmxHWVo3WGswRVNSbWJLR3NUS1NN?= =?utf-8?B?MTJ2S2EvK2YvcmVwSjhhRCt1aTVQMGZFeUI3L1ZjdjFDSGlZeWN0ZGg0anl0?= =?utf-8?B?eUJTck1TOEpRQUY4bHJLOG5XeE5Iby9JclJ3bzZmZDlkdkxlWUFpSUU5Myta?= =?utf-8?B?NUZxQWVxd2ZOOFNLYVpLd01pV2Y5T0JRRVpFWUJIRGJWT1I2YkpPVVp0cWg0?= =?utf-8?B?NnFxVXpVQi81TVA4VGhSdi8yUGZWMHRzMlB5MElnY08yL3kzd1RkRHB5VVVV?= =?utf-8?B?QWNmZHcrVGNEQjdHSCtlWFE4V2l1M2oya0lkdjFENlVvaEZmSk9IeHFVdmxM?= =?utf-8?B?L0FCVjhVbjIwVHdFcm9yTVpxcnUwMUd2R1VadVNvYVdkUUp6STZ5TWdSNHJS?= =?utf-8?B?SUlyNUFZWVk3eVFaMVE3UUFuOWFjKytOOGg2VE5QTWFwaTdqTC9OL0hPM0dS?= =?utf-8?B?RXFtN29ZZjdyTkVNbG5TZnhZMlNnRS81bnIreEt3bkRjU1JDUzhhekNhMjFx?= =?utf-8?B?Zm5XblBLeGdTUDJGUUNFRFdZV013T3MwYjJjRXZaQTRUNUo0dWRCN1MrQ25H?= =?utf-8?B?VU11Rm4xaCsxNDhRKzZ1ZTlpNFVHNE5mUmpWRnZpV2JmNEgvNnZ5TjRwWXVL?= =?utf-8?B?TG9BeHE0T2NmazkwY3M3SlZ4WjE1enF5K0FReGh4all1T212K3hRSXdlRmhu?= =?utf-8?B?N0JuOURxSGpQcmRhaGZiVE8xcGcwU09ZMkpaUUdTMnJZSlhsb0pNeXFRampk?= =?utf-8?B?WGtpUVFYSGd4ejVvWFB1SXpNbzhBelFmY0lja1kyeU1yTjJUeXN3YUF2NGMr?= =?utf-8?B?N2NhSGloamVXRGtlQ0ZDdXpmTVZnQ2w4aEhKOTdsY1FhT2VUelI3WkxrWEFG?= =?utf-8?B?a0NIZjBnRUlycUxoQ2ZST1FYUGVVU20rWkZEcXFCMHFGWVlhYnlOa0VtRW93?= =?utf-8?B?VFgrem1xMmNaN3FnSmlvZFQ4aUxuSXY4ckora1I1K1YzYWM3SHgrMGR3WDlj?= =?utf-8?B?L3RBVlZudUFCanFYQVkyTE9CMmtvYkFQeFJMNDE0TFZjUlBzSkZzczNIRUJw?= =?utf-8?B?dEMzaFpJSUp3RGQxWUhsbUx4UlRnSjVvWnNOTUVZMTFxV01YMUp3SFVsRy9Q?= =?utf-8?B?N2NJeUZreE9kL1BaeitGbkdGcUlpSzdnaCthUkdWTnRCaWV1NHZRWmdGY0t3?= =?utf-8?B?dENkaXl2enlPYVRuTXBLU3haaUU0MEF3aGFxKzVnZEU0bThHaWs0ZVBxRmxl?= =?utf-8?B?ZjZwMG1adnJmaUE9PQ==?= X-Forefront-Antispam-Report: CIP:69.169.224.6;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-6.smtp-out.eu-central-1.amazonses.com;PTR:b224-6.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(61400799027)(376014)(32142699015)(48200799018)(9140799003)(18092099006)(18002099003)(22082099003)(16102099003)(4113699003)(5113699003)(261009221227099003)(261009223027099003)(55112099003)(13003099007)(5063699009)(4143699003)(56012099006)(261102123227099003)(261028144727099003)(261026140227099003)(261026121527099003)(261021121427099003)(261022075727099003)(261022105027099003)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LBQA7526/RInvRX3M0hUi6/WQN7k+0d9DBixj1PY33Kg8Es7htbnXw7PRYfdd9yJOzoulJeBjkUIT2QJMRNZf2ZFIK/vxwWgyvNJfTXt6t6gWPzyO0l+RVf9e6oVNCAWIMvjzVOg2u1V6Pl898X/nLPaYL5lyk1XC4s5sYNBPKJTq/O1CAJH1gVoF+o7Tc3ZJ8im4Tm8IcFQ7Nk5tZqB/teV+X/CZuEqUF6a5rDBgIM3Nstdw4FguTRvkZdYkqyqrFuvUP6jkAXbKdnbUkydUhJPK8AoJyU5ciCvQb+sOTKwWHutCpT4kYVi1JTB6gIovDwsMlOCRJxOsY/kdcCagWbFLPgqDNNv8yZFJ5PY7cqv90q0CgCk5H6Ure78C7XL/J3/JLh6Ebs+vmXVagde+6l1jMXdTbv/O/9zjtu4IgRqyqgmwJh1NTSur/WvoZKK X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2026 17:47:50.0835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44ee9461-8fb9-4928-a462-08df44d2e5f3 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F7.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8941 Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] vhost-blk: only -ENOTTY tolerated from VHOST_SET_FORK_FROM_OWNER on old kernels - [Low] vhost-blk: num-threads 0 or above nvqs silently runs fewer threads than asked -- commit 5a199dd1e71178edbd183c4cb5040003c105bf45 Author: Alexander Ivanov vhost-blk: create kernel threads with the mainstream worker ioctls This commit replaces the VHOST_SET_NWORKERS ioctl with VHOST_NEW_WORKER and= VHOST_ATTACH_VRING_WORKER. It spreads the virtqueues round-robin over num-= threads kernel threads. It also switches the device to vhost_task mode with= VHOST_SET_FORK_FROM_OWNER before VHOST_SET_OWNER. > diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c > index c817d0e3edfe..c9c7d2d0feed 100644 > --- a/hw/block/vhost-blk.c > +++ b/hw/block/vhost-blk.c [ ... ] > @@ -52,16 +96,25 @@ static int vhost_blk_start(VirtIODevice *vdev) > return 0; > } > =20 > + ret =3D hdev->vhost_ops->vhost_set_fork_from_owner(hdev, > + VHOST_FORK_OWNER_TA= SK); > + if (ret < 0 && ret !=3D -ENOTTY) { > + error_report("vhost-blk: unable to set vhost_task mode: %s", > + strerror(-ret)); > + return ret; > + } [Severity: Medium] As reported by no-reply@sashiko.virtuozzo.com on v3 [1], can this abort dev= ice start on an older kernel that lacks VHOST_SET_FORK_FROM_OWNER? The call= is now unconditional, so it also hits num-threads=3D1, which worked before= the patch. The in-tree comment in vhost_kernel_set_features() says an unknown vhost io= ctl most likely does not return ENOTTY, because the kernel treats the argum= ent as a virtio queue id. vhost_kernel_set_fork_from_owner() returns the ra= w -errno from the same vhost_kernel_call() path. Before VHOST_SET_OWNER, an= unknown ioctl would more likely fail with -EPERM or -ENOBUFS. Neither is -= ENOTTY, so the check against it never matches. Would it be safer to ignore = any error from this call when nworkers is 1, and fail only when nworkers > = 1? > - nworkers =3D s->conf.num_threads; > - if (nworkers !=3D 1 && ioctl(s->vhostfd, VHOST_SET_NWORKERS, &nworke= rs)) { > - error_report("vhost-blk: unable to set number of kernel threads"= ); > - ret =3D -EINVAL; > - goto err_reset_owner; > + nworkers =3D MIN(s->conf.num_threads, hdev->nvqs); > + if (nworkers > 1) { [Severity: Low] As reported by no-reply@sashiko.virtuozzo.com on v1 [2], does this silently= run fewer threads than requested? num-threads=3D0 becomes one default work= er, and a value above the number of queues is clamped to nvqs. Neither case= produces a diagnostic. The old code passed any value other than 1 to the k= ernel. The commit message also says to fail rather than silently run on few= er threads than requested. Should realize reject these values, or should th= is code report them? [1] https://lore.kernel.org/r/010701a182850602-e5cbb570-ea26-4d45-8aed-14cb= 710088ba-000000@eu-central-1.amazonses.com [2] https://lore.kernel.org/r/010701a17d2bfd69-07c611d4-bf3a-47f3-9970-bc82= 9fc0ef42-000000@eu-central-1.amazonses.com --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026111717373= 4.3225443-1-alexander.ivanov@virtuozzo.com?part=3D6