Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9305936rwp; Thu, 20 Jul 2023 02:56:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlFTYO3IW9eWQYgi/3i/PElCzlHBGegqU/9oeOazuldszUZVRqlDd6VF3PfwgAW38ln4CT7/ X-Received: by 2002:a17:907:960b:b0:991:e7c3:5712 with SMTP id gb11-20020a170907960b00b00991e7c35712mr2187140ejc.30.1689846980160; Thu, 20 Jul 2023 02:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689846980; cv=none; d=google.com; s=arc-20160816; b=hHhuKI8GqR7QFVk71OtnVdv6UcyU8zuFkJu6nfq9jMhU6UYhuqIlhHU3E+4jDTuKqH Sx4KfQ2GwF5WefSU7ctNcoKkAvC06sU3qRWNv8YDEUkpHL9R9s+9Y9XWy59WaWrNgLwN A4qC+JbtV8y3bFPRH/wJjaswDUyqZjS+wlCTuhBuuhLT50Jx/dP9DAdbGRV40lauYuyx KPndkHSPchzNdZbfP686vkkmE5z4gx00BKpeeCayiGIgzI/nr3PKq8ZmgglRnUvi4vSa lvKMpcW19tEwjI3q8rSDLTnc4aXNVt2C63rO3s/eUnxbCFnR8CDGW3nlxlCHb6Zl/iK3 jxSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IWsEdoCST2RLmfVQaJhpZTZMKhLTaQ2FtZavGotVcwk=; fh=hjJkBnU2szufEu6iYNeHw5+ILtjbq+a6zNGIo+CbvPw=; b=pFJzwz/GpGpL46U1KwSTwGwCttGeQ9qRtOFk8T929omn84Mtdf/H/e005yAm68nMzP 0qklsxjg4Xzw3LgYSXd/lCn0sEaxMjcEO3Z1ahgUvgqvROrUVBwU2S7EZvlWaL0hjSdA 0ugnsZ0alkpB7rooGUGGoBg/DPZ/ldkNSxiMwWCYfCh6aT/9NgbDQpkAoNw7CIlMG1WX MS3LLsMC6aknosWeGcfUtmBmigTYT/MVHbzd2Uq4nlG/ckB0PSsbaqdGniPgduYog9E9 3gkYUb96LOcg84F9uJu63PDSqCR177MLeDmydhWaq6Oq6dWAOPHAotJ/PTOUBFamfcaO ReNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ArIuxhs1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rl8-20020a170907216800b00992b54ad681si441614ejb.773.2023.07.20.02.55.56; Thu, 20 Jul 2023 02:56:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ArIuxhs1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbjGTJtC (ORCPT + 99 others); Thu, 20 Jul 2023 05:49:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbjGTJsK (ORCPT ); Thu, 20 Jul 2023 05:48:10 -0400 Received: from out-29.mta0.migadu.com (out-29.mta0.migadu.com [IPv6:2001:41d0:1004:224b::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4244C26B8 for ; Thu, 20 Jul 2023 02:47:12 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689846430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=IWsEdoCST2RLmfVQaJhpZTZMKhLTaQ2FtZavGotVcwk=; b=ArIuxhs1r2s5cqxco09D6B5rx6QvqHCe/RVtqG9xHgrhTTe3P6anSMkPsaV7TAdgKySdlp wWKwzvzJ+s7pDJXcQzBeMdD0NKeQzvAnDXznzmeB3hiZ83Rv9teoKiC3fOZZWs4zp5LVrX MA4XhAe/raHLdU4dPf7IHKLJ4hcdw4w= From: chengming.zhou@linux.dev To: axboe@kernel.dk, osandov@fb.com, ming.lei@redhat.com, kbusch@kernel.org, krisman@suse.de Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, zhouchengming@bytedance.com Subject: [PATCH 0/6] sbitmap: fix offset hint wrap and some optimizations Date: Thu, 20 Jul 2023 17:45:49 +0800 Message-ID: <20230720094555.1397621-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengming Zhou Hello, This series aim to fix and simplify the offset hint wrap logic, also include some minor optimizations. patch 01,02 fix offset hint wrap logic in strict round-robin mode. patch 03,04 simplify the sbitmap_find_bit() code by removing wrap logic. patch 05,06 are two minor optimizations. Thanks! Chengming Zhou (6): sbitmap: fix hint wrap in the failure case sbitmap: fix round-robin non-wrap find with hint > 0 sbitmap: don't loop twice in find_next_zero_bit() sbitmap: remove offset wrap logic when finding bit in word sbitmap: wake_index doesn't need to be atomic_t sbitmap: check ws_active before check waitqueues include/linux/sbitmap.h | 2 +- lib/sbitmap.c | 66 ++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 35 deletions(-) -- 2.41.0