From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE6D024E4C4 for ; Tue, 2 Dec 2025 06:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764657590; cv=none; b=E/qBd+0KGR+qhx83Tev0QZr/8uioRNMC23GpHdkjIZ8d0Ob0Qgxr8iu3hjw1vfazwIj83qXtTA+XX85+BVxCLkQz1gdafQdvtFZc4V/ZjG1RotqM5y3wKyWDz3SVyIv9x3+AUuDjsmMbsz5iUGQ9XM7h7etLrmK5WjBNdJIquiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764657590; c=relaxed/simple; bh=cybMQlqzqWSeUEcRLV0YY5xWTvsLY6kfQPdhNnOCMds=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jsVAefvv1Lx6Zwf4zQnieNCDFsFHi/wpaiAled1RuDLXKdkn7LEczL+IK0+BiNfBk9lWcuEnzx/iChr5e93CAi0DeyzISA6yhBmu7JgU11BQfr4n7WmpMtQpofqoiZEf6kamKEALdg/gXtnvhm7iR4eTaecCKCeJOyxsWMrL0p4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=AqrZ9YE1; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="AqrZ9YE1" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4779ebfa91aso5537975e9.3 for ; Mon, 01 Dec 2025 22:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1764657585; x=1765262385; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jJWPPCiXNdZgK6BhwvrD7XUosARU9VubGRwbzKKTJJU=; b=AqrZ9YE1x11j2Rbu0PXuhp4pKR4SYkvu0E8TYJ1f2XWXGlpIv3+YqOeyj398k+1EMi J2SwZTqnr2pbrW71SzuNbBOPpg820/cUCdN+0LhOKEnheu1iX5PFs169FyTg3z3YKRvm CgXbineQ5ct7IoUuZzK0tQcqtoXQCu8mpx3qbs37cp+L7HauJE8f75DCj6E4ODbjrlU5 z9cB6HXkwRgS9n2a4+gCj4wVsOxz2G3gL7aaQtv4CX531NV3aF7qsrs72gQsIFRXKLWy hHTMScuYNTNHxSG88I1JaeU/YDqLwE34+zROKAKaEfq4T5/5B7B8HfNfo3IbhnsSVxia araw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764657585; x=1765262385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jJWPPCiXNdZgK6BhwvrD7XUosARU9VubGRwbzKKTJJU=; b=Cq2xN1qnniTz4BYlV3UVHWLEoETesqajlsCWpVbBjQgXkcqiYbZCqZOMD/Jnz0a/fY zcideFlqgc7SE+OLf6RYv5QdyJdyyHwq+wMFapBCkwJgIVE2+jgF6lNkzN4zAVTvhq8E ahnfrYORMfFTtvOBg26wP43BSQjfAnk7dlhxQ5kC1tC5V6tejXweU9SKzqE9iUYFwHsP AgdeJ8bI5lP5aVgMWg20IsLPhWnSha+CzZsIPzz22EfEPFXZjrF+ECX2+/LAxOtji26h mwrkxFiH2aAYpWrBAd4597yON52SYotJFNsEZYoVTQeCMgS935OZfuBtUo8dWQh+koOg O/Xw== X-Forwarded-Encrypted: i=1; AJvYcCXKAcmMToBLHkCms6dHmuVtKv1MOstpjRpFXZ/81sS2xox/9Ej61x3b9R/jm10K7Vo94QSLgNOVCPSNv5w=@vger.kernel.org X-Gm-Message-State: AOJu0Ywyoch5Xjyl0p99f7iPPteqrMkhLO3pWD4GwDbZywKfPf3t/Zjj r77INzEEhjnngcDIFxccArATTY8xqvOW685g5Wmehj65SQ+lt2M9Zf0N34tsBzdzCm0= X-Gm-Gg: ASbGnctTIDgF2kxX1fQdFx4Ew0inMMhQwwUM3/0/bi5vnLS8LT0q7zeenelwv1ARlTX l4JnwTcM7tBkX4Nr7aWsBFl2ysllJpDP74barnPzEke9CoOf6rawHRjkqQ/sxqNeXwDQwUYT5yd s+AXfcdeAoRSLaW7xpcHmowzi6h/kGmYtCM7RIaX4oL4s/yL0qQP0WK9cXvlbLUX8X1N2+x6CdE xoU5cQF4eDgCuSnnAgMfAY/DHWlX8m4qzx20go/uduZJQlpeAvoUAqD9vYXeVoFJLAtUA8JwhuR uer9pa9V4TiHtw25VMOlXh1TU6s1QjFShwxmXgrnjfUlFH7tmkjXftKtesxohZz2YgtBPRAOW/6 Ts8BHVi4Qvb3PmpzNTXh30svKT4ZOZnPLldsdyS8nxBqJJ73+oHPf6zYGOgO0DSdA6XY0lqJNTk uBy2tRDMnvRacKDLkM+j9oZBit X-Google-Smtp-Source: AGHT+IGozbeGaga8/a1PoH9/elj2sfZVaATZBc29uYPZeq6Dw1myReOM8PrF79Dt2XurrEfBBQKI8A== X-Received: by 2002:a05:600c:1c23:b0:477:5c70:e14e with SMTP id 5b1f17b1804b1-477c01d92cdmr266007405e9.5.1764657584938; Mon, 01 Dec 2025 22:39:44 -0800 (PST) Received: from localhost.localdomain ([202.127.77.110]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7d15fb1430csm15702796b3a.59.2025.12.01.22.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 22:39:44 -0800 (PST) From: Heming Zhao To: joseph.qi@linux.alibaba.com, mark@fasheh.com, jlbec@evilplan.org Cc: Heming Zhao , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, glass.su@suse.com Subject: [PATCH RESEND v4 0/2] ocfs2: give ocfs2 the ability to reclaim suballocator free bg Date: Tue, 2 Dec 2025 14:39:33 +0800 Message-ID: <20251202063938.9046-1-heming.zhao@suse.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit why resend? - the v4 summary description in the cover letter is incorrect. v4: Most of the changes involve revising comments. For the code itself, there are function renames and parameter usage adjustments, but no changes to the code logic. For patch [1/2]: - Based on Joseph's v3 review comments: 1. Modify the caller to initialize the ocfs2_read_hint_group_descriptor() input parameter '*released'. 2. Rename the _reclaim_to_main_bm() to _ocfs2_reclaim_suballoc_to_main() 3. Change the text "not empty rec" to "non empty rec" - Revise the comments preceding the function _ocfs2_reclaim_suballoc_to_main(). - For the question: "How to distinguish the release case or a bug?" I write a comment before ocfs2_read_hint_group_descriptor(). - Revise the commit log to make it clearer. For patch [2/2]: - Revise the commit log to make it clearer. Remove the v3 patch: "ocfs2: adjust spinlock_t ip_lock protection scope" - Reason: This patch belongs to a different topic/job and should be handled separately. v3: For patch [1/3]: - Factor out the reclaim code into a new function '_reclaim_to_main_bm'. - The function ocfs2_read_hint_group_descriptor doesn't return -EIDRM when the group descriptor is invalid. The new code logic returns 0, and the input parameter '*released' is set to 1. For patch [2/3]: - Modify the code to follow the new logic of ocfs2_read_hint_group_descriptor as introduced in patch [1/3]. For patch [3/3]: - No new changes. v3 patch has passed the xfstests: ./check -g quick -T -b -s ocfs2 -e generic/032 -e generic/076 \ -e generic/081 -e generic/266 -e generic/272 -e generic/281 \ -e generic/331 -e generic/338 -e generic/347 -e generic/361 \ -e generic/479 -e generic/480 -e generic/628 -e generic/629 \ -e generic/648 -e generic/650 v2: Create 2 new patches: - ocfs2: detect released suballocator bg for fh_to_[dentry|parent] - ocfs2: adjust spinlock_t ip_lock protection scope In ocfs2_read_hint_group_descriptor() - bypass the validation of GD when the BH is already managed by jbd2. In _ocfs2_free_suballoc_bits() - Move up the position of the vars 'idx' & 'rec'. - Move up the position of the ocfs2_journal_dirty. - Use le[16|32]_to_cpu() to access cl/fe/rec vars. - Add error handling for calling ocfs2_extend_trans(). - adjust spin_lock ->ip_lock protection scope. - Follow Glass's review comments, add 'comment' & 'else-break' for the 'for-loop'. v1: Only create patch: - ocfs2: give ocfs2 the ability to reclaim suballoc free bg Heming Zhao (2): ocfs2: give ocfs2 the ability to reclaim suballoc free bg ocfs2: detect released suballocator BG for fh_to_[dentry|parent] fs/ocfs2/suballoc.c | 336 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 317 insertions(+), 19 deletions(-) -- 2.43.0