Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp181041rdg; Thu, 12 Oct 2023 02:28:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyC71AMdQoYcXGn3GLhQ+MLzPMuSorFS4EHc53hhdlKLTtmslARAYK66tA9bNR7xX6nv6I X-Received: by 2002:a17:902:c44b:b0:1c9:deb8:bdc5 with SMTP id m11-20020a170902c44b00b001c9deb8bdc5mr1247826plm.34.1697102931128; Thu, 12 Oct 2023 02:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697102931; cv=none; d=google.com; s=arc-20160816; b=yvwobQ9PyN54Jl5GOnLajFY14Y3g1pV6A27FjE15GCifg40iSFnXh496KOAKUjt/dk HomjL6RANmb4FudWuzsy5YGJIXnXs9UZQCZ8r60HKn2p/lMl60yN9t89OknTRnB2BGe8 jWmR4zwNCTkT5JzwSryAs29q3cz11RCS+wQHoGu9cUHe8acroT6lvVhB3PLTW7+rjl5z mLS/5vzusfHtogv9DS+i0bNj/ovOuN4aAAFeiq6W1RJWSkJUWsPnErjWa9zdZvnulxGp 3uIgk7j1KwsKpz9GhchnXeY8RsV68OS4tTsOTTbDrtS30L6TgR/PDhTdoJyFC0QLvd9w 9XmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=w+ZbiEKpKR/7IxtLp0s4sFhIE2lb5aqqkwzkmrZpvEk=; fh=u2XZE6gbz+UGQ+2IUoDW4Il1P+aJbPJXY+MrbT03Bc0=; b=n5rrZrsmMPknQBxnXblg3Z4DgPjoSPFphm1GG7jxG+ddZfx6eHIoIIXIXU+8IjVYrT orK7BC2FRos7PqSWMJ3qNiX4ZBiJvbz2fXEsDy0FVzV5cuW2CnxLm4G/IZYDx8ghpcMT 2Lzy7WQuV7RQKDMliniTAu06y3XUE9N8LDauPYvkfDOnBb/RG9VpJ+Iuwuc5NnSFWTf6 IaUKLzSKKL113EH+Uk6L4Tk9zqgTQmeKvey6XAuXWf2xRT1vRvkIqlGi/3yKHmTyvYo2 h4KUg2LYAHFpH+lc8MRyeQkwHQDv5rRjrii1zB7y7UTPSbVaLoSNK/1y/z2ozVjZgw0Q jhVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ubV27hWn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j9-20020a170902da8900b001c3ea2bbebcsi1831845plx.322.2023.10.12.02.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 02:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ubV27hWn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 19B778218231; Thu, 12 Oct 2023 02:28:50 -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 S235329AbjJLJ2p (ORCPT + 99 others); Thu, 12 Oct 2023 05:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235373AbjJLJ2l (ORCPT ); Thu, 12 Oct 2023 05:28:41 -0400 Received: from out-190.mta1.migadu.com (out-190.mta1.migadu.com [IPv6:2001:41d0:203:375::be]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD83FBA for ; Thu, 12 Oct 2023 02:28:39 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1697102917; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+ZbiEKpKR/7IxtLp0s4sFhIE2lb5aqqkwzkmrZpvEk=; b=ubV27hWnZTTjqrXaHxG3aEtMO+m3O0kZ/+VmufEJ0CJrzJ42r4bV49IOELKyM/FLxAOXsT eHISFxZ6AEbGforatfopFagl5KX6XOLIUjSl2961O7yOSMLcQbQ1t65ekzkktm6kTwUVx0 kqMjA7nbmvwCu55EzQxkS3EvjxObxCU= Date: Thu, 12 Oct 2023 17:28:31 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v3] memblock: don't run loop in memblock_add_range() twice Content-Language: en-US To: Mike Rapoport Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20231003163045.191184-1-yajun.deng@linux.dev> <20231005051959.GC3303@kernel.org> <20231012092442.GR3303@kernel.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: <20231012092442.GR3303@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,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:28:50 -0700 (PDT) On 2023/10/12 17:24, Mike Rapoport wrote: > 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. > Okay, I got it. Thanks.