Received: by 10.192.165.148 with SMTP id m20csp1242329imm; Sat, 5 May 2018 07:44:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqbH4oDCmX0bH46L9nUPlevSLmyEfkeKAL8s/f6VivZ5Oe1qugy46rAM5YdUlWdPBVCs1dK X-Received: by 2002:a65:4dc7:: with SMTP id q7-v6mr15848524pgt.48.1525531450704; Sat, 05 May 2018 07:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525531450; cv=none; d=google.com; s=arc-20160816; b=gfFnl0HiGab7+uYDYaiDWDdU07IwCZW/7xVZjap6h0fEqSztdNhNcgMVvOLGifnp6u x7/ZfhWGeI9cgmPeftdEp5gdz3GIMkYjtK3S8dlHt3IEGZTjFYe4OnIycqBGK19mImf4 aUUa7CL+lwn24aVoC53CPEpsjcK5vtpMZO0hx5Kst7IUvzg4y7HI1NOmFW88C/nd4N0O +izCcNXWNHFVOyHE5mjPlVQ9e1441n/XCRgHHJ9KrMyFVP9G3NVoqJ3UDB4+k07/luKw UexuA8SQ847J1i7QK2wmLrFO5eLTidUbnrISNB0oBTiFGPzGvdR4tRWq8ljhk9VPfz+Z xtAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=YMDcJUkweSZzFoR8g7pwmXxz8j7u1ACKNnC2AV4o5I4=; b=VHH+IwrhtITVq+n4RwZgCextl91SIuxOF+0kTOZxWiru52lHC4UryVwEqpkGoqk6B+ jop69TtEhKDeFmAX29wLo1HLZ92rUdr9gsPxgawHoAn14GGdSt3JdNaRiA6XI9u9JLa0 OGD9miGBocU4D0g7t4HPe2uTaFGRjUECmJoQXon6mHUh/hTZdQ7/Ojer10e+Dd/0mz/z LkaeDF5/A0jHVJzX74QLDghHpQZpoy7hUlGWNsvC6twmduEI8AKqrn5vm5SjzSbWwFn9 JpVRVzKgQvyEZCIXvjripNZjJdpH1v+pp+/wrTszAQ4XHihkSxkBUIMhdKEi8+Vm2spY P8SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=OSqE35hL; 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 z26si19986993pfl.209.2018.05.05.07.43.55; Sat, 05 May 2018 07:44:10 -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=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=OSqE35hL; 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 S1751337AbeEEOm2 (ORCPT + 99 others); Sat, 5 May 2018 10:42:28 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33639 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbeEEOm1 (ORCPT ); Sat, 5 May 2018 10:42:27 -0400 Received: by mail-pf0-f196.google.com with SMTP id f20so10797119pfn.0 for ; Sat, 05 May 2018 07:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YMDcJUkweSZzFoR8g7pwmXxz8j7u1ACKNnC2AV4o5I4=; b=OSqE35hLD0IcVquERs6T8R+7qERRIgu5r/TgS5suZdmXRTFQCFga+up5G2995MrfWS 2ldt9eEsgSwGbKZoYXwklsiIVPXb1NSRih1rrso+tEcZODSjexvOjTJSvBu5GZbNJrhY +mwzS91MI9HhwRNDBrYm321Tj7kyGh838Xu9C0oF/j3isbBGoaIsLH0B1TVERvhodW+d DfVkaCDyRWhp+Fns6zakBFcKkt+w//dFnkqhWARCNq3bXqps3tnD64JpXMBB5HoIbAYw DIza/8GdE0b7WYI+/K8eWmIn8J71XXVQ8A2SNPm5BNTgREKC7/zba9jenkbzgGt7wOp7 oXdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YMDcJUkweSZzFoR8g7pwmXxz8j7u1ACKNnC2AV4o5I4=; b=QLTckW6Ya8H9HEORcF7H6d7OjgQmUTdTpO7lPCGitbYy6+Rel1x0VuFW2PR1Fsz3b/ 5BJGQsJBMXqtYjsgxO9oYvK7U42CHOXINGYCuIDGwS+fveZa2LEBCYoC/ZC4qlQz6YRb rXMBAyJZoIsncClFT3I14u/+aPs5ixJv1BjfjVeldOkp1zhe/2KfcCH+R+qy+Rx51qft TQNOZlZ5r8JK2+GChCswjbVWPy5/O9M5ONX/p9tjnTmGClv1KGt00TwMcq5vrPeotWbD r6DAytyYABFzvqwN3/XIzU5yEWEr3kgLRGSxVDcDtV6yO6+oHBVFH8DYX48ShTzHVtQy 4oSw== X-Gm-Message-State: ALQs6tAMWUhMFl8D1cY6YxGIanXAQ7Immoh/2BLNLqG6FULMC/9TNtTB PMZNknZUwi43KLdRa798A53GVXHaUvs= X-Received: by 2002:a17:902:a585:: with SMTP id az5-v6mr25555168plb.79.1525531346782; Sat, 05 May 2018 07:42:26 -0700 (PDT) Received: from [192.168.1.211] (107.191.0.158.static.utbb.net. [107.191.0.158]) by smtp.gmail.com with ESMTPSA id y20-v6sm21713954pgv.27.2018.05.05.07.42.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 May 2018 07:42:24 -0700 (PDT) Subject: Re: [PATCH] percpu_ida: Use _irqsave() instead of local_irq_save() + spin_lock From: Jens Axboe To: Matthew Wilcox , Andrew Morton Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, tglx@linutronix.de, Nicholas Bellinger , Shaohua Li , Kent Overstreet References: <20180504153218.7301-1-bigeasy@linutronix.de> <20180504162216.ae91654b68eddafe38df7d7f@linux-foundation.org> <20180505035154.GB20495@bombadil.infradead.org> <60a88d5f-95eb-ba45-e59c-5a822a3d370b@kernel.dk> Message-ID: <2d5aeec5-80dd-b7ee-ef40-ff3916c5ba04@kernel.dk> Date: Sat, 5 May 2018 08:42:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <60a88d5f-95eb-ba45-e59c-5a822a3d370b@kernel.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/5/18 8:10 AM, Jens Axboe wrote: > On 5/4/18 9:51 PM, Matthew Wilcox wrote: >> On Fri, May 04, 2018 at 04:22:16PM -0700, Andrew Morton wrote: >>> I'm feeling a bit hostile toward lib/percpu_ida.c in general ;) It has >>> very few users and seems rather complicated (what's with that >>> schedule() in percpu_ida_alloc?). I'm suspecting and hoping that if >>> someone can figure out what the requirements were, this could all be >>> zapped and reimplemented using something else which we already have. >> >> Note that I have no code in percpu_ida ... it's quite different from >> the regular IDA. But I have noticed the stunning similarity between the >> percpu_ida and the code in lib/sbitmap.c. I have no idea which one is >> better, but they're essentially doing the same thing. > > Not sure where you see that "stunning similarity"? The sbitmap code is > basically the blk-mq tagging sparse bitmaps, abstracted into a generally > usable form. The percpu_ida design works fine for lower utilization, but > it fell apart for the tagging use case where we can easily run at full > utilization. percpu_ida has percpu caches, sbitmap gets away with just > percpu hints. These caches are why it doesn't work well for > 50% > utilization. sbitmap also supports shallow operations, and online > resizing. Outside of the sharing the same basic functionality of "give > me some free ID", I really don't see a lot of similarities. In terms of > functionality, yes, I don't think it would be hard to get rid of > percpu_ida and just replace it with sbitmap. Probably a worthwhile > pursuit. Looks like it's just the target code using it. I'll spin a patch to convert it to sbitmap. -- Jens Axboe