From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 5C9B08017D for ; Wed, 4 Nov 2026 18:56:42 +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 6A4ItUtU026191; Wed, 4 Nov 2026 21:55:31 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4ItUtU026191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793818532; bh=0lxiMyl6KHmnYSe9HEu3GHDtHWbpytCCxUtwsopgyYY=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=a5D5NtjspcayC4oZkCOlIEaNGJX2DM7W/ewaJSd8/HYcQ09v5K1ms1EzFTyGYSvZS kDY0gRUhF3AKFNOjIpFEmxyFgPrqc5pgr+z6qbcGRBIC+V+uQzCCCsvT0i3qMlBVMR MlRUfpFaMaUXNVNGWN7dIEUSwEFZOhLsRfCx9VgsDOuBT7gK2E97RhwiKuBQyaDZwm XFeWdcbGvFvDuzNlkqk3a6Ot9SIv0ga/4jcyGTn1cpsFRQBYqkfgpYncR5XlXtuO3o dk3F4hdcEa+3v07bgjmjTJeEx4MtASS67tXYhbFf2+Vzw3GD5ExnxnjaBrIqvGKW8W ZtvzlThBrEaZw== Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A4ItPEi026168 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 4 Nov 2026 21:55:25 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4ItPEi026168 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="hmt0gYr1" Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4ad3d35e899so12391865e9.1 for ; Wed, 04 Nov 2026 10:55:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBzIJGFh+9eKnjfcXNzkhlkYPZth8+08SZ1qX/JQo40PGuomwlR5J3KSrtp1HNL3TBzmScMXYw==@openvz.org X-Gm-Message-State: APuU4Z8Xjic51gUduEDqRE/dxCg0ncfRN8xfepE+gc3QRh4rrP1bThoy A5szNsRjBsHux82oaTrMzJCw7NBbUzYib3y/hoGvO+Jxd8FawxKEAwZ0JSUA2Q2hdnqdDu+XVhh OdxAaQhFt/pWZKVL3hkBHpOhUUIGxPvf5aCDxcSg4Mf/TDWdtKtukhA== X-Gm-Gg: AYBFou2+FTlYoASb6kxtN9M5sxo4OhSK/U2xg8Uvh/+eQmtzl+BHTq/5QyCEgknjU73 lCNFQJbt2eW/WYel/rEE9Y4p4+zAgUWpGnw3zPVgbLTM1dZcKU7NtEhTCV/oRsRGA1qwAsIAkYo N7+w0ll/Yg2DzXt7SyW/U1R8xi1dZ5T5KFkF1G0oKA0FDCbF+OxutOLLbxSwRJDJl6RgBsMacS2 k+8H5zKKqBzd8NWJBnWegvaTtMias4gp6hx6YhY8PPoOJXd7Rki8hUTESD+6qJIHIO62tXsQBEo F9bGkw+2zQ== X-Received: by 2002:a05:600c:8183:b0:4a2:1364:252b with SMTP id 5b1f17b1804b1-4ac198f7338mr318739785e9.35.1793818524888; Wed, 04 Nov 2026 10:55:24 -0800 (PST) X-Received: by 2002:a05:600c:8183:b0:4a2:1364:252b with SMTP id 5b1f17b1804b1-4ac198f7338mr318739615e9.35.1793818524476; Wed, 04 Nov 2026 10:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793818524; cv=none; d=google.com; s=arc-20260327; b=JpZpPQG/NsW7VLBehgp6sS6XTmmQWyvomF/52tciHy1L7hwDIlCZi4pGiMbhTR8MG1 cDLbonKRRYNNiDjlGJFgllGd6Ta+siQLO7bg0xJrZgvEiJMxE1UPoVl0KJUnwSa+7sjS 3/ULuPoruuIiESqci3vOC4gbulqbGa14qtz2sl1zRWn+3CPd/TmRMGMXbQcTJfwvJ03V UNUkRXIlia20+0fDqGFeZ1aOc+3sWScwi+QunveSKMbFHfr7rTmoCqAMAEBkaI/482jp K5eH6lcWR72SudUhjNRcCEK7G0abmKBJt+RROilkNtk7PEITrvessAvSxbXg0Qi45K3B 57Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=V/6r4UKIOfYMD4zco5BGw5Dgf1i8ZhEsVj4gIVRj3qM=; fh=qV0f3gj+MeFRcreOXle3SX3jMumt4a+V3N/wAc7Pbnw=; b=jwO3a1hIo8WLm7+Qs1ZeDMqaeRuxOYJYvigXMHfhzvo/+MA1fQ6Xdorf1ruDG/gbuR yp/WXVfXE0otFfpVshw9MS1XCcoQb+iK/Bd0wOihafCafWOkWsghYV0Mn6dOwoMFS8Au LaxCQ6cE7N9NOaZz9NiD8bcXkdudaSUQmjl8ZC1kwJpEwFEaVslaUdqRzFc7IEGS2C/r W8cM3CNWMaiBeWLISc8Yihz/gT5AQ1QS4/HFcm5uhP9lGIdsbkajSsdiCMBt5RqCpBBK xhk94jABBjbZvl4YcMPqnxFYJtBtgyzMRHw+sXJXZ3/+BoQBx2mZUhE1Q2x6rFZv7Zbh l13Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=hmt0gYr1; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:162e:5a6e:fd46:18b7 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4b43e909b9asor6738685e9.15.2026.11.04.10.55.24 for (Google Transport Security); Wed, 04 Nov 2026 10:55:24 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:162e:5a6e:fd46:18b7 as permitted sender) client-ip=2a06:5b06:b600:300:162e:5a6e:fd46:18b7; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=hmt0gYr1; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:162e:5a6e:fd46:18b7 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793818524; x=1794423324; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=V/6r4UKIOfYMD4zco5BGw5Dgf1i8ZhEsVj4gIVRj3qM=; b=hmt0gYr1LnxNGTTWdXFVqKbZ2rtqRcOdzuwbYUkuBWgTFONgRJSwy3KpnH2JSQ71nv 9/qzFzOryTw4VfCp176L2hTxL1bmzsuiSfLHJe0GsmhCkx4PXZ22qWEKaXXGBAoGY9Id J/zJJ2EXZHb2P4aJJXEqgGBsWrKbVuWnzkBtqp6FkyYaZI3GVTISS1eFgxasVz6h+EDv sWVjpW96/wMp2NyRUKfp78fl3kCdgSSmmBU1Trwij2yu+9mWRMiXFj22SPr1S56hPI9F n8NtmCKn3+iqQYqnSOGldnIBXcZ3YaTi8BHBbqUTgVIZuD0AYW2bLP1W7u4r/tvvNiW3 G0Xg== X-Forwarded-Encrypted: i=1; AKwUvBwaFBhjpxuvfiOCfevLy5wlIexh4oUaQMWNMzuEJEkD1FR1U6iI1rT+Ae5QxYFQXGqIc/yS7A==@openvz.org X-Received: by 2002:a05:600c:698d:b0:4a1:d97e:cd60 with SMTP id 5b1f17b1804b1-4ac185bd1e2mr380969015e9.16.1793818524058; Wed, 04 Nov 2026 10:55:24 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:162e:5a6e:fd46:18b7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b56e2ae762sm4482435e9.2.2026.11.04.10.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 10:55:23 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Wed, 4 Nov 2026 19:55:17 +0100 Message-ID: <20261104185519.1870488-3-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261104185519.1870488-1-den@openvz.org> References: <20261104185519.1870488-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 2/4] dm-ploop: fix a lost wakeup of the ploop_allocator() thread 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: Denis V. Lunev ploop_allocator() tests prealloc_size and only then sets itself TASK_INTERRUPTIBLE before schedule(). A request that lands between the two finds the thread still running, so wake_up_process() does nothing, and the thread goes to sleep with the request pending. A pio whose cluster is past the end of the top delta then waits in ploop_allocate_cluster() for good: ploop_req_prealloc() does not wake the thread for a size already requested, so later requests do not end the stall either. The dispatcher waits for every runner to go idle before it hands out more work, so the whole device stalls. The thread tests kthread_should_stop() before setting the task state too, so a kthread_stop() is lost the same way and the removal of the device hangs. Set the task state before testing prealloc_size and kthread_should_stop(). Fixes: cf489cf22cd5 ("dm-ploop: make filespace preallocations async") Reported-by: Konstantin Khorenko https://virtuozzo.atlassian.net/browse/VSTOR-152984 Feature: dm-ploop: ploop target driver Reviewed-by: Andrey Zhadchenko Reviewed-by: Konstantin Khorenko Signed-off-by: Denis V. Lunev --- drivers/md/dm-ploop-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c index f0832fcefeb8..e64fd8965d46 100644 --- a/drivers/md/dm-ploop-map.c +++ b/drivers/md/dm-ploop-map.c @@ -2325,6 +2325,7 @@ int ploop_allocator(void *data) struct file *file; for (;;) { + set_current_state(TASK_INTERRUPTIBLE); /* we do not care about exact number here - risk one extra schedule wrt taking the lock */ if (ploop->prealloc_size) { __set_current_state(TASK_RUNNING); @@ -2348,7 +2349,6 @@ int ploop_allocator(void *data) __set_current_state(TASK_RUNNING); break; } - set_current_state(TASK_INTERRUPTIBLE); schedule(); } -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel