From patchwork Wed Nov 24 20:40:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12637785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFCA3C433EF for ; Wed, 24 Nov 2021 20:40:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238626AbhKXUnt (ORCPT ); Wed, 24 Nov 2021 15:43:49 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:51331 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238464AbhKXUns (ORCPT ); Wed, 24 Nov 2021 15:43:48 -0500 Received: from pop-os.home ([86.243.171.122]) by smtp.orange.fr with ESMTPA id pz3rmRlHqBazopz3umFJDx; Wed, 24 Nov 2021 21:40:33 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Wed, 24 Nov 2021 21:40:33 +0100 X-ME-IP: 86.243.171.122 From: Christophe JAILLET To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 0/4] IB/mthca: Cleanup and optimize a few bitmap operation Date: Wed, 24 Nov 2021 21:40:09 +0100 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Patch 1 and 2 are just cleanups that uses 'bitmap_zalloc()' and 'bitmap_set()' instead of hand-writing these functions. Patch 3 and 4 are more questionable. They replace calls to '[set|clear]_bit()' by their non-atomic '__[set|clear]_bit()' alternatives. In both files, it looks safe to do so because accesses to the corresponding bitmaps are protected by spinlocks. However, these patches are compile tested only. It not sure it worth changing the code just for saving a few atomic operations. So review, test and apply only if it make sense. Christophe JAILLET (4): IB/mthca: Use bitmap_zalloc() when applicable IB/mthca: Use bitmap_set() when applicable IB/mthca: Use non-atomic bitmap functions when possible in 'mthca_allocator.c' IB/mthca: Use non-atomic bitmap functions when possible in 'mthca_mr.c' drivers/infiniband/hw/mthca/mthca_allocator.c | 15 +++++-------- drivers/infiniband/hw/mthca/mthca_mr.c | 22 +++++++++---------- 2 files changed, 15 insertions(+), 22 deletions(-)