Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1120241rdg; Fri, 13 Oct 2023 10:46:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErKKSkyInrHaC5hs0zLb+xAiVOxOWvXOcobrFmeJSu3MPPL3ERRFF0TfOVQJeshNCVt+y7 X-Received: by 2002:a05:6358:1ca:b0:134:de8b:17f0 with SMTP id e10-20020a05635801ca00b00134de8b17f0mr27852162rwa.19.1697219163671; Fri, 13 Oct 2023 10:46:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697219163; cv=pass; d=google.com; s=arc-20160816; b=BNh7xz3thxEPe9LFbbkQndZGUeqrH/W2SZowukcH2jpNPbI07MadbyhSm1bY7SHrdL YpX8yAeoD50jFfSnQlQ5yRiM0RDGUMfUehqeDStGy/YEsuVTjy8EvHSIMDMq0To0fDL7 PM6x3JYKbv6oBNLRjm3IOzbWY/AV3uwUoO3azrno7G7g6fWHpf//oB4WFW5jZrGffcxY oimXOcO7CMeT8ChylpjNbKP2pS6SU8AZzwdjhmXcgtqvjp9g3IsBjMSedikRYfETF2ZU AVgN73CRPwRStw09e3wlVsC9ZKIt/4MRwhJTtgLc5gT5jU2hTc343UAr/JPGiv0QZTJM Zg1g== 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:autocrypt:from:references:cc:to:content-language :subject:user-agent:date:message-id:dkim-signature; bh=ZsJgqm2EmKIY047/+Gll0nH87bZ2rRFK/tV2aJMRVPw=; fh=wo5ClMV52rrSZu7LAH/m4oso4bPrqtN3xdxCdZxcclo=; b=khu67AzT8+6ezAgskOtb5U4UxK48XyIUIkzSU2PfZOrVJ50dTm/SDgCnQ/uGrs5qtQ q09+j9/Ckx34SRwd0mkKDroBPnt4AigQGWvwYzCskzD/y2B1pri73lD8/MVIeY1hOf1F UfdnG8/YXATbppawzVWKmLNY0fQfUMqOCweaEzYlApgO/QHP6xf6SJkhuopa8EXsFfK1 lm/1Gr6z5sHwQkzvjKaXpnVRGjTGMluLha4xlqcdubFL7jsHVpbEgxLZuzW2Z8yXIQk/ UPzz3nFPBKcC0gecHCzVJf+UdqF9UA2YZkCwhogZWEBYxCzeUeVpvNJsEBBo73E7HLJj EYdQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WzIjCbRW; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id l24-20020a637018000000b00585999a38a6si4723855pgc.793.2023.10.13.10.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 10:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WzIjCbRW; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9611680E5B8C; Fri, 13 Oct 2023 10:45:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229743AbjJMRp3 (ORCPT + 99 others); Fri, 13 Oct 2023 13:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjJMRp2 (ORCPT ); Fri, 13 Oct 2023 13:45:28 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2058.outbound.protection.outlook.com [40.107.93.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A8AA9; Fri, 13 Oct 2023 10:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PZKFWuxT3GgMK8QXWcUR7W3aVuqXxLgKUQ5YiG5lWxvRsUBTDd7YaxPSkpWuQNGnux8eNjgg0yaKIrffxjb+WcTOatYJrTZHgAhCi/O6jYVNGrzFUEpAf6JlHwG5twkFtwlxRPuh17GD666P6C1dDOf13WVEyqU9sm9b9RDYlz0jW7Cbw+TQcyo2ez/IX4Tv+bk5uQYLUDh5794qM+rJDz9FHlCo5MaPvRQ7HFvofLYT0FSP6vialYAu0MPaM8WgTM3wpyMsNI0wiwkIqlJr/3VyqhCoGCeq74whZB7ivhuhKnSrgwakn9nlvEHfCebkVl4LvhhEN5HGNr4HA8JTew== 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=ZsJgqm2EmKIY047/+Gll0nH87bZ2rRFK/tV2aJMRVPw=; b=YbC8LnVG0Ax85lkP72lWspm9o0Pj+1FiNhufBGUayQuffyzZq9002WVFlF2a4nwHxP34i4T5JHCBQwDnayDHyr+RcxZfsBbaE+7kllwgrEqPsQyOX0lIipwfjdfwXpjs79OytVj/EPH0e/QfqnNp4kpImxd26HWHovPKsKJgaJCPOnie/th6oKmqnpZyza+sms7k/FfRRAb1wA4TaOfT59mU1RKPJNLIXlYIABEap/Itaxc/cMqgxiOEBTULbJjMH26YboQAa8h8S0S1ciE6Ihn3NASP8CCSnzEI4US0X+cm6+0aWCBSVxBX2tlU//MgV1LeXuBu27fPjG/H/KiebA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZsJgqm2EmKIY047/+Gll0nH87bZ2rRFK/tV2aJMRVPw=; b=WzIjCbRWcdFtDvHD7Hz8bRCJ29bm4MYMSPz+ZjbILUSe/CfKedehiDinmCc3hhm6o8ZzzfAEku9fNYfQpOpfNl5yv1IIYhpNXs6TXMcoAjYoFA6OlQtm7iODGXHpzwEDxGy3pSnMoeYWxwz67DhCEfpdzW6HW6R007CDYHZPktY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) by LV2PR12MB5775.namprd12.prod.outlook.com (2603:10b6:408:179::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Fri, 13 Oct 2023 17:45:23 +0000 Received: from BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::a13:336d:96a5:b7bf]) by BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::a13:336d:96a5:b7bf%4]) with mapi id 15.20.6863.043; Fri, 13 Oct 2023 17:45:23 +0000 Message-ID: <3577c8a5-3f88-45b8-9b41-2fb5cb6dc53a@amd.com> Date: Fri, 13 Oct 2023 12:45:20 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv14 5/9] efi: Add unaccepted memory support Content-Language: en-US To: "Kirill A. Shutemov" , Michael Roth Cc: Borislav Petkov , Andy Lutomirski , Dave Hansen , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Mel Gorman , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230606142637.5171-1-kirill.shutemov@linux.intel.com> <20230606142637.5171-6-kirill.shutemov@linux.intel.com> <20231010210518.jguawj7bscwgvszv@amd.com> <20231013123358.y4pcdp5fgtt4ax6g@box.shutemov.name> <20231013162210.bqepgz6wnh7uohqq@box> From: Tom Lendacky Autocrypt: addr=thomas.lendacky@amd.com; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH98EmVJsADuq0RBcIEkojnme4w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UQTNxeHC/CPlvHWaoFJTcjSvdaPhSbibrjQdwZsS5N+zA3/CF4JwlI+apMBzZn otdWTawrt/IQQSpJisyHzo8FasAUgNno7k1kuc72OD5FZ7uVba9nPobSxlX3iX3rNePxKJdb HPzDZTOPRxaRL4pKVnndF2luKsXw+ly7IInf0DrddVtb2647SJ7dKTvvQpzXN9CmdkL13hC5 ouvZ49PlXeelyims7MU0l2Oi1o718SCSVHzISJG7Ef6OrdvlRC3hTk5BDgphAV/+8g7BuGF+ 6irTe/qtb/1CMFFtcqDorjI3hkc10N0jzPOsjS8bhpwKeUwGsgvXWGEqwlEDs2rswfAU/tGZ 7L30CgQ9itbxnlaOz1LkKOTuuxx4A+MDMCHbUMAAP9Eoh/L1ZU0z71xDyJ53WPBd9Izfr9wJ 1NhFSLKvfA== In-Reply-To: <20231013162210.bqepgz6wnh7uohqq@box> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DS7PR03CA0274.namprd03.prod.outlook.com (2603:10b6:5:3ad::9) To BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5732:EE_|LV2PR12MB5775:EE_ X-MS-Office365-Filtering-Correlation-Id: b4ea073c-de46-4ac2-6b88-08dbcc142d55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4hbc5e/d3ADRKNqTc3brbq2S3VFVJg958FBbFtgHIsopb5lN/exj6Os8v6xOojbf5V0FPHWq/Iw7HxdUcNeiK9j3pK3pe4Hbyp5uhscGeq/YcXHRHQV3NIo16vu2H1I9PopkFVe5zCyEpH+l8fzE3JDh9XwlmcX/OXHuN4iENI5cnjtdYyBU3kXWTHvdq9YNP4st8f4AF3/O3XOo2kQwN3dgLyPdDncczFo1G63Yl2LmRUbbU/yOBY099ugqfjKJQbtPPFwxz2UnvNjEOfTjBip4pP7k3dLeKKTz2CccX6ytjKVzRUAu5qgiDsm+uVmTFsODWSUF/BvfMOmCZIcszEwbyiZ3xgT3oPI0rXk/+LN33CY62+UbMhMmMQgvRnZ5DTTCuEg4blaPGrQT8CBiTZkvXz8DZtWzPz6Eec2xej1nBPVFBsoWXhqIAaKENHdP/vvT6Adz2tr3RnqjCXpjf/+RZkVqJ8VSSCKYPpbcTT2eR6+WrboituKs9/BDr8QCYDZN+zqveOjWWJt1sFNzF7eZcx3hl9HNbtTZbUkb5S6EvOmeCEjcTm7wQWSTIPdbsahbayxrXVQic270g5eYG7GH0jImrmpv1un7vpZ8/7jhO9qu56c84Ht6lQzn9RMwKg0D8W1kcB4yHY24B5zwzbSzal5SvkuAy9PGcAB0vNoNjivyhJPZTwTnsLguIQtL8t84LbXhxbWkYb+6s6jYuw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5732.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(39860400002)(136003)(396003)(366004)(230922051799003)(1800799009)(451199024)(186009)(64100799003)(7406005)(7416002)(478600001)(2906002)(6486002)(31696002)(41300700001)(4326008)(8676002)(8936002)(5660300002)(66946007)(66476007)(54906003)(110136005)(66556008)(316002)(83380400001)(36756003)(6636002)(2616005)(26005)(6506007)(31686004)(6512007)(53546011)(86362001)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NEsvODRMMGtmdUwzSklFS1hEajhWbGVPall6YlhGOGZmb1FtQlJTTXpmaThn?= =?utf-8?B?Ti9QVm1JSHJQbVZvS2N1RmIwVmtTTVkwakJmWUVMZmFsQnVZN2pVMkZFdFpG?= =?utf-8?B?S2JKbm80U0dMSDRmTXNZZzZ3W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f-8?B?MEF3d3RRMVk4RGZEakh3SHBvWE5CM2daQVIzeFkvSXl6K2ZGSWt1WVJxQVI2?= =?utf-8?B?QU9Wa3h1Vm5td2prdW9WVlRnRGxpNkhlRzN3N1Mwa0QvS2RsaTV5dTJvTWFo?= =?utf-8?B?bEh0TTNjelcwMzdBMHpEbU5ud0xPNWV0S1EwQklxak1pZTlUZkhFVjQ1QnZr?= =?utf-8?Q?2889BJQL8w2d3GbSkHhtaaBOR?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4ea073c-de46-4ac2-6b88-08dbcc142d55 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5732.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 17:45:23.6544 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SngjWU2R43FTysx65msH/iIV0acqa27BX0WVYYAdZyWJ9xz+VOwnxVheUoMRptMu0C2tvcXNOpP2vjqv1QqKQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5775 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 10:45:48 -0700 (PDT) On 10/13/23 11:22, Kirill A. Shutemov wrote: > On Fri, Oct 13, 2023 at 03:33:58PM +0300, Kirill A. Shutemov wrote: >>> While testing SNP guests running today's tip/master (ef19bc9dddc3) I ran >>> into what seems to be fairly significant lock contention due to the >>> unaccepted_memory_lock spinlock above, which results in a constant stream >>> of soft-lockups until the workload gets all its memory accepted/faulted >>> in if the guest has around 16+ vCPUs. >>> >>> I've included the guest dmesg traces I was seeing below. >>> >>> In this case I was running a 32 vCPU guest with 200GB of memory running on >>> a 256 thread EPYC (Milan) system, and can trigger the above situation fairly >>> reliably by running the following workload in a freshly-booted guests: >>> >>> stress --vm 32 --vm-bytes 5G --vm-keep >>> >>> Scaling up the number of stress threads and vCPUs should make it easier >>> to reproduce. >>> >>> Other than unresponsiveness/lockup messages until the memory is accepted, >>> the guest seems to continue running fine, but for large guests where >>> unaccepted memory is more likely to be useful, it seems like it could be >>> an issue, especially when consider 100+ vCPU guests. >> >> Okay, sorry for delay. It took time to reproduce it with TDX. >> >> I will look what can be done. > > Could you check if the patch below helps? > > diff --git a/drivers/firmware/efi/unaccepted_memory.c b/drivers/firmware/efi/unaccepted_memory.c > index 853f7dc3c21d..591da3f368fa 100644 > --- a/drivers/firmware/efi/unaccepted_memory.c > +++ b/drivers/firmware/efi/unaccepted_memory.c > @@ -8,6 +8,14 @@ > /* Protects unaccepted memory bitmap */ > static DEFINE_SPINLOCK(unaccepted_memory_lock); > > +struct accept_range { > + struct list_head list; > + unsigned long start; > + unsigned long end; > +}; > + > +static LIST_HEAD(accepting_list); > + > /* > * accept_memory() -- Consult bitmap and accept the memory if needed. > * > @@ -24,6 +32,7 @@ void accept_memory(phys_addr_t start, phys_addr_t end) > { > struct efi_unaccepted_memory *unaccepted; > unsigned long range_start, range_end; > + struct accept_range range, *entry; > unsigned long flags; > u64 unit_size; > > @@ -80,7 +89,25 @@ void accept_memory(phys_addr_t start, phys_addr_t end) > > range_start = start / unit_size; > > + range.start = start; > + range.end = end; > +retry: > spin_lock_irqsave(&unaccepted_memory_lock, flags); > + > + list_for_each_entry(entry, &accepting_list, list) { > + if (entry->end < start) > + continue; > + if (entry->start > end) Should this be a >= check since start and end are page aligned values? > + continue; > + spin_unlock_irqrestore(&unaccepted_memory_lock, flags); > + > + /* Somebody else accepting the range */ > + cpu_relax(); > + goto retry; Could you set some kind of flag here so that ... > + } > + ... once you get here, that means that area was accepted and removed from the list, so I think you could just drop the lock and exit now, right? Because at that point the bitmap will have been updated and you wouldn't be accepting any memory anyway? Thanks, Tom > + list_add(&range.list, &accepting_list); > + > for_each_set_bitrange_from(range_start, range_end, unaccepted->bitmap, > DIV_ROUND_UP(end, unit_size)) { > unsigned long phys_start, phys_end; > @@ -89,9 +116,15 @@ void accept_memory(phys_addr_t start, phys_addr_t end) > phys_start = range_start * unit_size + unaccepted->phys_base; > phys_end = range_end * unit_size + unaccepted->phys_base; > > + spin_unlock_irqrestore(&unaccepted_memory_lock, flags); > + > arch_accept_memory(phys_start, phys_end); > + > + spin_lock_irqsave(&unaccepted_memory_lock, flags); > bitmap_clear(unaccepted->bitmap, range_start, len); > } > + > + list_del(&range.list); > spin_unlock_irqrestore(&unaccepted_memory_lock, flags); > } >