From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92447312837 for ; Tue, 2 Jun 2026 01:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780364267; cv=none; b=R8w875i8p1uW2QOF6RbNOhys3a1ghxVLc3OI4q6IxRHGwmAFXwv2yp6V8i1WGw44Ebc73vwvAcrmwhQ76Z994mg5NUkhQOxtg35MOYz5fthlGOMdnVR9XQ0nMIj/OOB5S6fWpe9rra0b+7XZv3OzPXQZxb+lP5ZH3ZvVMVJmKfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780364267; c=relaxed/simple; bh=Dy7BvBhhUq9u15IyyukciyKL2tHV5vQLjsFCazrSQA8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D7HN1rF4Qh/C6jW5Ygqi7PI/unXbNfVY/24A7tLgPyCxUeGksCFd3dOFc8tVgWs4O8Yd9mKXzO1O6+HGObjh1CxdSZ7A/b7F9oRhoOElGJSJoWRSk6GdVEP+jEeMPsftmiZ9RnBSrJiM6FCwoJJzDe1bfXOOQ6bH4TekYMsK3GI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bkfLBKk/; arc=none smtp.client-ip=209.85.215.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bkfLBKk/" Received: by mail-pg1-f196.google.com with SMTP id 41be03b00d2f7-c857fba35cfso1348411a12.1 for ; Mon, 01 Jun 2026 18:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780364264; x=1780969064; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Dy7BvBhhUq9u15IyyukciyKL2tHV5vQLjsFCazrSQA8=; b=bkfLBKk/3GeO7myJu+Hc5jK+lz1oebxMS3VfU6CkPMAVRsaKGDSSoGeUZIzuNRH1hW dg4PcEWapZxydoJecXeKXHKTAedhAyO3ujYFJvsC62L+jutoajQNk0gUMWYyVtS7vUpR 0YupMZtjOwgO7Z1j1SlqZhIMAvAUBRhBd+83uKQuLNVyclVrO735McwfU2tnGrMq1/R0 Pu+NVVgmeuPUXR0nt1fBBzzSPJbFFQKTPUsdsEKU1LNcGAU/skcplFp7Ko1YjKMMZGHz u2pzwoC4DgOYuc9PI7cj2WzstpVI/3Lpbe+1Ud9FrXKsxuCHpmowpyMgln2fS5ndyKq8 vKDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780364264; x=1780969064; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Dy7BvBhhUq9u15IyyukciyKL2tHV5vQLjsFCazrSQA8=; b=kEaxDBZ3kZfkxJA+j1gySa94Iz1if12r/LMFIvEYDckEpn/ZvCsrIHumZBFj5/xxW9 WLOxkDOd5H95RFTFTTv1v4zn5/XbzsDJE9f0ZQob89pBI+hIfxXpdzRsuvtDms342Uri f7ZKOfpevPQ65qzvyIGZwTJE0q5ZxGVXhuZhS+qTDfWf+hpae37rGs8QCk57XnbaCsuF CMqCupTP0fgjl13muq5oSzOukhgal0qISx/MdF7bLqMpj/1hohWypWPaQOJAEKLHL6Cw tzLFaUVtzIxCIihIeyk0uYltNwlE928qCMUIKdxAs2shobC/8OJNWik2k0zV3iJXYddP uqyg== X-Forwarded-Encrypted: i=1; AFNElJ9esNXbDSQnkXVSaGFVoZkQQia36SxyFJR2jTANkyJVLeAcxoonhh7M5B3G66MIE9VXC6o6wBB3CYYll8k=@vger.kernel.org X-Gm-Message-State: AOJu0YxezKiWi5FJOtz8FCfyoA3bm613+jr/ZExzNS8nMLG1WZotKGwW l7z5AH+rONT80ccYQ/vU0lDEcf08mTMEp/DYSaGFx00TEDV2ueXh7kRV X-Gm-Gg: Acq92OFRlkLgCuOJvtqVwN3TlFcWkpn6iPnUCOnzizCxVNyjZoOfH+FU0MGcaqHdAvg qphRC08nnqT6+X+pwLR55nulRvIEbgfrUlzYCizcHESmdNAwvh3dQ9+k+D10W/jNRSQ3/wNpaEG PecODfWX1mZ/M3LaHINDmUA8/nqhtTgljK53dp57KCzDIHjzpBHSJh+hda/WMh6NYbphJpcsAHp lyGvmzns/dt9TtjfCA1XgWWDrHhVLOc+YZ+Zsc8gqvuwhxqtNHjgmJSVbLGUJEWYkw9roH9K5T9 2cQVsCZ4m2w0vAoMjxBxFerIO4L+5eVGpQJNB8JLb/XHRn/wCAlxVUZFo8WuMrDGojrgIGwMh5V jDIwB7rbIpiKqike66zwjqJZa8bvOjvfyt8U1dlxE1r7m8at/4ohTtq7Ll9DigThTyS9RFmhG12 rYVACw6/0jE3Hzxq8TAqjgdBXyLq19vc1mNXkjqiCyvg== X-Received: by 2002:a05:6a20:1c8f:b0:39b:8dcb:f37d with SMTP id adf61e73a8af0-3b427eb0f6cmr14435155637.17.1780364263853; Mon, 01 Jun 2026 18:37:43 -0700 (PDT) Received: from [10.125.112.20] ([210.184.73.204]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c859391cbe9sm7626534a12.25.2026.06.01.18.37.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jun 2026 18:37:41 -0700 (PDT) Message-ID: Date: Tue, 2 Jun 2026 09:37:35 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] of: reserved_mem: avoid unnecessary memory allocation when __reserved_mem_check_root() fails To: Rob Herring Cc: Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, zhaomeijing@lixiang.com, saravanak@kernel.org References: <20260519082427.4181476-1-chenwandun@lixiang.com> <20260519082427.4181476-2-chenwandun@lixiang.com> <20260520-cuddly-imperial-bison-ec3c4e@quoll> <0dd4546a-6133-4493-a911-41c35ec42c15@gmail.com> <20260601230649.GA154030-robh@kernel.org> Content-Language: en-US From: Wandun In-Reply-To: <20260601230649.GA154030-robh@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/2/26 07:06, Rob Herring wrote: > On Wed, May 20, 2026 at 04:16:23PM +0800, Wandun wrote: >> >> On 5/20/26 15:44, Krzysztof Kozlowski wrote: >>> On Tue, May 19, 2026 at 04:24:25PM +0800, Wandun Chen wrote: >>>> total_reserved_mem_cnt will keep the init value (MAX_RESERVED_REGIONS) >>>> in fdt_scan_reserved_mem() if __reserved_mem_check_root() fails. >>>> >>>> fdt_scan_reserved_mem_late() calls alloc_reserved_mem_array() to >>>> allocate memory according to total_reserved_mem_cnt before >>>> __reserved_mem_check_root(), so if __reserved_mem_check_root() fails, >>>> the allocated array has nowhere to be used, so no need to allocate >>>> memory. >>>> >>>> Move alloc_reserved_mem_array() after __reserved_mem_check_root() to >>>> avoid potential memory waste. >>>> >>>> Signed-off-by: Wandun Chen >>> Authorship/DCO mismatch. >> Hi Krzysztof, >> >> Thanks for your review. >> Sorry for the mismatch. Dueto my company email server's issues with >> community mailing lists, I sent the patch via my personal email. >> I will add the correct 'From:' header and send a v3 patch shortly. > There is also the 'b4 relay' that can be used for this kind of issue. I wasn't aware of 'b4 relay' before, this is really helpful. Thanks for the tip! Best regards, Wandun > > Rob