From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 B9B0E217F33 for ; Wed, 25 Feb 2026 03:24:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771989868; cv=none; b=KbJ/tv5OxrTZkNDjtpKT5Az14KgyZxN4XkORNR+qFjnlFY2uzB6hkVYNXZL/lR2Zv4MSPcD2+kl+/KjFABR/2JANm4ACUpWd0FUONbQWxigCNQ05Rqpxttfq/3o1Mi5sfwLGsmGpys0fYZWada0tqno2C3Bt9aD4dEZ2cw/tlUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771989868; c=relaxed/simple; bh=2erXaSzxqouJYHAI7iQgk06x1aOTRy7Rez7nS+35Gsk=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type; b=XMcdDauwIwv/kpOkbT9/4fOhfAjdubpoD+OhDGJQOU/K0iPBSQIOSy627ADaRj7UDvJHlXMWo/QiXxxwrVNJ6fRcT/3EIs5O4sj81Nx+M/x/vAHL3CaEeRGOBgPr43zN9m9qfbgDHd7Gre76QYWHTDWCvcjSaGXYA/B4wgGv5Cs= 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=TBP+qM/l; arc=none smtp.client-ip=209.85.216.41 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="TBP+qM/l" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-35691a231a7so3759616a91.3 for ; Tue, 24 Feb 2026 19:24:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771989867; x=1772594667; darn=vger.kernel.org; h=mime-version:references:message-id:date:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2erXaSzxqouJYHAI7iQgk06x1aOTRy7Rez7nS+35Gsk=; b=TBP+qM/lvxMxDRv4LXQx8DqZhesuBujEta9d5Ece4urE/43vx47FGk9UMmdUovjDBG aEN7Xs0FMcRm5CxxjRhrVpjxUld7QsQwSEAG2iA9FYYK1432ZHQ2Uxzr80SGDtu+6c/1 MHUTjVwht1Y56EORz1DygJmNkTMdiblwYetR2cMySnact++i+Srnbz04u4XayDWslu9C DUh1vNGC3eLjniOFra90WHdTC4CVkAfCeSsFQG2OskqGCseCpQ+vFcMfBueqjKHP+L4M 2pByvJMQxCBtZ6T+QQZ2+mLr7d2DkM1CT2NK81DUNSoP/ry2kXq2HgF+NdRClydZXiTi 8rtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771989867; x=1772594667; h=mime-version:references:message-id:date:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2erXaSzxqouJYHAI7iQgk06x1aOTRy7Rez7nS+35Gsk=; b=QyAuUYPmvk/D257O+omi0Lt6RK4whyD4t1YsnXTqR02NCDqzYaVbb0wSCtG7Ls+zfm dZgaFcTa/BzgdN1BlBTmvLlOo36V6jBeq+xMK0PqWFJMn4P1sj74kXA0JafHEw1CcLAy 5ou1B3wtK+S2n1z2Geuqthl0/g2ROcza9o1zmQwXyAJTTRb6n6U9u1SD3JxX4dro9OmS 3UthbnpGnjkCF65RnJIZkqjn1IzEgDwG42SGSgceVTbsRpGUuEqooTirEP5ItbsnR+d2 Sl98t1nwizKZnM92gYdp8XVZRIcC1H3BNxEktmxVMtbrD/JUhYnaSl/qaLYqVmAA9gmQ Yn5g== X-Forwarded-Encrypted: i=1; AJvYcCW83H2VTcjmtyio7ni4++hCBOo4dDo3Q+HQZV1F0FMbwTKfukmnJoz8ZAzmOpKjvA2YWWfM7FQYtASU4ug=@vger.kernel.org X-Gm-Message-State: AOJu0YwNjBVyOHlIN/bzhRrrR3JgsDE6Q3M2QKgEbigYB0ytDpUqh8Z2 joRHuN8gcUf0S5eJ7qPUKMUVodLPpvE1lHqn1i0/FGd76HTX/96DdRdF X-Gm-Gg: ATEYQzzqbGGHDu65HTYKjvMryNQqwloOnBT2/891AauKq0a/K8puUL+rXBG5huN1fxn YcVwItZn9qxWEqGMpHQJn8I01R1Lqaau7YX/XBGDILswjJmogNHwjl3I/onLC8DgUGfkLW+vWje 2x8+GFT+vdDkPVq6wpx9VR6HvxTSSP1Bp8L2/Nh/l8S8amFlug3/HG/jcXCdRmy1C+p5RixtT04 RymHHpxe4YVb99GheUAvBdQ9/SGXigeTtV40RNqfdYDKDAr22N1oIv8q38by8BGRyee7qyO2Hoe 7urLEgeU/yBawcxPGGL23Sz2BqwNe7kL2U6L2K/rNToiif8hpu9OJ7ARnjNMQPRuglqlWNA6JVm lKn2ALmrZKmxVlWwEUtkX9cPxwelRQwnh6J/BKYOIAJ8Eg0jzi2D2/LEW71SPB+Nd+hfoi3Ef2F RJnyPx9HuwLiZhXd0o6g== X-Received: by 2002:a17:90b:2cc5:b0:356:35a5:4a64 with SMTP id 98e67ed59e1d1-358ae7c5003mr12522694a91.4.1771989867018; Tue, 24 Feb 2026 19:24:27 -0800 (PST) Received: from dw-tp ([203.81.240.195]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359037afe31sm1092824a91.16.2026.02.24.19.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 19:24:26 -0800 (PST) From: Ritesh Harjani (IBM) To: Jinjie Ruan , corbet@lwn.net, skhan@linuxfoundation.org, catalin.marinas@arm.com, will@kernel.org, chenhuacai@kernel.org, kernel@xen0n.name, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, akpm@linux-foundation.org, bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, rdunlap@infradead.org, pmladek@suse.com, dapeng1.mi@linux.intel.com, kees@kernel.org, paulmck@kernel.org, lirongqing@baidu.com, arnd@arndb.de, ardb@kernel.org, leitao@debian.org, rppt@kernel.org, cfsworks@gmail.com, ryan.roberts@arm.com, sourabhjain@linux.ibm.com, tangyouling@kylinos.cn, eajames@linux.ibm.com, hbathini@linux.ibm.com, songshuaishuai@tinylab.org, samuel.holland@sifive.com, kevin.brodsky@arm.com, vishal.moola@gmail.com, junhui.liu@pigmoral.tech, coxu@redhat.com, liaoyuanhong@vivo.com, fuqiang.wang@easystack.cn, jbohac@suse.cz, brgerst@gmail.com, x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org Cc: ruanjinjie@huawei.com Subject: Re: [PATCH v6 1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr In-Reply-To: <20260224085342.387996-2-ruanjinjie@huawei.com> Date: Wed, 25 Feb 2026 08:45:56 +0530 Message-ID: <87wm01h5sj.ritesh.list@gmail.com> References: <20260224085342.387996-1-ruanjinjie@huawei.com> <20260224085342.387996-2-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jinjie Ruan writes: > From: Sourabh Jain > > During a memory hot-remove event, the elfcorehdr is rebuilt to exclude > the removed memory. While updating the crash memory ranges for this > operation, the crash memory ranges array can become unsorted. This > happens because remove_mem_range() may split a memory range into two > parts and append the higher-address part as a separate range at the end > of the array. > > So far, no issues have been observed due to the unsorted crash memory > ranges. However, this could lead to problems once crash memory range > removal is handled by generic code, as introduced in the upcoming > patches in this series. > > Currently, powerpc uses a platform-specific function, > remove_mem_range(), to exclude hot-removed memory from the crash memory > ranges. This function performs the same task as the generic > crash_exclude_mem_range() in crash_core.c. The generic helper also > ensures that the crash memory ranges remain sorted. So remove the > redundant powerpc-specific implementation and instead call > crash_exclude_mem_range_guarded() (which internally calls > crash_exclude_mem_range()) to exclude the hot-removed memory ranges. > > Cc: Andrew Morton > Cc: Baoquan he > Cc: Jinjie Ruan > Cc: Hari Bathini > Cc: Madhavan Srinivasan > Cc: Mahesh Salgaonkar > Cc: Michael Ellerman > Cc: Ritesh Harjani (IBM) > Cc: Shivang Upadhyay > Cc: linux-kernel@vger.kernel.org > Acked-by: Mike Rapoport (Microsoft) > Signed-off-by: Sourabh Jain I had gone through the generic implementation v/s the powerpc specific remove_mem_range() implementation, when it was posted by Sourabh separately. And it make sense to use the generic implementation in this case, rather than keeping a duplicate powerpc specific version. So... LGTM. Please feel free to add: Reviewed-by: Ritesh Harjani (IBM)