From patchwork Fri Jul 15 11:33:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Foster X-Patchwork-Id: 12919120 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F449C43334 for ; Fri, 15 Jul 2022 11:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 90E9C9401A5; Fri, 15 Jul 2022 07:33:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73A879401E6; Fri, 15 Jul 2022 07:33:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A26A9401E3; Fri, 15 Jul 2022 07:33:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2074D9401A5 for ; Fri, 15 Jul 2022 07:33:55 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CEFD061542 for ; Fri, 15 Jul 2022 11:33:54 +0000 (UTC) X-FDA: 79689124788.06.957EEF7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 707F1A00A2 for ; Fri, 15 Jul 2022 11:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657884832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rQi4pNFFtGsmo7OJ1+D/r9WOH6atgY6YVCw1qpLS0HE=; b=GX+u0q80CG+xGNmE31pKN/iiNXbug+/DUkauSkFkZ/MHhJYcr7aMxftHCkHwk31G8Dj8nU HqRpwvNJX0O8/vTfaeJNGX/CNL4dmeBpPSQyH2Lc7RiJ9W7gkZCSN1YnQ0Jn7Hy+q41Wfs ECsHem9vNZQmI9NhTfte+keY3eVkeA4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-466-ktlvYmVeMGCp-7eWtuBoVg-1; Fri, 15 Jul 2022 07:33:50 -0400 X-MC-Unique: ktlvYmVeMGCp-7eWtuBoVg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C181B3C0D865; Fri, 15 Jul 2022 11:33:49 +0000 (UTC) Received: from bfoster.redhat.com (unknown [10.22.32.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 893482026D64; Fri, 15 Jul 2022 11:33:49 +0000 (UTC) From: Brian Foster To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Matthew Wilcox , ikent@redhat.com, oleg@redhat.com Subject: [PATCH 0/3] pid: replace idr api with xarray Date: Fri, 15 Jul 2022 07:33:46 -0400 Message-Id: <20220715113349.831370-1-bfoster@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GX+u0q80; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf25.hostedemail.com: domain of bfoster@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bfoster@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657884833; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=rQi4pNFFtGsmo7OJ1+D/r9WOH6atgY6YVCw1qpLS0HE=; b=J56WxOwxQ0TtWl6hkQR4Rvo6YuQoxbF7LO8kilbuTsHhLB99b6ASIAkhbKO/bSMkEO286+ QbhWQkzxwCMGfgGh50NwC1NDnVRF0pNErXN2pvuakDwTyUsF9ybCDJNnI2ofqUffJ5w9/8 2wKekSJ326Mbiaz3HTGi2sIgksRK3ug= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657884833; a=rsa-sha256; cv=none; b=ZYL+8IX+lVj4pBRgeu5ntu98umySYOaPB2dshY+uua3yEyOJwhkV0112C1s/JPtkFfRufv RQdjy6AB2hauvUIr4F67RQ0IRmF5UB++TNX2ddatcHe8abrtWCflT+XWBy2c2hirOXRDhk /pcQ1M31Rh1FdOigLE8mQBLPgiOs5X8= X-Rspam-User: X-Rspamd-Queue-Id: 707F1A00A2 X-Rspamd-Server: rspam02 X-Stat-Signature: 6uuie8anisdqu5r1wxgayrad3dsdyphi Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GX+u0q80; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf25.hostedemail.com: domain of bfoster@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bfoster@redhat.com X-HE-Tag: 1657884833-367755 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi all, This series is a few patches to switch struct pid management over from the idr api to the xarray api. The underlying data structures are already the same between both apis, but the idr relies on the old and slightly customized radix-tree implementation to accomplish things like efficient free id tracking, which xarray already supports directly. This is all based on a prototype patch[1] from Willy that fell out from discussion on a separate series to try and improve /proc readdir performance using radix-tree tags (to be replaced with xarray marks). I've basically split it up into a few smaller patches, made some minor tweaks, and ran some tests on the result. Willy, Re: the above, I've included your s-o-b on each of the patches. I'm not sure what your preference or the proper etiquette is here. Let me know if you want me to change authorship or tags or whatever in any way.. Brian [1] https://lore.kernel.org/linux-fsdevel/YqoJ+p83dLOcGfwX@casper.infradead.org/ Brian Foster (3): pid: replace pidmap_lock with xarray lock pid: split cyclic id allocation cursor from idr pid: switch pid_namespace from idr to xarray arch/powerpc/platforms/cell/spufs/sched.c | 2 +- fs/proc/loadavg.c | 2 +- include/linux/pid_namespace.h | 9 +- include/linux/threads.h | 2 +- init/main.c | 3 +- kernel/pid.c | 133 +++++++++++----------- kernel/pid_namespace.c | 23 ++-- 7 files changed, 85 insertions(+), 89 deletions(-)