Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp778805imm; Tue, 15 May 2018 09:03:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrytNH9d7HQdtJSaVs9kddR8a8qdi4L9i/IABcbmlA3NZDncB4hpRuaiNRqeFvGTbKhAbyN X-Received: by 2002:a62:5d4a:: with SMTP id r71-v6mr15568302pfb.147.1526400223584; Tue, 15 May 2018 09:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526400223; cv=none; d=google.com; s=arc-20160816; b=iYtOdEszFOQTTQickPeqNEq/KBZePzKPK4idLoLiD0MU8oMuQ9VIjJmV+DwvKmKR+O MziHnNlcpQduOt/rNl26OO8ruiYtFEsXORKBzWvC7djElJAYoMBuwjtVZCMbqRlMtV3D 86qc1Cd7KFHNz2+J92NziRyuyAAqPSbkM+wWRQ46rs0rjJF48gcK4tguUiBQRtnM2Fp5 gv/YiuHxZ38rA0u7Wrgr14/FX33fvmAArflZVTjCLSMEnmi1cWnP4ycjMEQIf40rEPWF OJ2VySYzPENl91dklQQTFATKI74iEv4N07Kg9nQBmORMYaGBBmbxvw5xlJPuwc4U022H iYiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=KUdfBa09diLPu59Cy3DAIaHorG+wa3E7cA/oOHTfjY0=; b=nyk4vG5llAdLmlpI4sK94Ldk9rNTdtsHZMkBOG78ktsPsxHNlf/d4rOeG1aU6Hd1Sx xehs+dAtz6nTh2iuYNTA9k5C1sYVESYTwyQgTtn4jERzswKYRboGNOcKJFg7lMtmu2j+ /NL7j9EQyTXXniQfqP7zRkTf6x2wfBCK/8tL/9OBTJzbxSyXHBd5CnzVfeL94WBDubaj 7Jil14C/6wtSdN2wJuMGZD8wlFisGKI/SIf/5ah7/UBvYAUFer+xT/fPkqdCwHDhqeP4 zdUtx7cAAjIPRc2M0wFYpK1giuvFs1tcIRa+zO6180ekMqyYGoGTXv/BJuW7OKEdtOSH rARw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mBOSvIoS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2-v6si275117pgq.157.2018.05.15.09.03.18; Tue, 15 May 2018 09:03:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mBOSvIoS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752951AbeEOQAw (ORCPT + 99 others); Tue, 15 May 2018 12:00:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55480 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbeEOQAt (ORCPT ); Tue, 15 May 2018 12:00:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KUdfBa09diLPu59Cy3DAIaHorG+wa3E7cA/oOHTfjY0=; b=mBOSvIoSBB7C83YUpMgkdy08u aJcSY3Pc3bCbmAKiMkCeK7G+4M8Vj3xur0HDyx6KCjSuK3847oSxzWyNkfjHOsep/V0V+8vq26PG4 mriZEz6r6uGUHgXnQ8M9I3hn/5IuCX1ttY/u6mu2zN118YuWji388/x0MPJlmKeziueddvaAvX1jb CWLGfgmidcW4SauNozxcKhsFfrfMG+LcBx6Rn0pBsaouej0R3RnJYBggnjvCfPCBTC/EY3adydZiv OX+V165LwpBb0k4s+FguyS1OAA+X3vMOZK9nmNbowaJtIbxGKGX8bqaSCCWSbKA0onE7KNltOVcV2 kpkpjdg+A==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIcNc-00073Z-AI; Tue, 15 May 2018 16:00:48 +0000 From: Matthew Wilcox To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-usb@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Juergen Gross , qla2xxx-upstream@qlogic.com, Kent Overstreet , Jens Axboe Cc: Matthew Wilcox Subject: [PATCH 0/2] Use sbitmap instead of percpu_ida Date: Tue, 15 May 2018 09:00:41 -0700 Message-Id: <20180515160043.27044-1-willy@infradead.org> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox This is a pretty rough-and-ready conversion of the target drivers from using percpu_ida to sbitmap. It compiles; I don't have a target setup, so it's completely untested. I haven't tried to do anything particularly clever here, so it's possible that, for example, the wait queue in iscsi_target_util could be more clever, like the block layer uses multiple wait queues to avoid pingpongs. Or maybe we could figure out a way to not store the CPU that the ID was allocated on, or perhaps the options I specified to sbitmap_queue_init() are suboptimal. Patch 2 isn't interesting; it just deletes the implementation. Patch 1 will be where all the action is. Matthew Wilcox (2): Convert target drivers to use sbitmap Remove percpu_ida drivers/scsi/qla2xxx/qla_target.c | 16 +- drivers/target/iscsi/iscsi_target_util.c | 34 +- drivers/target/sbp/sbp_target.c | 8 +- drivers/target/target_core_transport.c | 5 +- drivers/target/tcm_fc/tfc_cmd.c | 11 +- drivers/usb/gadget/function/f_tcm.c | 8 +- drivers/vhost/scsi.c | 9 +- drivers/xen/xen-scsiback.c | 8 +- include/linux/percpu_ida.h | 83 ----- include/target/iscsi/iscsi_target_core.h | 1 + include/target/target_core_base.h | 5 +- lib/Makefile | 2 +- lib/percpu_ida.c | 391 ----------------------- 13 files changed, 74 insertions(+), 507 deletions(-) delete mode 100644 include/linux/percpu_ida.h delete mode 100644 lib/percpu_ida.c -- 2.17.0