From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 44E64283683 for ; Fri, 21 Nov 2025 07:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763710843; cv=none; b=UdTDXpip/o1WRoYPQxta3aXYL/CihFPJM61xgIqSBnsEl5esjIFyM5ifY2lgO1GAjUiMdVe5ZBUV69jiss/0RvpHBj5Ums1EyuRpgZSLkiM5aNpqDixhQ26k2+VodB63KZic2MUut4IMZVceyYbBO2f34LIDivYJVPH5NE4g/rA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763710843; c=relaxed/simple; bh=c9Nz2UaUThfK0wiQ6EO5TmFRdJn6/FoBXbp/8eo/Wf4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hp+7I/hFWHxB/YUFqLE6KSPqXayyjiP8cZu6Qao5gGq8J0zLDTxewKt5IJ+75CvGLFvn4GHDlKtHfUdmnpj8KYC6EqWMOgbrRm5Gb5/K506Dm+XrQzPiMs4rYa3mkf38Zy0nUX94bs1OSJGrvh7SC8SN/qEifT/udpylmanftKw= 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=TtykqZfa; arc=none smtp.client-ip=209.85.128.45 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="TtykqZfa" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4779b49d724so1703635e9.0 for ; Thu, 20 Nov 2025 23:40:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763710839; x=1764315639; 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=/3OzWeCcHm6SP5u4UWtyGKWgezzJaPTk+c1gYxlf0xs=; b=TtykqZfa4fliZTqNVmpE+vJ0J4/shF60K5YA9qFgli0xdyKbevlplqLofy12dfLxgQ Kft5Hr0+1RS47ZftpWO+pU7LVxqSj3ytxO1XN0heNZfnywaKf4Env/Y86/WUgrO4Tzyn BItzN5zrbGEqfXuZuWER92b5qbK9B2dRsCDUK92bK/hvsyUkldPHDbfsV+cnMRAwdksm IN3v6s/++uFExDcDqBdt0k3+0iikeq/OFOv6TczGHH1+u9t1MOOafehAQjNicUVwgcHE 2LnM464ymEOMmpU6r+hQ+Sd6YjD14+3UACDL7asAYA+mgn/ZF3xaqeDsGFP7bRUUvXYU DZmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763710839; x=1764315639; 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=/3OzWeCcHm6SP5u4UWtyGKWgezzJaPTk+c1gYxlf0xs=; b=f4NQdqBZFMlJU7ZE2bX/4vMCUbHNUxSC6h3oG19kOQIE+6NDi8Rfw7xHt59MPZvtB2 86UFynf9gnuju4h4SVz2QLjpKfX0P46mXdYWMnL0Z82H/4AaZIWMHoxyChIFdWch3ZkR x7RtZEVNIg9gyO4Hv1Icnx3Jxj0YnKw1+kdV4aFdG19RqySEbqOAVa6PhH6tBVJ96tde EAGdPgQcX0mjPhYNAypud1pudjxuTpGcbK+7prlcUnQiS7lAvfaBV6iYOO98L20unmGg Q+TaFNBWB1gDSnbZSxGjtpEFvoPRFJgyGNnFAUMj7YJEoU31OFJmz/v8fdPB9LFHvvJB c/Og== X-Forwarded-Encrypted: i=1; AJvYcCW5aKf7DA1pujK8fNu8N5go4JC1eVXs5IItUOCau5/YYhkls1q8ykuJiYoGKGlCEPKhFmWGjnX9fwVZodc=@vger.kernel.org X-Gm-Message-State: AOJu0YzkFFHRRMpKDOxK8CxlDrInbj5JiAV+9FAORZN0nGNBaAUvuaOi iwzeLb5aDRGKwoNbXsNR6ephY+FZ3Ovx5Ykx17EnZOTUgpZSQfiRXh8+IXLZF5NcV6E= X-Gm-Gg: ASbGnctc85qMN0fkKrMhjkkHWsHIw/OpR9zUIPPCgPTbp69jVSTZv8sJu8FgCxfpYcb DwVZoiJ98z2/YGuWAOarRd1YyURM5nqjTqxJXVWv4+6eFgcrAS+51cJzpgFesETekcCVZtVmxr6 5b+URIJUy/YUW1UtyFSvKnpNSxwTDIhokh1CAunN6NREfeDbEe0dvtcUWE4PIbqA1oi7rHlgXgd bSrc4UMDVBS1zPkuHQMbvkk696ohRYFqxU/ZoSKBV3vKb0gS+Xta29lj16EDKc8fGkBCfntot6t yGWT49E1JAUz7kYcWrWOmRWgepiRoPL4k7Qkj6RsnVVTY2WxpCG6+1zULkKFuWvVaIBg52R/AZB TwNznwfeQ2SMsQPyG/KUTBSuSyyY1YRypK0yywSyimANpKluEmzkRvWYzIdmJQtERjAjOzM0YNR Bpj3qCjebo9ybec9oN1vyZsU/8 X-Google-Smtp-Source: AGHT+IFQGzJembqiPsHmanOKzrRgr/zMYZ1JaT37ImbUe6LUK2An3tixuhnERMEGsxk3/RNERSjUgg== X-Received: by 2002:a05:600c:1552:b0:477:9c9e:ec6c with SMTP id 5b1f17b1804b1-477c01f4ed3mr6595575e9.8.1763710839483; Thu, 20 Nov 2025 23:40:39 -0800 (PST) Received: from localhost.localdomain ([202.127.77.110]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7c3f023fba8sm5081295b3a.41.2025.11.20.23.40.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 23:40:38 -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 v4 0/2] ocfs2: give ocfs2 the ability to reclaim suballocator free bg Date: Fri, 21 Nov 2025 15:40:23 +0800 Message-ID: <20251121074030.12014-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 v4: First of all, there is no code change in v4. 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