From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-b8-smtp.messagingengine.com (flow-b8-smtp.messagingengine.com [202.12.124.143]) (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 B53522D739C; Sun, 23 Aug 2026 19:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.143 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787512667; cv=none; b=jGXqjtO5BGN2Y90R6KTi0JpyX73ZpXQOLUx4RHMeAE9g846uOp2FLDEtkGErEtTUzJudjk1rojL7BEYNAaExbC45JdEKFMhSBllNwMcuSqmdpqyi1ndgWgePDfWE8TJl+YiJgzt4dPnV1MTRTKSxKIrijJYtB8Elz2yEzzjvl8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787512667; c=relaxed/simple; bh=BjYny9cYKfuHknOmMbdeoFGgqyLyzgsv3AIF8eNWSdI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ji+qrwLvgbYBemO/PxEEEuzlUqVUjcxk8jWZOhgq5sBiIULQMnD4xBxmmd46iPalqbr/CAVebHPf0Fgo99CgYYS6w8UJfYGpvuJV7I+SE7LZmooQ3vGlQ8mF09zQ0sSkWLmJH7etzuBeCyoSAs0cijtDtH3zJnB5yFLxuodHyuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=Sh172nvL; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=U8qMIjuW; arc=none smtp.client-ip=202.12.124.143 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="Sh172nvL"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="U8qMIjuW" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailflow.stl.internal (Postfix) with ESMTP id 8F87913000E2; Sun, 23 Aug 2026 15:17:43 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sun, 23 Aug 2026 15:17:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1787512663; x= 1787519863; bh=0wLxy792B6yNuuTN2hFZ7joedHo9NROFJ3RumMARwe4=; b=S h172nvLnDkyAB1weLsxE1VwjgqoHALsfHUizskU3E3z31baxwgN+rW1PV9h79e3C 84TIJB4elaZ6xWcLDZDEkQUADqoHGtBRewFTon3qC9tkFA7X2+tluK++KbOUmj9A WUnTMTvXpPFjcOWm54FjWs6WJ9o8nyntXF5BX+qSWZqOxq4m1Xhs7Ig02aSTpLrJ aaNbhKSmdZxSD2GbXmZt1NHTsjxmAzEE416BVjypZkiO42Ct9FAJ8N/aPKCL7K1q /6nz435RiaGaGgn8KTDj1yIQvQC7x3qLO/bfdnQTtRjOKEghTWAKIwrBwwVPjtL8 l8jSldykja69bCnbss1og== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1787512663; x=1787519863; bh=0wLxy792B6yNuuTN2hFZ7joed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QwEhP7kdLx+CWQ X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Aug 2026 15:17:41 -0400 (EDT) Date: Sun, 23 Aug 2026 20:17:40 +0100 From: Kiryl Shutsemau To: "Lorenzo Stoakes (ARM)" Cc: akpm@linux-foundation.org, david@kernel.org, nico.pache@linux.dev, baolin.wang@linux.alibaba.com, baohua@kernel.org, dev.jain@arm.com, hughd@google.com, lance.yang@linux.dev, liam@infradead.org, mhocko@suse.com, rppt@kernel.org, ryan.roberts@arm.com, shuah@kernel.org, surenb@google.com, usama.arif@linux.dev, vbabka@kernel.org, ziy@nvidia.com, usama.anjum@arm.com, agordeev@linux.ibm.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 03/19] selftests/mm: scale khugepaged's collapse wait with the PMD size Message-ID: References: <20260815015901.1236937-1-kirill@shutemov.name> <20260815015901.1236937-4-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kselftest@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 18, 2026 at 11:04:57AM +0100, Lorenzo Stoakes (ARM) wrote: > On Sat, Aug 15, 2026 at 02:58:45AM +0100, Kiryl Shutsemau wrote: > > From: "Kiryl Shutsemau (Meta)" > > > > wait_for_scan() gives every case the same three seconds, whatever the huge > > page costs to build. collapse_full() asks for four of them: 8M at a 2M > > PMD, but 2G at a 512M PMD -- arm64 with 64K base pages. > > > > Three seconds is thin at that size rather than generous. Across 80 runs of > > collapse_full() on arm64 with 64K pages the wait was half a second in 73 of > > them, with a tail to two seconds. The case has also timed out in a full > > matrix run, reporting a failure for a collapse that was still going. > > > > Keep three seconds as the floor and add a second per 128M collapsed. A 2M > > PMD is unchanged. A 512M PMD gets 19 seconds. > > Yikes that does make this run really slow for 64 KiB page size machines and a > key aim in the selftests is that they don't take too egregiously long to run. > > Can this somehow be trimmed some other way? It does not change how long the run takes. The timeout is a ceiling on a poll loop, not a sleep: wait_for_scan() breaks as soon as check_huge() sees the collapse, or as soon as `full_scans` has advanced by two. On arm64 with 64K pages the wait was half a second in 73 of 80 runs of `collapse_full()`. The 19 seconds is spent only when two khugepaged passes have not completed in that time, which is the case this patch exists to stop reporting as a failure. This can happen on very big machines with high memory usage or in an emulator. I use QEMU TCG for testing on ARM. I will put that in the changelog for v5, with the before and after runtime of the whole `./khugepaged` run. -- Kiryl Shutsemau / Kirill A. Shutemov