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 B5EF02D9484 for ; Thu, 18 Jun 2026 13:35:31 +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=1781789734; cv=none; b=B4f15cPgDwGoHsJxJ281Db7Domr7Eau+RIyLm0a8vgVHew1SL32uvoIs7dctdSjtkseRLEu0s4LHenl8vFDVki749LK2+81eOLI2tCcZ2Gghbek0Nc6FJXqhJaCODqNtfudBno2/EMXv48GuLOThgG9H9vDTEUvm2LzpuxbU/wE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781789734; c=relaxed/simple; bh=+ThxtHVq7RbEPrzSOb9uIQEQfVgCYb00zh9GRjbN8jU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ctvCtvDKA+giNEcsXe8XZiSBQPN79wCnOSVT9CTO+svvhq1CibRTsBsDtnaV9ovMPgR4UOil5ZFtBYnT9HNFgxbCEPsSucClSWoSP1qzOpG2JlIAr7EfETxnrk9g2lSNdXOPxGxDZHtJ/21GN0tdcOhOT8oAFeHok9xeLIHt6gI= 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=iJKGJZTL; 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="iJKGJZTL" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTPS id 65IDZNdF045207 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 18 Jun 2026 21:35:23 +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 4gh1nd0ZBTz2Mt8bJ; Thu, 18 Jun 2026 21:30:45 +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 21:35:20 +0800 From: Yi Sun To: CC: , <279644543@qq.com>, , , , , , , , , , , , , , Subject: [PATCH v6 0/2] Improve the performance of bitmap_find_next_zero_area_off() Date: Thu, 18 Jun 2026 21:35:16 +0800 Message-ID: <20260618133518.4079981-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: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL:SHSQR01.spreadtrum.com 65IDZNdF045207 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1781789727; bh=gUekUKG5OuQOCor7xC/V4kkLMi1T4dWPaw5IWZPirWs=; h=From:To:CC:Subject:Date; b=iJKGJZTLnfGGS1Y5x0U5+vNeLbMyeHUCeWx17LrgfZSXkcojolzJDbJFjeWqpNyXd KEIQLPg/eLQ4+5P6unfqp5VQavjXKxSk9n1jKW0Vz1kYpdNg8UIfTfb9cvuRTf1z0K SpjTJG1yjAibP70Y8+kRDzWxfbe35ieP908Zhf4iTO8z8yiR5Wpv82GJPiknPCyj4a CB9kEJokVuq/swiO8EgwbTtDp5TDG14elFy2IYQFUWdPoKZXAoYInb9XLULmJ3OM9p gBu/pTJUpXYfI4uYXCXAE7/RCYUuXksWMGAC75liYpZDb53eW9bivCJib3N6+NF+6/ K13UtW67ftv+Q== 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 --- 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 | 31 ++++++++++++++++++++++++------- lib/test_bitmap.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 22 deletions(-) -- 2.34.1