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 B9DFE1B3B19 for ; Mon, 22 Jun 2026 03:01:15 +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=1782097279; cv=none; b=i8rqtLYBySbBvnAzsMkXG0LOo7hJNvPuRNwmVl6B+LBhHy2j4rDK7Z6niRqlP958OiobiTdF3rh3QhIQA3H7FhzNROGz5M1ZXgm0O59UzrtGYtu/ai72MMcT/9Ox+qbIt96yQKUhRRlzBY+RNTYNtujteYiPRxLt7OvQU/brBaE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782097279; c=relaxed/simple; bh=jrtijHtFd5v7U4sKH3F7TmuEVuKaW88OhgJ9EL1jS2Y=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=idemOcrlFfmPak8pVNDyPp71ieiIalPxEcTLvTW14dpKa/mQSVc9x7dGyFvOUzFaOpJWtadJYAKQtHaGM25RkO8qtw85JCfb64D3kA1pEKQdzpQrgkTmdNo1lEssUI5RCsigHf5fI/flB/6BFNM4d7+HpcfrMgvyEJdVLLVrOJk= 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=BjyCMh7T; 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="BjyCMh7T" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTPS id 65M30ems067190 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 22 Jun 2026 11:00:40 +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 4gkCWG3cX8z2NsPCW; Mon, 22 Jun 2026 10:55:54 +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; Mon, 22 Jun 2026 11:00:37 +0800 From: Yi Sun To: CC: , <279644543@qq.com>, , , , , , , , , , , , Subject: [PATCH v7 0/2] Improve the performance of bitmap_find_next_zero_area_off() Date: Mon, 22 Jun 2026 11:00:34 +0800 Message-ID: <20260622030036.1744080-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 65M30ems067190 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1782097266; bh=y43Y7QlqGmuWRDec8meIHecq7/Gs8r3Vy0wQ29OF28U=; h=From:To:CC:Subject:Date; b=BjyCMh7TI9LYJnk1pZ/42bmeIICk0hL6PFOqwt4P/od7ZtdJ9Q0XT7PgeELeqT98D RxiDPlGIBCUJFc4IIN3g99DBiDXVsMyBFJsVffDddR5VG/MwOsViLgGIsw8YIXzBgF V/kUfh9dYWQjTp6Vz40JgWwjjPCQudvxVJlCcqU9joSwFlErqDzRfRZn+SPybjIEax mXXlUpqUAQzbaxwAQCJ3ro/qaD2gzSL7FjuvORzcS7Qjl6qHPOCfFxBeAqgUM/ggOf mFvLYJYioU/MFgxdFK15zV8WxQQ2jVAVMokcPVYm7ViE9ZSL5b7U8rR9anD0MqwpWf OezywX8V8wcBA== 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 Version 7 only changed the alignment format of the test code. --- v6: https://lore.kernel.org/all/20260618133518.4079981-1-yi.sun@unisoc.com - Improve test code. - Change infinite for loop to for_each_clear_bit_from. v5: https://lore.kernel.org/all/20260618015252.3601554-1-yi.sun@unisoc.com - Improve test code. - 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 | 31 ++++++++++++++++--------------- lib/find_bit_benchmark.c | 17 +++++++++++++++++ lib/test_bitmap.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 15 deletions(-) -- 2.34.1