From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794063291; b=HOoTaePEqHOeYWturFpuLQ8Y8H/M1YLMYDxS2lFDFOCjeXjdSnKmiLk/Stpho5BIe6xm Xn0ThrlhcPkmkO1FzxQFqTLcSVXbT6xurT6QFrKv8YtnZNKdu8jbC+vqcWpf7q3CvwRFP Ea5sVPt6RW3ZxnUZOh6DmxNsPhIBQ2lHXuQKJ7mamxfiM4aVIaZpah+Qd/ICkR3phvfY9 AGsv2AOy946iwBF9pZk7MMNxKO7uAMN0FmP8LbPFjqixEASHVHNaFs8Vtuq6DCHtid1Jd opWaGdYkSMRK2FZXMAOCIkZ2mVLogMfAOnfcERxh338uwuWDD/ZXDF6lQtRChQJuNLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794063291; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=nFpOE08zt6LKiYAJkddKnt9FS54yYK4DK4eA7f2RHXU=; b=ecWjaNIOt2IIkyD2sXQli6kWQROhxw6u///DvupXo5sLHM2+fdfdiwxvcQupDWp/1sB4 CvpW08urYZ9Z/oq3I7noEnx+cc5To5ReML8TCnxuV3RuHGVXA76e/9k4U3TIY20bV21oO zDnz1BOgY0354Fyc91hos98zZ8rp+tv+YeIjC3YQlnHA55L0+1RZC6Tgk69rqK9JWuDGQ P0NMFGlGtTeWpH8uWc1UJlTVdRK492zHHfsHOqxOv9Hkn8NzyJnBG5kiyopYeeOgKyKZi bIK0kKikQwoSeOX6PikSxABx6gpjZ2qH+PFaFaFSDE9QbL7bi1iNjMhP1cF00hQxsAg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=rq2Zy7PN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1C1E606D805; Sat, 7 Nov 2026 14:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=rq2Zy7PN Received: by smtp.kernel.org (Postfix) with ESMTPSA id 857E81F0089F; Sat, 7 Nov 2026 14:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794063290; bh=nFpOE08zt6LKiYAJkddKnt9FS54yYK4DK4eA7f2RHXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rq2Zy7PNG4FNL3sG6eExzJmWOFbaT+/YtNn8JH4opriLZODdOS/z3M/oXXuylVkM5 DHlqq1HWhaUZPTx5UEPTHJdbtG3PVBHIxZp3X9stAJWrnKLcc4eFdyyvmTJ/JFDSDs d/wHARLMXkmhM8bMK4O6D6JugbiCQmzZuKn1v91I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Breno Leitao , Andrew Morton , SJ Park , Baolin Wang , Hugh Dickins , "Paul E . McKenney" , Sasha Levin Subject: [PATCH 6.18 484/869] mm/shmem: report RCU-tasks quiescent states while undoing a range Date: Sat, 7 Nov 2026 08:52:46 -0500 Message-ID: <20261107134909.991060057@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261107134852.069646174@linuxfoundation.org> References: <20261107134852.069646174@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Breno Leitao [ Upstream commit ebd1a08c192109c83a87ddf42793ed6283180faf ] This shows up in the Meta fleet on ftruncate() of large tmpfs files: INFO: rcu_tasks detected stalls on tasks: 00000000752fd185: .. nvcsw: 59455/59455 holdout: 1 idle_cpu: -1/0 task:rocksdb:bottom state:R running task __folio_split find_get_entry find_get_entries truncate_inode_partial_folio shmem_undo_range shmem_setattr notify_change do_ftruncate __x64_sys_ftruncate do_syscall_64 shmem_undo_range() walks the whole of the requested range in folio_batch sized steps, twice, and its two cond_resched() calls are the only reschedule points in that walk. cond_resched() is not an RCU-tasks quiescent state. Use cond_resched_tasks_rcu_qs() at both points so the walk reports an RCU-tasks quiescent state as it proceeds. Link: https://lore.kernel.org/20260918-shmem-tasks-rcu-v1-1-79acf91a2569@debian.org Fixes: 8315f42295d2 ("rcu: Add call_rcu_tasks()") Signed-off-by: Breno Leitao Signed-off-by: Andrew Morton Reviewed-by: SJ Park Cc: Baolin Wang Cc: Hugh Dickins Cc: "Paul E . McKenney" Cc: Signed-off-by: Sasha Levin --- mm/shmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 0100110f77b8e..f2b5a11e88a55 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1129,7 +1129,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, } folio_batch_remove_exceptionals(&fbatch); folio_batch_release(&fbatch); - cond_resched(); + cond_resched_tasks_rcu_qs(); } /* @@ -1170,7 +1170,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, index = start; while (index < end) { - cond_resched(); + cond_resched_tasks_rcu_qs(); if (!find_get_entries(mapping, &index, end - 1, &fbatch, indices)) { -- 2.53.0