Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp70127rwl; Thu, 6 Apr 2023 13:21:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YdTEiu7eRcVjNz8EOXJkxbIoC9kn1xaUezjDeA8y+oLj+GNW/Ac1qkWUJwEKs3MccX9BGA X-Received: by 2002:a17:907:1dd2:b0:932:c315:b0d with SMTP id og18-20020a1709071dd200b00932c3150b0dmr96379ejc.34.1680812463562; Thu, 06 Apr 2023 13:21:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680812463; cv=pass; d=google.com; s=arc-20160816; b=bx+B6pBglEdFBk8DduHj1O4rnuuugz+glSMXl+blXYDR5MTDHrVqwz0NLt9MDFRCrH 2gfC+yiBZyw0SphNhr3evl0tKr2pVCw2iavMTMtFPDg1oPtUoJu/GdP0v54FHW3Oya4j Y2Xvgw96Qr0SQjGjlJQ0unMICIdBoe6HMLjD/2CjjPcprfrlKCepDxqRH0LXqSiWL7zl misQt23WW3n9N6lLNS1jCCmXl1GyYNkcGxKuMc+s226+9Z5WlsMunClzqUAR/YQo85uN sjpxuumEnIu9kv/PA7NwJz9piGc6yVTXUwD3OmGKrxzDgFtTebWwwuY1zoF8TIFs47/Z T+zg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=JsXJij2NqlUSzBF+ZkH82taToQn2TAHyHVuuX8X+LF4=; b=rDZPxohRjwEt0do0sLnF9hMMiGzN9IzhYkLeO+bKnsMkMNm5ou2N6gGsrttcI/dqVE Qc1HMXVuIU4/lGte/FmKyTZcN+bbn6WLhE4r7P2ZhnzapIgeGyMxVM4u9ZuJcm8/Bm/U 96N8tqDkmFHyPSB5TEPf7XHGS1EEsPRkmZ+UXpS9009GV/jJLpGmi/5yhdQNZYmM74AV Pdnn7zTReaDi2h3R5E/S4hMN5dUoXZAhpg+QbIZXonxs4NkJx6RgodWb20QDsjW2OaCB zsayDLVdyWpRZKMQHkORRA0Hs8vPe+zo4pEdBpSm/g9GEa1IULthiqjRPzVtjqVcoRVq 38wg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=c1WpdP3t; 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-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a1709064fc900b00922f66a2949si2685355ejw.484.2023.04.06.13.19.43; Thu, 06 Apr 2023 13:21:03 -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=@Nvidia.com header.s=selector2 header.b=c1WpdP3t; 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-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238821AbjDFUSN (ORCPT + 99 others); Thu, 6 Apr 2023 16:18:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237787AbjDFUSL (ORCPT ); Thu, 6 Apr 2023 16:18:11 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B32215B81; Thu, 6 Apr 2023 13:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OLVCQLIXNmSNTnStB/dbKXOKU4wQiier5J3Y7+/TK103dnqk6Q1IClql4MubE55Ojas0KUADSmHrm354hVVoZSuH5o/te6TJzNkUYOWa2nEWeYQot5XRt2oa5yATHo/JCB39tiZTGVNa3sIfdGK+D+p9oRkjykR/EaVmxpGbXGiLXRGeN+61qyYcYzq9e5/rEqNU3YHML6lZccDr8q8S5WUJ4pJtot/XiW7KYEOeDSURwR1wIyViiXue1ckJViU12jg1erlCJSijkory5m8b0ayMyFCighLRG22XlSpAyYOTJsR+oSftyGG4dE0eXYsw3Gnaqi/UFwBQ/AkWcGh+AQ== 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=JsXJij2NqlUSzBF+ZkH82taToQn2TAHyHVuuX8X+LF4=; b=Mus6b7NiG4KNmsxLEuXfS6e9GEp5s7gvQ6pJPAu1MiqTB0gtaIDZn73UY/U0A7bdBUaENtHqUPWno6vPALP8ZKQ0IE92kGkumoGksYX+8U2dAnJC6Pu0+5z7bU4G0GK6XpTIzVZxGMreZX9j4FraVlt+wN/dgX/8C6ZGox+wgZ2fYJrOhg+tkOH1y3NgzZo4Zi2Hvb1S2+LCFraH0yv7ffj/Crhm/r/F9t6DnJoTuzaNWyGH82Ga5RljS4wp4ofehySw/Lrpi0JxmXvVOqX9CPS+HF3d6KwKD5rsrCPtXp94ZppGCuemBSXv6TjNrQIwQT6Y5Ua84+/QwadnDpfDiQ== 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=JsXJij2NqlUSzBF+ZkH82taToQn2TAHyHVuuX8X+LF4=; b=c1WpdP3tqTlMKMKpagP/xEW4b52hCIiyDCDXpDHNQyc1kZ6wEgbMVLJQnY1Y+Lt9UfG7Q/Gu2CIy298jjYxSu/H1iaMY/s4BfHrB3FMDjru8sIg2HJt4qoa5LLaXkttjliBAe02JnpRbWtwFfHtiiBmHYMTM2pGgXtMsZhmL/8CERT5tE62Ljf+eq6cMsryfJINuU3olw9xahmfsZHMD3swX/oBttjcgc7WBFiuMOQ1FZIVtAjPLsAk9XmV3phXs4wExoqsPtcBmH1+4BV0hMdtAfaZJaFEIJ4eQC26RBVVh98S3tvX2E/ol9V8VMr81RK8J+rELwd+6p3XyTgSy5A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by SJ0PR12MB8090.namprd12.prod.outlook.com (2603:10b6:a03:4ea::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Thu, 6 Apr 2023 20:18:08 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::14c1:21d:5f45:5b49]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::14c1:21d:5f45:5b49%4]) with mapi id 15.20.6277.031; Thu, 6 Apr 2023 20:18:08 +0000 Message-ID: <77a62c7c-055d-9624-54ca-28cdeaa3b353@nvidia.com> Date: Thu, 6 Apr 2023 13:18:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] arm64/mm: don't WARN when alloc/free-ing device private pages Content-Language: en-US To: Andrew Morton Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Anshuman Khandual , Mark Rutland , Kefeng Wang , Feiyang Chen , Alistair Popple , Ralph Campbell , linux-arm-kernel@lists.infradead.org, LKML , linux-mm@kvack.org, stable@vger.kernel.org References: <20230406040515.383238-1-jhubbard@nvidia.com> <20230406130720.ba11ed2de992cc4c2485ad5d@linux-foundation.org> From: John Hubbard In-Reply-To: <20230406130720.ba11ed2de992cc4c2485ad5d@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR13CA0068.namprd13.prod.outlook.com (2603:10b6:a03:2c4::13) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|SJ0PR12MB8090:EE_ X-MS-Office365-Filtering-Correlation-Id: 877cb641-0e4a-41be-3eb3-08db36dc09ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NvpPK6FfPPtmku9AQhJxEC+7P62tP+vjy6xDUpGi+koiASen6kofsbeRmLkRv+Yd0jUnFxE7uPNmi4oUihpP59FDIDnt96gl236tlt9yeUfxbaixnzDwd8CLIoxmk3aQP9+re7roVEhVqvy9ov7b4rfyUZJXXSQJgUOnVh3/0gemhsKfnRRpFWJkRpsXuQazkQecAvBOklveKLwidwr/pgNwudH0zzWrAwI9XKD6g/WavWmEaSPTYdZbjstzXeVFR5x1vL2n/wz1CbOVex1XWo5No2YvqiexKjGrfMlPrCZYiVzDqQroL22zAXt2/LbJgvzsUWmXrguc/MHoyiH9jigdDYuY+04q6boygJU0hQ2MIKocsUj0IegIWtB3y4FAmgsK5pLRtnWdDiEUQWVAZK07SbW8/E8YTUGe3TXzF6gD7CIMVcNISvBsX7J9C0KspoambbGb4iBGJiEGT4k0Q+vFAyy2YnAw/iDsMoTnEsM9iCM20Ief9zbQ/UIe0ol4g4iDV74hL1cCX3inwhg505ziSE0FABHzgqQ14uLBMAp9uubCg8sev3GhA7Vd9MgJAVkw3hAK3V63/QAIpcCK0ZFt0qvNaguVO0q+xmduxU8B/HtS3MkOkEL1M/qdxNf2Op0oWp7R3+emB2EDspPTkA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(136003)(376002)(39860400002)(366004)(451199021)(31696002)(36756003)(2906002)(31686004)(86362001)(83380400001)(6486002)(2616005)(186003)(26005)(6506007)(6512007)(53546011)(478600001)(6916009)(66946007)(66476007)(4326008)(38100700002)(8936002)(54906003)(66556008)(7416002)(5660300002)(41300700001)(316002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXVEZytuNTBLWnFlV252VDJrYU9lb25TTVlYWGk1KzBOSGROZnluRFBycm1P?= =?utf-8?B?OUJQV0NFT243RzlVdUhhaTRSbmhmbHhERWUxeVNEQkZqc2s5UmJnK0YxdXhP?= =?utf-8?B?cEJhczUwYTlYT2wrRU5HUnpveXBMVndRQjJIRnA2K0ZvNVRzbmxwNjR3bUNQ?= =?utf-8?B?Wmp1NzJ6UmdGSHVXeE9CMlJYTXJlbXhnd0tNZU9qenlCaHpGK3p2d0xSZDdJ?= =?utf-8?B?Yk9NRHdwUkVyK25PSVZGVk8zcHNJOW4wc2F3S1ZrSGVkbGFsaUpwUkIwZ2Ri?= =?utf-8?B?THFHTjJqWUp1VGhlUlQ1YVhOeElxSmI0dG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/K?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 877cb641-0e4a-41be-3eb3-08db36dc09ad X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2023 20:18:08.7648 (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: k7SDfzSPrP8KG4fFMKFMPJu3HaOX5hnjf4qfrAbUdtrXZ2FKHOE1f3isLnC7rnHuRjAfknLsSa0LiEAlG3UTzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8090 X-Spam-Status: No, score=-1.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable 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 On 4/6/23 13:07, Andrew Morton wrote: > On Wed, 5 Apr 2023 21:05:15 -0700 John Hubbard wrote: > >> Although CONFIG_DEVICE_PRIVATE and hmm_range_fault() and related >> functionality was first developed on x86, it also works on arm64. >> However, when trying this out on an arm64 system, it turns out that >> there is a massive slowdown during the setup and teardown phases. >> >> This slowdown is due to lots of calls to WARN_ON()'s that are checking >> for pages that are out of the physical range for the CPU. However, >> that's a design feature of device private pages: they are specfically >> chosen in order to be outside of the range of the CPU's true physical >> pages. >> >> ... >> >> --- a/arch/arm64/mm/mmu.c >> +++ b/arch/arm64/mm/mmu.c >> @@ -1157,8 +1157,10 @@ int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node, >> int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, >> struct vmem_altmap *altmap) >> { >> +/* Device private pages are outside of the CPU's physical page range. */ >> +#ifndef CONFIG_DEVICE_PRIVATE >> WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END)); > > For a simple expression like this to cause a "massive slowdown", I > assume the WARN is triggering. But changelog doesn't mention massive > dmesg spewage? Well, it should. Whoever wrote that needs to improve the changelog. :) > > Given Ard's comments, perhaps a switch to WARN_ON_ONCE() would suit? That would fix up the user-visible problems, which would be very nice. Meanwhile, I'm trying to sort out whether this really is a false positive for arm64. thanks, -- John Hubbard NVIDIA