From mboxrd@z Thu Jan 1 00:00:00 1970 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 D8F9CC4332F for ; Mon, 12 Dec 2022 02:05:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C37C8E0003; Sun, 11 Dec 2022 21:05:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 571A98E0002; Sun, 11 Dec 2022 21:05:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 412768E0003; Sun, 11 Dec 2022 21:05:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 30C0E8E0002 for ; Sun, 11 Dec 2022 21:05:40 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F0A54AA9BF for ; Mon, 12 Dec 2022 02:05:39 +0000 (UTC) X-FDA: 80232012798.23.036395E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 00379140002 for ; Mon, 12 Dec 2022 02:05:37 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Ea2Tj/qW"; spf=pass (imf09.hostedemail.com: domain of ikent@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=ikent@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670810738; 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:in-reply-to:references:references:dkim-signature; bh=KcoXdId9+WwBuH+gRgk9EJjde2pyS057yq6y4/z/asQ=; b=yXsHhStcYjRM2XH3jfyV9jm6cGRBlt4V95lQKC2XnpkIW4J6kQXElpHBkcTnVkISAR/RUE nHh/R/6UMftfEpduJC5gcAHyHcS3MMar/g/nW1pykf7aCh1PeFkqTcf4vxCLgOUrQMryqD Q2YVRufBUKDgwzLTYgNeBLORU6C0x8k= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Ea2Tj/qW"; spf=pass (imf09.hostedemail.com: domain of ikent@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=ikent@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670810738; a=rsa-sha256; cv=none; b=EPC/JHBiHDjuuU5ihRVi/jb39usf2eVNLE9DERkz3NKIdeU4RPemiwxZ7ZYihxgCGffnho 5UzkaUJcTg+TTAzIaVVFDtD76PLCKGVsspRyPzfpnNZ0RiWYuLlv6cA4hF0pSmhd5Gdq6/ 3kS/71/rxqLOuM6UHHHQbE+4KdofcVw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670810737; 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: in-reply-to:in-reply-to:references:references; bh=KcoXdId9+WwBuH+gRgk9EJjde2pyS057yq6y4/z/asQ=; b=Ea2Tj/qWmfwMTDtalRh9eWwBajO0cAVz7ZTZ7That9RFPi5855KhSnhWUt06HuYXLC4N4W bpG+vzQ0pXzrmuwHRr+beu8taO2SSsyXz44eg7weosGFf3+lqTmXCibiAJhN7a+vMX4zko 1NMu/8LzVssQLpEWDfRgQKTrR0oN8B8= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-398-FtQ7zr0XNQ2K_RQjaVMq5g-1; Sun, 11 Dec 2022 21:05:34 -0500 X-MC-Unique: FtQ7zr0XNQ2K_RQjaVMq5g-1 Received: by mail-pj1-f72.google.com with SMTP id hg4-20020a17090b300400b002215a3c02c3so345308pjb.4 for ; Sun, 11 Dec 2022 18:05:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KcoXdId9+WwBuH+gRgk9EJjde2pyS057yq6y4/z/asQ=; b=z1EuromAN69gEhixz3wUYwT4EsUEaEk9Mqp7KK0Ul27WVBWwjoxOIo2m3pXjuBg57V gaLbDHWe5z6qxqYF0N/H7rMjHwOlu6chmAdozvwbCc6smTi8T3krH9gZ+INr4jIUXGW2 7wHYyzbWTQOa5zAEfwddS0ArNPiqwLH7FUpLcbVlUFaFiGo7yha/hB+SX/xJ6sJ9lnHR d88ZxANgwp1jNhFQW0oKMtpgZsEMbBv1PK2h2cX/Jy+7BBqQsInLbeWZ5kPKgSvyXRr8 R1ob0HY00lVvgidFePp7HRlcUphiqfTOUODx4beXmqiMBaBzUWM1OZTnKEkkqIMSjkbY AdDw== X-Gm-Message-State: ANoB5pnUveUsdaknKyZBiLgu0uZ7kJ5SvuA3GTr3vD3IRnD23x4COchn 6gDJzCwKEBor/efzenAQgRr+bYQ/kflh2IX611KRj7PmJ8kEid3u+llZiIW4znqKiOOUDMWgcpw XRwbLD6hJT9aI8kTP6k5uxdmUOLU92Qn9BxGZFM4ScJhFPOrBUdGjHubH5J8= X-Received: by 2002:a05:6a20:8c10:b0:a4:f2e7:3ddb with SMTP id j16-20020a056a208c1000b000a4f2e73ddbmr17958917pzh.36.1670810732561; Sun, 11 Dec 2022 18:05:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7aCLSEyoJ7BBMHiT3mCrX87K6sPK5IjIUx454Tyd3aJ4b2HlJT4e0NaY+fcVHMckzeWZrVJA== X-Received: by 2002:a05:6a20:8c10:b0:a4:f2e7:3ddb with SMTP id j16-20020a056a208c1000b000a4f2e73ddbmr17958891pzh.36.1670810732163; Sun, 11 Dec 2022 18:05:32 -0800 (PST) Received: from ?IPV6:2403:580e:4b40:0:7968:2232:4db8:a45e? (2403-580e-4b40--7968-2232-4db8-a45e.ip6.aussiebb.net. [2403:580e:4b40:0:7968:2232:4db8:a45e]) by smtp.gmail.com with ESMTPSA id o24-20020aa79798000000b005745eb7eccasm4537805pfp.112.2022.12.11.18.05.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Dec 2022 18:05:31 -0800 (PST) Message-ID: <2d8ac4c9-abeb-6a36-6c96-b14a5a0a2a31@redhat.com> Date: Mon, 12 Dec 2022 10:05:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v3 0/5] proc: improve root readdir latency with many threads To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org Cc: onestero@redhat.com, ebiederm@redhat.com, Brian Foster References: <20221202171620.509140-1-bfoster@redhat.com> From: Ian Kent In-Reply-To: <20221202171620.509140-1-bfoster@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 00379140002 X-Stat-Signature: aonuxrrok1juibcq81xywwczxkbxfb5o X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1670810737-421637 X-HE-Meta: U2FsdGVkX18zoP2l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xkRD4= 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: On 3/12/22 01:16, Brian Foster wrote: > Hi all, > > Here's v3 of the /proc readdir optimization patches. See v1 for the full > introductary cover letter. > > Most of the feedback received to this point has been around switching > the pid code over to use the xarray api instead of the idr. Matt Wilcox > posted most of the code to do that. I cleaned it up a bit and posted a > standalone series for that here [1], but didn't receive any feedback. > Patches 1-3 of this series are essentially a repost of [1]. > > Patches 4-5 are otherwise mostly the same as v2 outside of switching > over to use the xarray bits instead of the idr/radix-tree. > > Thoughts, reviews, flames appreciated. It looks like there's not much happens with this change so far. Mathew, could we at least include this in linux-next, to see if there is anything obvious to worry about since we are fiddling with the pid numbering ... is there anything we need to do differently for these to be included in next? Ian > > Brian > > [1] https://lore.kernel.org/linux-mm/20220715113349.831370-1-bfoster@redhat.com/ > > v3: > - Drop radix-tree fixups. > - Convert pid idr usage to xarray. > - Replace tgid radix-tree tag set/lookup to use xarray mark. > v2: https://lore.kernel.org/linux-fsdevel/20220711135237.173667-1-bfoster@redhat.com/ > - 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 (5): > pid: replace pidmap_lock with xarray lock > pid: split cyclic id allocation cursor from idr > pid: switch pid_namespace from idr to xarray > pid: mark pids associated with group leader tasks > procfs: use efficient tgid pid search on root readdir > > arch/powerpc/platforms/cell/spufs/sched.c | 2 +- > fs/proc/base.c | 17 +-- > fs/proc/loadavg.c | 2 +- > include/linux/pid.h | 3 +- > include/linux/pid_namespace.h | 9 +- > include/linux/threads.h | 2 +- > init/main.c | 3 +- > kernel/fork.c | 2 +- > kernel/pid.c | 177 +++++++++++++--------- > kernel/pid_namespace.c | 23 ++- > 10 files changed, 132 insertions(+), 108 deletions(-) >