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 EA085C43334 for ; Sun, 26 Jun 2022 14:05:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2A046B0071; Sun, 26 Jun 2022 10:05:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB0EA6B0072; Sun, 26 Jun 2022 10:05:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C518C8E0001; Sun, 26 Jun 2022 10:05:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B0BDB6B0071 for ; Sun, 26 Jun 2022 10:05:31 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 84BF3120C90 for ; Sun, 26 Jun 2022 14:05:31 +0000 (UTC) X-FDA: 79620559662.16.6ABC934 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id 01FAA1C003A for ; Sun, 26 Jun 2022 14:05:30 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 88743B80D8C; Sun, 26 Jun 2022 14:05:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FDC1C34114; Sun, 26 Jun 2022 14:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656252328; bh=8UwTVpWaXH1CGQIpd3dbrMoa6SXga7jR/5sRO45a3RY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tAbvygfjBOuinHOBjaTVwb+i7pyYTVTKA2ihlJPPju4yju40tWcCyiz7+Aza3h8+R +QDmc7kKnhi1cmrzsuw6egoRFA6T6OSDuW3k2vxr5tPZTPklU3HC2UWCgC1hs0fkgw Wab/5sc8uuYfVhOMOdChm+dYhovwxmdcspIvbwyN7lR8N6clh4VzHfc8IZQdMM36RJ JZnsUT7wF3D42P45CQ2R/LDSvIB3qw2h9jdFUu7hI2QRBDFhRJcAiCtDTY/yYmJe8v x8yiSxwqQSH4Wm7IeVgRqZRzI45pJL2S92N7em8P/hISznrtsjtpQwPqYzobTktTta Gj/HaHuKmlC/g== Date: Sun, 26 Jun 2022 17:05:14 +0300 From: Mike Rapoport To: Jinyu Tang Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] memblock: avoid some repeat when add new range Message-ID: References: <20220615094015.3672-1-tjytimi@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615094015.3672-1-tjytimi@163.com> ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tAbvygfj; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656252331; a=rsa-sha256; cv=none; b=ayVq65M0CRN0fQ8mGMjzuUmCMVNI2x1G7Be9z02Ah1Ngb4XB1OEPOx1yCxmwwvvZQ/NzUq 6MTejj2qL299y92OuA4xMQhVC0d4WXuQmwmXBXUusLEHLfSEO+sWYPODtAN4vRNsAjQHRK l4/ZalI8mpKw8fiynGrBhNDVrV1PuvI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656252331; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z2qgAM//4eV7dNXF+BB1mYdiLpM3FhtyuKVB1ASk9sc=; b=35cRY6SfOw54qyaC+8zf09KYyvhtd03yVcbnzwkNr1Oug9lSXn/N8TaHcztXZpJfUIOD0J TSaMk0Deuau5X9UHKVffrEv/VpW9d+NUkW+dTOfha9BoI+JyPSeKGaQYuMbgxgA7akjTfQ 5ni54tA77z2h75iXmnNKDKkfb0HmlJo= X-Stat-Signature: hgbwa59u4btrfy93fioje1iq94e49jri X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: 01FAA1C003A Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tAbvygfj; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-HE-Tag: 1656252330-412685 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 Wed, Jun 15, 2022 at 05:40:15PM +0800, Jinyu Tang wrote: > The worst case is that the new memory range overlaps all existing > regions,which need type->cnt + 1 free area of struct memblock_region. > So if type->cnt + 1 + type->cnt is less than type->max,we can insert > regions directly.And becase of merge operation in the end of function, > tpye->cnt increase slowly for many cases.So this patch can avoid > unnecessary repeat for many cases when add new memory range. > > Signed-off-by: Jinyu Tang Applied to memblock/for-kernelci with minor changes to comment and changelog text. Thanks, Mike.