Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3346970imw; Mon, 11 Jul 2022 07:02:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1verWDGs9RNiBWIqDexQ6D5fW7yKbjQ72FD/dPzGloCN4l/+nELdEeOrHckb37BPWLKUuPM X-Received: by 2002:a05:6402:782:b0:43a:7387:39df with SMTP id d2-20020a056402078200b0043a738739dfmr25767377edy.251.1657548128546; Mon, 11 Jul 2022 07:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657548128; cv=none; d=google.com; s=arc-20160816; b=CouH6qTI/7vcbNE4icm3aR29SfHyFU5vwtUN8mCI02GrOsbUqw1uMwhW1puW3u1ZjR aXMhG3BU4E7q0NM6zLHeCmG2vOFn4/fFI6oXdDOVrcPnElYLI7B4duArpWeDUJxUGXXh fCqyxHnpK4lP/w6chuDAlehADU1MUDw3AfnDdk8h37KzqFMV7OnyZXRupAG9PCA7/lsC +2B/CqoJfjkz5vgBLBL+7MDkkTyCIFp6welNLHu2cMo9QzGsLXyls4IH/+ikDCCRGEY+ CsOg/GdyoPpYfXTfbhLF2O7QC0eO0Xg8u3LQCM86AlTKkP/7xDTlWjq/vsfnKaWpsdHp lyCA== 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=B8Y4HFJmfm6wiSpdeDdEueqA+VS1b+BD/sEuMVwHJLs=; b=mHLMAjQLAX1ZK6Z+Hbqp2gGidJCpRwN8QkC7MwSSVo0gF027kVzZc3cO8ZqkINVKPZ 81G/sh/ekNkce0kJibRAYudTgy/gf0dix5Hc8324KnVyo+BlpBwp6HGOjed5C/OdoChj Vz4me1S16FJwfsw+Xe1A+eMUT36hXOQDJTWjUSGDlBPSJ3MOe5o4D8R0o9bM78h2PdR0 5rxCdM0MUrk4gWuIYGr4RD4p7NaeU9070JUf9lfIcaWD7ilZy35jaZO5DJ7UHbosAaoJ VL2sQFNZm//R4Bd9xQxP4kQkxOhRqKII9sPhvGv7vTucoSlBrVhiKWyYi0qYLdakYQve HzoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AZfpP7U9; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a50eb06000000b0043a6e52c416si8618394edp.162.2022.07.11.07.01.39; Mon, 11 Jul 2022 07:02:08 -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=@redhat.com header.s=mimecast20190719 header.b=AZfpP7U9; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbiGKNw4 (ORCPT + 99 others); Mon, 11 Jul 2022 09:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbiGKNwr (ORCPT ); Mon, 11 Jul 2022 09:52:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 354BE61D9E for ; Mon, 11 Jul 2022 06:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657547565; 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=B8Y4HFJmfm6wiSpdeDdEueqA+VS1b+BD/sEuMVwHJLs=; b=AZfpP7U93Q1yi8M3SU6YnNePu0vRVRYHppdrWCGvd4XKeFRk0gHUCIVMxtvpSthW068Eyf k7edZaPpl5OKpGPpuhBZLRDbeQsFhBSYh0qqEjDr5K4YOTA3dGmHWvOUyzXmERsOvK8B4D 9J3jtL5e+8wxkAGfdoHbsy8eFY22NII= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-iOyu9WOxMYa5K0GaEuP3hw-1; Mon, 11 Jul 2022 09:52:38 -0400 X-MC-Unique: iOyu9WOxMYa5K0GaEuP3hw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9E501857F02; Mon, 11 Jul 2022 13:52:37 +0000 (UTC) Received: from bfoster.redhat.com (unknown [10.22.32.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 968942EF9E; Mon, 11 Jul 2022 13:52:37 +0000 (UTC) From: Brian Foster To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ikent@redhat.com, onestero@redhat.com, willy@infradead.org Subject: [PATCH v2 0/4] proc: improve root readdir latency with many threads Date: Mon, 11 Jul 2022 09:52:33 -0400 Message-Id: <20220711135237.173667-1-bfoster@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi all, Here's v2 of the /proc readdir optimization patches. See v1 for the full introductary cover letter. The refactoring in v2 adds a bit more to the idr code, but it remains trivial with respect to eventual xarray (tag -> mark) conversion. On that topic, I'm still looking for some feedback in the v1 thread [1] on the prospective approach... Brian [1] https://lore.kernel.org/linux-fsdevel/YrykXim1t71TgdYg@bfoster/ v2: - Clean up idr helpers to be more generic. - Use ->idr_base properly. - Lift tgid iteration helper into pid.c to abstract tag logic from users. v1: https://lore.kernel.org/linux-fsdevel/20220614180949.102914-1-bfoster@redhat.com/ Brian Foster (4): radix-tree: propagate all tags in idr tree idr: support optional id tagging pid: tag pids associated with group leader tasks procfs: use efficient tgid pid search on root readdir fs/proc/base.c | 17 +---------------- include/linux/idr.h | 26 ++++++++++++++++++++++++++ include/linux/pid.h | 3 ++- kernel/fork.c | 2 +- kernel/pid.c | 40 +++++++++++++++++++++++++++++++++++++++- lib/radix-tree.c | 26 +++++++++++++++----------- 6 files changed, 84 insertions(+), 30 deletions(-) -- 2.35.3