Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp179963rdg; Thu, 12 Oct 2023 02:26:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFovCNAYGXIg0P2uQMGis9Ze94k57QpGoVEeBi4qH6Xsoz1Ki8Cri5Zvx0qjr4jRJ/mYfM4 X-Received: by 2002:a05:6a00:3693:b0:693:479f:bd1c with SMTP id dw19-20020a056a00369300b00693479fbd1cmr25796628pfb.1.1697102774024; Thu, 12 Oct 2023 02:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697102774; cv=none; d=google.com; s=arc-20160816; b=aqaZFHrX4w6RMsvWSAZx3/Uxiy0UaN2fXdVdr0f7c3kQR1wATeCIn1AonpuOLMFYOR ttkxF/ewdLBXaP75NvVzLodReU7JLkrb7ZFgG0zmapL4yZOYQv2AZSzLSIsaD3QJBlP0 9rBCGf0I9yz5nMRgE6QMa/p0xZ5VqWT2o6KrxZdEFCmVpFvuZfv+B9UIggq0lovy97kc 4Y+1ytva/S3J+0G2AN37WL1WX4cbINBBW0kv06yyuuJnzyudze8PehPieu32LqsFdlWk KKyhEyt//KLVKZOC0NSrag2rlTXVHdCvN1yMxKZz+0VamBtJHpgYJAD0IrQfY7NEl7+U O2XA== 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=ihAj6Jk24JX9AqNS8iIYiu1eql6lQ+G9XokFrQToB5I=; fh=iae8W7+YsuOdP40WCytoCMmYg2BD/IEWEocE6dbe21o=; b=JgIr8s1whi4ydcPoYUtKmThse/k5khgSJJV5bsmAwFK71SJ97sZ8vcdKOI3+ea8dJW W9HKhYMVHHqgMFH7h2cKS461HgU8CAKn9vfO7PcVt4/h3D/AHq5ZnwoLyiv6UK02W0nx 1V6f6OGPzFKlAAaxjQpwMpZmtOe2oAjVU6LPs7N3BwfljC/YUxp7AsOJ6CQoc5dKZg3g pOBDJJ7ouX6++XkhZQTNUTthc4JKyy8j18w42NZ/MLzJLxJGBb4+WO0y49VDOc4LyTD8 8ekmgtbzvP/NGaLTUV6/+w4Xwr86F6udgpcs4ZZpt7YPlpdiIjbb5uPjCWV5TgFU8JqN 8E5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BAPRudii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cp13-20020a056a00348d00b0068fcf6fe22esi14137612pfb.306.2023.10.12.02.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 02:26:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BAPRudii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 07AFE8075937; Thu, 12 Oct 2023 02:25:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235525AbjJLJZo (ORCPT + 99 others); Thu, 12 Oct 2023 05:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235407AbjJLJZm (ORCPT ); Thu, 12 Oct 2023 05:25:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3940BA for ; Thu, 12 Oct 2023 02:25:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F961C433C7; Thu, 12 Oct 2023 09:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697102741; bh=/ItVD3SvDH45EQ0lyeWLvr5gyjqXDrdu9xT+D7zuRD0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BAPRudiiiP/cOB9GJkTQM72oWaMkY96tenGbcfG8VG+P5GydgmeLerzyu+VpHzIyd 7QZQO9or4iA1AYVMmmI3DjcsDnVbRv+sGblFts3DSkTmQLwEKxgyfWBL3YGc+cB/Cy xeN0w+3qf6eFDDSRBq5Oto96UuEENgyBj5oRlaMTtYzAIopZbziUk8NMR6P+he4Y6Q ekG6rEwI5eAcFRTX8iSKPPPeUGlCeQk+CrnHUEFLXfyOWHxH2NQcAJNoz0l2AYOuV+ 0Tzqq1KpeQQBlgbKdLi0hL11z7EDtBgZXyKjrf9BR7kn+C/QVc80BwxrZQ0iRYO9k9 XOpI2q24LiVxQ== Date: Thu, 12 Oct 2023 12:24:42 +0300 From: Mike Rapoport To: Yajun Deng Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] memblock: don't run loop in memblock_add_range() twice Message-ID: <20231012092442.GR3303@kernel.org> References: <20231003163045.191184-1-yajun.deng@linux.dev> <20231005051959.GC3303@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 02:25:46 -0700 (PDT) On Thu, Oct 05, 2023 at 11:20:19PM +0800, Yajun Deng wrote: > > On 2023/10/5 13:19, Mike Rapoport wrote: > > > I don't see this micro-optimization is worth the churn and potential bugs. > > NAK. > > There are many handouts that tell people it needs to run twice in > memblock_add_range(). > > I think it's time to change this. I'm trying to tell people that running > twice is unnecessary. It might be unnecessary, but it's still simpler than the solutions you proposed. And, again, removing the second loop is not worth the churn and potential bugs. -- Sincerely yours, Mike.