Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp926705rdb; Sat, 6 Jan 2024 16:41:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZHzO4PnAz+wxT46mosxsACnqHfd//DN5ylCFeO4WlpoTDHQG1NOxDUnXatEzyehvXOx+N X-Received: by 2002:a17:902:788c:b0:1d4:e04b:62b7 with SMTP id q12-20020a170902788c00b001d4e04b62b7mr1941317pll.94.1704588069365; Sat, 06 Jan 2024 16:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704588069; cv=pass; d=google.com; s=arc-20160816; b=KqxQWCAYIx6qHdc9ndIFX+mu7XX7A2iJcRVQAY/bvOExYn0KWs75JvdoMb4ekWCd/B 1Q4hDnatt7XgW1dSnj8EzCXYjCYsfe1ikE9rIx7tTB9HBa6gciQcC1w9B+0zL4/CQkIX meShwDatPzmoydSXlxCiaCSs9BZswucQJ2Ij4mltP5rk3gBz2dxzTkS76GsxebGR7w4f XAzfUUNHIyl3UJXJVzQsh0yi2RSSWZOfSh/MyzlCRoLKxfMcx4/8qNkayqfz5B2+LdUQ hu0voWPjGIOLMu38g6ElrQXVl87TgC0xfl3LfdETtlVif+qc94hS1Mc+lfpqYk16Vzll ERUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:date:message-id:dkim-signature; bh=FzJsCxke5Z3C/RxMPOGmi7I5L7htq0JE/iMNPQTK4uA=; fh=tdsBT07nQDImcdjiYwfR+yrupYIiarJpojMyVHSahMQ=; b=FH2DZsLpVKRcpa34EkTsgFb/6RWzsKu2G6Xc1hc0jqTGcS67SOczsvx58h8CCXC8HZ fzfdYKFJeOZ4WViT1iHF1tyBljxH/fowlwEYbKQpFhzg4WoeqPSI1AP4BrWwTyaqAG8L PRRJ+z9eOwVT5PWz+F8LZU+PfgQ0UYqNel82ACKfkaPBoQ+TcPxKi0QE6bsSUSiYN2ME bJqKosLxSr+Byafqo6v9mjVll7PHiqEgI00R9MYNsUUfU90dNOyMdPw/8jcc0V5fat49 It0lK26YX5t76W5b83svYNjqi2+AMFnW5tMMrvQxWoIRHtHiihefqO/EkzbcdxwzK0te Lvog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=AXRimFQP; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel+bounces-18749-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x4-20020a17090a9dc400b0028cd9049885si3291832pjv.67.2024.01.06.16.41.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 16:41:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18749-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=AXRimFQP; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel+bounces-18749-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B6BF8B21E1B for ; Sun, 7 Jan 2024 00:41:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 939A015A3; Sun, 7 Jan 2024 00:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="AXRimFQP" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2070.outbound.protection.outlook.com [40.107.244.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 367015241 for ; Sun, 7 Jan 2024 00:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVrxYwx7mu2XauBeEvtwJpM8xiYYZa+qsyCVMdeRg4K3qmvZmss1pFnmaHVYqZzp/ehEmLivPH3RC29r7dwtj0hwIR788p802neTQUPYWXvFZmm5xwW3i/oZM3DKDiFgvFkYnP6+L7I3fdllFGoBeyRA71421XfPGJp4jBHjCURka3jLH4nJHu2tpk8hbdT5f6s4cyziYglQUw3ovyutsatBXOQIuhjawZg239Mlhy7TGqntwyajyWt3/qKbY23tKoaQV35yW5hc+NDdtBF8uk2x5WF4wXcZByWJvpewNeQrMOTp1RHlRdy5aiAz6OKjLFPU7B3dnb3HTWSd1iV9kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FzJsCxke5Z3C/RxMPOGmi7I5L7htq0JE/iMNPQTK4uA=; b=lHDAVrUNVLxFBHIJw2l5uIZCmwpoT829JdMsgUpaxmG8HKFKI5K0BTktvSiVFStVCn6p+qpcB4oWCi8eEaouVwHKzsyB+uoIPmIEUoH/x+oF8CWRewaHfUZn/+CKl4wMuCz2wErGWmg6IOA0syiDkmS2jYBdapOhVrYe/j/eNgVkKmN6NXf2tMslmVGMr9r7djOK+r7mbnTRik3wNSRHsEhvUHDw29MOU1Fx90SaF4rsdCd5L10xtng6f6X1ndOFdyt0EWM/iopX76LSJv1npiJynlPRUI1x1M4KH9zWexzS3GYxQVl65BgUhZkKss6Z3az22x7gUk6pOS1NcXxTWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FzJsCxke5Z3C/RxMPOGmi7I5L7htq0JE/iMNPQTK4uA=; b=AXRimFQP1cg9ohU1M5tEWpwCPmF4LWK31HfAAFNwGgeDK6RP8UnUIzXwneVnfN5ptAsqTKkTOAIdG4nWqmECBwRN3b0GkWohDw1U6bR7dtmci5onLnCS13aw4zU9M1DGiUeFlPwkmFpO/jDS1bRW70TCL1efCwkWM2M2J65ENWMmUlDPOSkk2phh+8XZoSNpBuciKhFa9YUyR5Lw3LmV2J7GeTtbK9ygaa3QvBJAX2fHCMT40y/6Os9J3S01Zmx5m5WCHlG9wKmIfOZkWeDPTR5PD8OFeiqilgIapttiornRY0nx/4KtdvWQnAmTMF96Z3HLak6Xh10GZhSeczxPzw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM4PR12MB5040.namprd12.prod.outlook.com (2603:10b6:5:38b::19) by LV2PR12MB5846.namprd12.prod.outlook.com (2603:10b6:408:175::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.20; Sun, 7 Jan 2024 00:40:54 +0000 Received: from DM4PR12MB5040.namprd12.prod.outlook.com ([fe80::6f3c:cedb:bf1e:7504]) by DM4PR12MB5040.namprd12.prod.outlook.com ([fe80::6f3c:cedb:bf1e:7504%4]) with mapi id 15.20.7159.020; Sun, 7 Jan 2024 00:40:54 +0000 Message-ID: <19075505-b1a6-48d3-9732-7277c4697cf6@nvidia.com> Date: Sun, 7 Jan 2024 02:40:49 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] nvme_core: scan namespaces asynchronously Content-Language: en-US To: Keith Busch , Stuart Hayes Cc: linux-kernel@vger.kernel.org, Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org References: <20240104163826.10561-1-stuart.w.hayes@gmail.com> From: Max Gurtovoy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0277.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37a::8) To DM4PR12MB5040.namprd12.prod.outlook.com (2603:10b6:5:38b::19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5040:EE_|LV2PR12MB5846:EE_ X-MS-Office365-Filtering-Correlation-Id: 39249b7a-b77c-4c0a-0625-08dc0f194e46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KmfZ8m3gHgUZWZVbJi/XKLWYfaXpnGhCcHsiQZ2aTV3qX/7tTLY+GcjydQKUmAITab4wu0E7WvhKkzawYI4fqZTKZkhXgtWNW7KsTwFGzPPv1BSCq2gMmaPl2gt372d4jC0EqWpJ+TrLR07jSGE26BLyg/iIwYJTHLtpTDLaK0qgKfEX68RHWN24WePaZQMG05dytWfD+ACuew80UWDbgSodAGlZRkFV6Mj6jdKvrz4zM2UaMvv+5pfxp4tGFYiiZQvXF8gbNh7ZBJr7ShicGh/A+xPOJ2UEQOa9b/rh/+lIZuI2FzVSXGYsGqJIi9u61Yuzh5gyqDy+NuGmnqy0Wxf0yDO/Zn7pbHGEFfr/n2Bobuy2tj296jcX64pdtaebQsQqZUBHCSF/VEV1OP55gsOvuof1TQ4zNf+GEGe1wfVrtZETykUoBwvCsBdxHIK2cLhVWy7mAI8ApPCpyOPTAyhTbn0BapxU5vT7VDbPD262+L3DnT495GNUXkkgHSM4U5R4qbHh2BGTC+WLq3nhv++eCUuBIut7kaEsg3AM0OAV94IVF8G6deZg3h9bo1FGM8M2Ji+20f4Tj5Vt4Ih0WV+4wqdtJU+4hRdMkRNLp5vNC9XTZiSHntdVLbu+BOpYF68HTmphvHyVKGOdqz14Wg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5040.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(346002)(136003)(39860400002)(366004)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(53546011)(26005)(2616005)(478600001)(6486002)(6506007)(6512007)(6666004)(83380400001)(5660300002)(2906002)(41300700001)(66476007)(66556008)(66946007)(54906003)(316002)(110136005)(8676002)(8936002)(4326008)(38100700002)(36756003)(86362001)(31696002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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=?utf-8?B?ZWlEZzJIemFhVWplQjJ3cmRlMGh5UlNUV1JyNkk1ME42MkdtbG0wOGlhVzdU?= =?utf-8?B?MUZFNzJ4LzdDR3NYTTlWWFB0WW84TGZYMUpwQWJXR2NFRGphRU1OVVZIekxF?= =?utf-8?B?YTNCTktFZ0tuWFJhb3Y5TnJISlpuZG91ZUg1WVFZeXE4THlEL1RRcGNOZ0Jr?= =?utf-8?B?dHRpVlpoU2ExQVNOenhvMlJScnhSQUdhZVYwL0M0MFNlTHkva2xRUHVPZk1K?= =?utf-8?B?MSt1L0ZzL2FQdEhSckh1MU9BY1FmMmlBNUp6OGVsT1lZTWIzU3VwMWFUQ3J1?= =?utf-8?B?TngvQ211Yk5FNFBXZ2F6dktGNkNQbXY1RFN1SHhEMmY5SWVXUDloY1BJSDhZ?= =?utf-8?Q?wObSCr/6BYAPoeISzW3VmgbXp?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39249b7a-b77c-4c0a-0625-08dc0f194e46 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5040.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 00:40:54.3748 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HVqflUqeXrt+L8L5C3WhZxf2VdGKYOlqx+AeYnMktdLxNSiKW84hhAJAWfUdCptPYLOXVIdUrEkuTHx25B1ZGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5846 On 04/01/2024 18:47, Keith Busch wrote: > On Thu, Jan 04, 2024 at 10:38:26AM -0600, Stuart Hayes wrote: >> Currently NVME namespaces are scanned serially, so it can take a long time >> for all of a controller's namespaces to become available, especially with a >> slower (fabrics) interface with large number (~1000) of namespaces. >> >> Use async function calls to make namespace scanning happen in parallel, >> and add a (boolean) module parameter "async_ns_scan" to enable this. > > Hm, we're not doing a whole lot of blocking IO to bring up a namespace, > so I'm a little surprised it makes a noticable difference. How much time > improvement are you observing by parallelizing the scan? Is there a > tipping point in Number of Namespaces where inline scanning is better > than asynchronous? And if it is a meaningful gain, let's not introduce > another module parameter to disable it. I don't think it is a good idea since some of the namespace characteristics must be validated during re-connection time for example. I actually prepared a patch that makes sure we sync the ns scanning before kicking the ns blk queue to avoid that situations. for example, if for some reason ns1 change its uuid then we must remove it and open a new bdev instead. We can't kick old request to it...