From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B3112DAFDE for ; Thu, 18 Jun 2026 01:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781747596; cv=none; b=jr2sIKO/H8KjQqA4zKVlGYUozjY9uJhb+ZmHlDHUswkgt1/ysEj0diZM4F7AunBDgdivswg5AYr8iuYDb3uc/ZsVGBhcyyp5SrevNubwOyf03ZVd/b+wS2f8GGdtnN/QhJAhtKVw30C7KOMyaUJdHfGQsk1gacAuEQSqslqo6Kc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781747596; c=relaxed/simple; bh=OiubZNZxdaZRtGsDyexlvdSVfAvj2s0uGiD5XgnoM9A=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=uBXYcUUgLsuBeUTExOo/Lfv13fQpMvFu2PxFkYk+6rdtlmockrL62STbGJawoaHVlWqM0xJ73ByQYfnupkdHt6pAJNyJkdY7h9Pj6aD4stqYQIJMziOmd6jLkxvih4tV4FBxsC/Wd9Sg80vkPYjZxfrGiB0u0hvDp56Xf33yChc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b=XV8A4WPl; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b="XV8A4WPl" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTPS id 65I1qwid065415 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 18 Jun 2026 09:52:58 +0800 (+08) (envelope-from Yi.Sun@unisoc.com) Received: from SHDLP.spreadtrum.com (BJMBX02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4ggkC80tjXz2Mp18G; Thu, 18 Jun 2026 09:48:20 +0800 (CST) Received: from tj10379pcu.spreadtrum.com (10.5.32.15) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 18 Jun 2026 09:52:54 +0800 From: Yi Sun To: , CC: , <279644543@qq.com>, , , , , , , , , , , , , , , , Subject: [PATCH v5 0/2] Improve the performance of bitmap_find_next_zero_area_off() Date: Thu, 18 Jun 2026 09:52:50 +0800 Message-ID: <20260618015252.3601554-1-yi.sun@unisoc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL:SHSQR01.spreadtrum.com 65I1qwid065415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1781747590; bh=IDqoYl27mTUXfcsHojTAomeAOFAsreiSXXVzs0+27GA=; h=From:To:CC:Subject:Date; b=XV8A4WPlSydR/JQ9uO/zvH4ZVX+LUWVy9lqMbDM1DC/SFKpgLVxEZJ2M5ZH7s3MDK m96EkCTA+mwCdPBmlpiIULM6DkWF/8G3Igzm9rl6W/kb0EY8jDhKuZE2V6ictvVZ7c 2sjDVYRztBU4YQpEQdXQuN6SPU3tzwTrDgqt5jPQIek63f4T/OLPcGVePF/B8g9qet jHhu24B8uSS8bioDGHGKHSgPy29mv4EJcHifT3jdLB6PuY9Q1U8QjQbO3RxYzBoiNL oTimsf3Ek+tTvDmEcsXdg23mBw3Qgo/xKGQxg8329eMESQFZR2tEg3bgAb6Mqww4kO 4S6empsikAYUw== Use lib/find_bit_benchmark.c for testing. Test results showed a 40% improvement in dense cases, and almost no change in sparse cases. Performance test results on my hardware: before(ns) after(ns) change p-value dense 1211 688 -43.2% 8.3e-11 sparse 13.3 13.4 0.8% 0.27 The following modifications were made based on v4: - Improve test code and testing methods to make test results more stable and accurate. - Change the "goto again" code structure to a for loop. --- v4: https://lore.kernel.org/all/20260601094234.103863-1-yi.sun@unisoc.com - Test code has been added to PATCH v2. v3: https://lore.kernel.org/all/20260514090607.231387-1-yi.sun@unisoc.com - Code optimization was performed on PATCH v1. v2: https://lore.kernel.org/all/20260514035644.4118050-1-yi.sun@unisoc.com - Do not introduce find_last_bit_from(). v1: https://lore.kernel.org/all/20260512040659.2992142-1-yi.sun@unisoc.com Yi Sun (2): lib: bitmap: add tests for bitmap_find_next_zero_area_off() lib: bitmap: optimize bitmap_find_next_zero_area_off() lib/bitmap.c | 35 +++++++++++++++++++++-------------- lib/find_bit_benchmark.c | 17 +++++++++++++++++ lib/test_bitmap.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 14 deletions(-) -- 2.34.1