From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 433948015C for ; Mon, 21 Sep 2026 16:57:35 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68LGuHBw010016; Mon, 21 Sep 2026 19:56:18 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68LGuHBw010016 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="mdxz36+/" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68LGuF0i010012 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 21 Sep 2026 19:56:15 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68LGuF0i010012 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-4870142f030so1995476f8f.2 for ; Mon, 21 Sep 2026 09:56:15 -0700 (PDT) X-Gm-Message-State: AFuF++m2/EHKKZoVqYfTNuO4HL36rCh6WQ8CN7J2YknZPz4oTdT37Q9G NHP1Fo7foherwpR0/wRMc28CCCzCnns7r9402sfGJHyWd9V0Qv4prm99ZseidUkanvbAJ2+89fx yCLkXr0creWhvDUCIOWXcABpjuJi3OvAzsavzd7RbTwFC4ZSa6g2QXQ== X-Gm-Gg: AYBFou2lt6nW7sjVA+cFDZR9FJFfcI3EvGPBJVIqzUC3pTmtpxcyJaGH1zUT1ZZqJ9v 981lVq9Q4pbKAiH+NlifysBdNpUIeRxYxq5Hve6uvoYGlPjigx/48m/SEKEZuv/UFyacrxgxvdV W/f89ExQlGlZNv3HBbax7Ptvfam5TSottdxElO2fRNnbpNpdYFpQzxHGO5STCsBvxlyfFtgOKSF 6RXzYOz087PmbA14f3F4F72ro0+lLR/22AKWp7VG4a2XnDcgfkmdWrnzNYuT6bQZpAkBg2+uuPA QYBRpoU3LJEYrrlwhq415t0LUZ6ts8FA41mhhwcLbRWtvk7/M2ygtoMzS2s6LL6otthhEsLN3wZ 2+AEk1xDePdi9Sjhp X-Received: by 2002:a05:6000:4b09:b0:485:8ee0:dfc8 with SMTP id ffacd0b85a97d-4871e26e3ffmr16247316f8f.41.1790009775394; Mon, 21 Sep 2026 09:56:15 -0700 (PDT) X-Received: by 2002:a05:6000:4b09:b0:485:8ee0:dfc8 with SMTP id ffacd0b85a97d-4871e26e3ffmr16247282f8f.41.1790009774908; Mon, 21 Sep 2026 09:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790009774; cv=none; d=google.com; s=arc-20260327; b=QqHeGgun6PiarBd22cbMkpncSTH/ctxTsMVKRjifQVS0YudYZDQ2/rCzdqIX2YcQ6w OTH3/+hoHODmtyKgl3OrYuA3z3YmwjMvocFEeFXhRT2CgR0TRyZUnZN/ADjBF4cusCmy Ill7lgrvmF3VVcdYS25MyiF6L5z3GgZEd58C58LvqUG1ef3oISMCKhErREPcgtfiwF4B Mh7RLyxcnYLQt6PRWiwkiCUQBSCFhCjW4fWLlISBzE7rb2aG/Rydimu4w6klm1LwpDnw kd245Ae8hM2q/ZOqb9Q9mT06m7tJuqEhjvekEc+ZdsiEoxDciB152aG2Vyov5USq+qut uBlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:dkim-signature; bh=nHoRRLD6AZQtAGY17w9sBV7sB7b4j5LdfZ6Wq9WXIhE=; fh=Oi9C/q1TDgQ0mTOT1z4o5PQLgq7aHFl5ZFSF+suuA1M=; b=hqSK5zdn8CGgZ83vgUp4R2bAhQDg553KN4fHwIdoNv3QP01IufqWT8ILrRjWrEs1FC CYgUXa/+53/d/SNkRCzuK8mqQbBgsQfTQmTglgew4DqaV8Z5i+2CFDrfmL0RdH4lg9NT hKxVlbWzgnpOpopamQv1qFIq4B0ykk5V7VwsPF8CvdEBpF5mzIMvEXt3hwKBI/jBMLF2 6SgD8mdBMeyotePnMa8pCKiqyl8xGf1pTHB7FGxBWa6fJe3W5Z76FQmZNPSUYXSwd4ov sdBs28qFbVyk/vGcVUVbW/sPwkWYFP6DJaRS89z/f7z5N44Zh33odfuRuY7MRax0PAWs 1hzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="mdxz36+/"; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-4872457a99asi14356227f8f.76.2026.09.21.09.56.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 09:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="mdxz36+/"; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=nHoRRLD6AZQtAGY17w9sBV7sB7b4j5LdfZ6Wq9WXIhE=; b=mdxz36+/yNyEG7GPZu9 sBa8QEX06TB0aJWruFOVNrvc5ov3uPL/NnLgxNYRcyhbj+MAVwXHb4vg435vdl+CDnVJX0dLpZ8EE 4tB+am+Q42KPJ8gm9uiY0bUthzKWh/9RoeOPEGFGGiBIH3i6S1ufN1nvcvqlY7TtgVTsMSpt6T8wM WXh72a3zWB/SbpCB4O/scGWYZvdOZSExJltZRr73ehEIPoESW5Z5dqXNwC1gKECD5+aYqLDX0QWSC LKA4K7VuwE8LbRNU7jFO5UchK0+/sFRPf7wZKFia1hM8XnK339CoKQlAE2WfYCCF2HftpyRJSChKo djyZl6A3Qjpxi5A==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x8hGW-005QVC-0g; Mon, 21 Sep 2026 18:56:05 +0200 From: Konstantin Khorenko Date: Mon, 21 Sep 2026 18:55:42 +0200 MIME-Version: 1.0 Message-Id: <20260921-batch-connect-v2-1-c37acdf22e4f@virtuozzo.com> X-B4-Tracking: v=1; b=H4sIAI1hsWoC/12NQQ6DIBREr2L+uhhAI9hV79G4QKCFJgUDSFqNd y/apIsuJzNv3gpRB6sjnKsVgs42Wu9KoKcKpBHurpFVJQPFtMM9JWgUSRokvXNaJkQ5Ux1mrBW MQWGmoG/2dfxdwUiLeI1h+BZxHh+F2d/2qbEx+fA+zJkcwE8iZIwTZ/TPlgkiSGnVMNU37Y3yS 7YhzX5ZfC39E4Zt2z68FMaX0gAAAA== X-Change-ID: 20260921-batch-connect-287d60774a77 To: Liu Kui X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3343; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=RVtzuHFgy+13aWAjnx9b7hOmI1lZawYP4t46F5NLUu8=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqsWGtmpERL3T6e4LUysQA8NxkaNLgInQ1a/6Sg Uy/bnDJ6wKJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCarFhrQAKCRBRlgpH+WFc KhKsD/9Ay+eFidLqSCQBpE4H0Qbu3mOvb+DknNUd/olxF1Se0rB6KA+jjghEy30e2PV24xEzgiU dHPCrH3v3TBoB4MdqKxoVMKMuIKAZNZWe8KD6IliPp4GN2/tVqVhdrHvQZYnfwct35ombcpjUzb jFLyTnZJg7TGgbkGPbjx0vmUt6vZc9/dtIzu+pac01xQHv3YiHU5eUvyZAm3xc+xEtGb0Jp8O8e xpuSbRe8Wgg5P+StlSqDHnMPfXVOjvQTaNjlGWPs5Zg3FNGFBaj5ehceyZQaajYwwzOEhu/U6XS fAJjeou+AdFE379dPaceTmW2eT7DF63KAknCvO8sotH85nXc1xh8U44ZeaqU3c+oLDeqDuGwwbi Zj4UUu+jG9mWsxAlN/FELodvIk2cY9ONuM9eSLgny7vtzmYcdjqRlZB/2YppsILnr9Qq2Zb+ik3 juOlxbSfioWmwC5fnI/nte8qQD+442LGt5AtWRBoXVycsQ8iToNkE4rgENVtodNF5LeMyXGRkef IKVTX5khgf3AV5KCyAvW3xL6OhJjPaia6HfSnEuG/saLM8W+vVJGSwGjvMzafKL203610ODvwC4 PRx9bZis4Mf4Uo6GjcBYB5QQ+fZxhjnOoHv57GSfrc6bQjPEocFT7qOfiQJbW/zQhLzbVcii+P+ ue/svyanOadbz1g== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.0 v2] fs/fuse kio: start connect once per rpc_queue_work batch X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Liu Kui pcs_rpc_connect() is synchronous: it runs the whole connect+auth cycle under ep->mutex. rpc_queue_work() splices ep->input_queue onto an on-stack list and feeds it to pcs_rpc_send() one message at a time. For an unconnected ep this used to go as follows: 1. pcs_rpc_send() stages the first message on ep->state_queue and calls pcs_rpc_connect(), which blocks for a connect timeout. 2. The connect fails. pcs_rpc_reset() purges ep->input_queue and ep->state_queue, so that one message fails, and leaves ep unconnected. 3. The rest of the batch is still on the on-stack list, invisible to the purge. The next message repeats step 1. So with an unreachable peer the mutex stays held for a connect timeout per message in the batch. Meanwhile calendar_work and rpc_close_work on the same ep cannot run, and umount hangs in flush_workqueue(pcs_wq). Stage the whole batch on ep->state_queue first and start the connect once afterwards. A failed connect then fails the whole batch in a single rpc_abort(), and the mutex is held for one connect attempt per batch. Fixes: 53e9def26e50 ("fuse kio: Add pcs engine combo v0.8") https://virtuozzo.atlassian.net/browse/VSTOR-135626 Feature: vStorage Signed-off-by: Liu Kui Acked-by: Alexey Kuznetsov --- v1 from Liu Kui with edits to the commit message and the comment only. The code change is identical to v1. Signed-off-by: Konstantin Khorenko --- Changes in v2: - Commit message: the failure chain is a numbered sequence now, and the claim that state_queue never held more than one message is dropped, since it accumulates messages during holddown. - The comment in rpc_queue_work() keeps only the why, the history lives in the commit message. - Added Fixes:, Feature: and Alexey's Acked-by. - Link to v1: http://lore.virtuozzo.com/20260921-acssp872-batch-connect-v1-1-ded37d934f28@virtuozzo.com --- fs/fuse/kio/pcs/pcs_rpc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/fuse/kio/pcs/pcs_rpc.c b/fs/fuse/kio/pcs/pcs_rpc.c index 540225006726d..6a3f63313d2e0 100644 --- a/fs/fuse/kio/pcs/pcs_rpc.c +++ b/fs/fuse/kio/pcs/pcs_rpc.c @@ -702,9 +702,6 @@ static void pcs_rpc_send(struct pcs_rpc * ep, struct pcs_msg * msg, bool requeue list_add_tail(&msg->list, &ep->state_queue); msg->stage = PCS_MSG_STAGE_UNSENT; - - if (ep->state == PCS_RPC_UNCONN) - pcs_rpc_connect(ep); } void pcs_rpc_kick_queue(struct pcs_rpc * ep) @@ -930,6 +927,14 @@ static void rpc_queue_work(struct work_struct *w) list_del_init(&msg->list); pcs_rpc_send(ep, msg, 0); } + + /* pcs_rpc_connect() blocks under ep->mutex, so start it once per + * batch, after every message is on ep->state_queue where a failed + * connect can purge it via rpc_abort(). + */ + if (ep->state == PCS_RPC_UNCONN && !list_empty(&ep->state_queue)) + pcs_rpc_connect(ep); + list_splice_tail_init(&ep->state_queue, &state_q); while (!list_empty(&state_q)) { struct pcs_msg * msg = list_first_entry(&state_q, struct pcs_msg, list); --- base-commit: c99164232e9dfa2f5b7615ab59c6e958a18c8caf change-id: 20260921-batch-connect-287d60774a77 Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel