From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C808F448389 for ; Tue, 11 Aug 2026 14:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786458115; cv=none; b=hKSUR/9VHGAKWJwdKR+GPc4xTinXZDNfo6cQX9SSFyt/214mMuyIrGo1l7Z9OrMQTwg8o9vcgXoF/VhInNtg50nXL6RqW0qEIbUHsj9+/hDAQPm0VgDBFx2jTC05EfR3DcJLiBWj+OhLrEU0NbzH8sZQaH769MV8R32w50WwOns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786458115; c=relaxed/simple; bh=dZVxCrUoDiUCpiwUKvAY/zmpcDoeikjaV2y063J4jms=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Sg/A2G6FE2Sh/Aht/wqK3WaKiQOsRwJmtD/nbysfT5Yf9ir2M/OafLUkE5tmH2qJ70rnGit5EBhYD8cVKXHMi68ep36ygOjjgXbLiMQtN6gY5tLwmTounhyoiH4iFKo3J/gWa3SGOBLPD4PPhYyXO4jNENjQ0GIya2WMmL29e8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YPCtKJ/z; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YPCtKJ/z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50DAE1F00A3A; Tue, 11 Aug 2026 14:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786458114; bh=peLTNi99sZ2H7Vza/JehbVMvGp+dy+fil6mDbDYjoZg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=YPCtKJ/zhCkCva4zFXUg9jO0YrPFvEl3WZ35EO9gz/4m+jyCREP52lFOEZrhmVmVk q9OfJLHxHqUsjDq2iSwSN3HjUTEJRNhQoDlrVifRm/ann37gbHQdF/4wz9DsdKHjvP ZJ6uHvmsXixubav2aJNC6A2MkcNMMtF3FevXqxqA1wqLoqxr3+IFZgwVn52lHIZkpL zXwj6RvKGMr94+Afzh6G5wQSGR7JlfOP+n2BXpVuwphQpzxrDGftS46MCMjpSCZh3Q SGbkmSwbLnjhckbn2ndILydF5mh0Av9eFOl//RFKqmT99VQekhyFRvTxciQYdjEhcr 08P8quJLKeRmQ== Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfauth.ams.internal (Postfix) with ESMTP id E701D1980047; Tue, 11 Aug 2026 10:21:48 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Tue, 11 Aug 2026 10:21:52 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEF+xcj27Q+X7YiPbPh0zXmZ9K4g7JaWjhfenTktvgKuXBjdkYrtDhTVEfZp35l3O Ci1dFFfWSdoRvqSIMzAH3oul02hDp/yFssBrCleZyfCcMMJ7bABwPVnJTTsrQdiD3SYYrF ZgkYBReBlR0Jqo2nbAIUMgtdUcb66G1uaxfctkfRihIcNFyrtTNi4iyFMVLzXAdFir9AfH txxbhKcaVGmzkR70G/VWfO2i1xKH+IEVFz1/1J8SGfHsB0eej5ky4FcvMVrtKFljmAHtau sCfeEiDCS31F8DXg5RVacCP7VEf8zwTAdDxddoNko/n0H+j0G0wuhddNVvVFdlkKrDe9d2 yaJTVcmZCsY5LWhbjEM73hg0/3Vkx3DxgaBNT7inqhday9p195l2w9Ja7xVzGEx3cMIjzG NQzSmzELkdrUvEkJ4khuqC9ClO3ImUbOpxMp+H3eFxcCA5rNQR3sqfzaWcFi/As17VnBr6 6mMTThnUasH6RSgfFrbAkFES9iyL0e0l92/UqdkcmrqkX68Sas8tEDFSzVUNxlDApiGbSo a9zdkI+3dWc2qAXGpIBTG31pNxvJolZ8YcG8VVT+efMWtq4jUoGgpJYP9PNFA9w402v2EP 61/b/g9nTcKTfKcTfQHltZnRUtUBBj3wg7KaroulzYdaukXjioIrB4oo1Y+A X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Aug 2026 10:21:47 -0400 (EDT) Date: Tue, 11 Aug 2026 15:21:46 +0100 From: Kiryl Shutsemau To: Mike Rapoport Cc: Breno Leitao , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Baoquan He , Pasha Tatashin , Pratyush Yadav , Miaohe Lin , Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, rmikey@meta.com, riel@surriel.com, kernel-team@meta.com Subject: Re: [PATCH v5] kexec: keep the next kernel off hardware-poisoned pages Message-ID: References: <20260810-kexec_posioned-v5-1-95e1b5e2e656@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Aug 11, 2026 at 04:34:02PM +0300, Mike Rapoport wrote: > On Tue, Aug 11, 2026 at 04:17:41AM -0700, Breno Leitao wrote: > > > > + for (pfn = PHYS_PFN(start); pfn <= end_pfn; pfn++) { > > > > + > > > > + cond_resched(); > > > > > > cond_resched() for every pfn is too much, isn't it? > > > > It is what the other pfn walkers do: the kpageflags read loop in > > fs/proc/page.c and read_page_owner() in mm/page_owner.c both call it > > once per pfn. > > I think it depends on the pfn walker, some of them cond_resched() once per > "block" > > > But I honestly don't have a strong opinion here, though, happy to batch > > it if you prefer. Would this one look better?: > > > > if (!(pfn % MAX_ORDER_NR_PAGES)) > > cond_resched(); > > Can't say I know the magic number here, but I think it's better to batch. Hm. I thought cond_resched() deal with this internally, no? We call it in pretty tight loops, like clear_contig_highpages() or copy_folio_from_user(). I think adding external batching might be a bad move. If calling cond_resched() often is a problem, something is wrong with cond_resched(). -- Kiryl Shutsemau / Kirill A. Shutemov