Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp537318rdf; Fri, 3 Nov 2023 07:54:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQBOa1oevJaUcXO7CQ/Wp7Ksnwf3hnsGEVc/d3lCiPYpFipkPMCEPU6qpphKRoi7L0MCDS X-Received: by 2002:a17:90a:440d:b0:27d:9b5:d6f8 with SMTP id s13-20020a17090a440d00b0027d09b5d6f8mr16087676pjg.49.1699023264410; Fri, 03 Nov 2023 07:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699023264; cv=none; d=google.com; s=arc-20160816; b=JfLHUxKMJPJXBM1P7UwWhLwPhs/R4VJGEAkcgdjyTuS7WzJoPn/TskkQGL/SrWjw5G N0Jjblp93U+P8eBGqKwnPEe/VY/8Q/PzcECBX2NB+V35tfE1UXxxPxlSEmCnjP6vFgY7 3E+spjwBznJVh738JJaJaBVmEUS/VM6xjacgiHyyCrHJ2vOVZjX5HuYkme5CuEjM055k 1mTqyDc/lKpJ38C7EmS65RgZsV45ba6PpW4urwXvgqsm/EUQQFwl92j3tkK/lOErv80W HVxVRKfTQ6fh3EbsimK8hTn9AaXJqF5QJQPJSC2iVH6pNSdKxBGoCYuGUVUE2t2H4q/M fjbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Wx9po89l1Nahm+i2PEIxh0JAGA20GIjG1W7Z5GvLNBM=; fh=PRHu263PCZiQUOZO0XVPhBVZfWHKhH11sz5/DKts4GQ=; b=Sj8Xge1VRBr90Kl3BVQAJq1cbc3lkNKIxRmytOVl099wdWzLppyTO2SSTFwR8YipfO mh2XLhNfkft9IFDZfP0cDS9CaGfImaQT7qUBI902Ex54Cv4TZedtk1aVVGCxCmPibcW1 9B37N6rWeVjMc2A0UAm24XQ2LKkImgGkBQzoqmc5HwX0aF1sy/ROX1F4ayV8qXOUQ/cp t2bhH2bkvdzP+A7E9B6Z+FAfuFtlshkVhHgdXdjwbJ59OBHuocrmTNMeEizMDiwCmIl8 xqfyANDgvrLpB3VckCthm2Dp+GwqNEifx0ciq1CgjfUwRs6x+YCbp/+rxLAqiqzw1B3o sJbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eZHg9n15; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id pf14-20020a17090b1d8e00b0027d15abe599si1842915pjb.143.2023.11.03.07.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:54:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eZHg9n15; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B0100829F996; Fri, 3 Nov 2023 07:54:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231757AbjKCOyH (ORCPT + 99 others); Fri, 3 Nov 2023 10:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjKCOyG (ORCPT ); Fri, 3 Nov 2023 10:54:06 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82221134; Fri, 3 Nov 2023 07:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699023240; x=1730559240; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ImLATCUal4qcTIqW8Jys3wM2D8O83KmDvPk7LUPJviQ=; b=eZHg9n15aKjyhBPxKMecEhbhNlcOvuimQiKxnJ7HSAU/J0yytUYsl7xA 8mwwsNZrG+Zk8EvzugLld7w2eoqaNlaRugzhTyRXiziDZdBQsrIBmJVXi 1F5CcCh2/5stCpHdwfOoUII/KD8xcENmpO24D+hWsis99q+1e6vhE425T 6k+o7v8ul8XD+BO+eWkHyV2XeUOoGLu61rxwaiMPLeb8Y/A+roKZc7Ff6 Bdd6q7ys/FfWCbKujP/VLB1VmIm5b7D35QrkAZB4DLnmfKj0JSJpFLB0W jmeSqCdwKXWRrI7wzXOIsW8ZfOohjZ0cZWeSOUntKK3+yoPsnHxejQ+Tc w==; X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="392839536" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="392839536" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 07:53:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="2912345" Received: from mahautam-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.51.190]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 07:53:56 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id C491E10A314; Fri, 3 Nov 2023 17:53:53 +0300 (+03) Date: Fri, 3 Nov 2023 17:53:53 +0300 From: "Kirill A . Shutemov" To: Michael Roth Cc: linux-efi@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , Vlastimil Babka , Nikolay Borisov , stable@kernel.org, Tom Lendacky , Paolo Bonzini Subject: Re: [PATCH] efi/unaccepted: Fix off-by-one when checking for overlapping ranges Message-ID: <20231103145353.5wzcwc5znkzt6vzf@box> References: <20231103142650.108394-1-michael.roth@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103142650.108394-1-michael.roth@amd.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:54:19 -0700 (PDT) On Fri, Nov 03, 2023 at 09:26:50AM -0500, Michael Roth wrote: > When a thread needs to accept memory it will scan the accepting_list > to see if any ranges already being processed by other threads overlap > with its range. Due to an off-by-one in the range comparisons, a thread > might falsely determine that an overlapping range is being accepted, > leading to an unnecessary delay before it begins processing the range. Maybe s/thread/task/g ? > Fix the off-by-one in the range comparison to prevent this and slightly > improve performance. > > Fixes: 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance") > Link: https://lore.kernel.org/linux-mm/20231101004523.vseyi5bezgfaht5i@amd.com/T/#me2eceb9906fcae5fe958b3fe88e41f920f8335b6 > Signed-off-by: Michael Roth Otherwise, looks good: Reviewed-by: Kirill A. Shutemov > -- Kiryl Shutsemau / Kirill A. Shutemov