lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <el52wvltm2ptkyjhiajeo564sa6kcwqihdttvutem2qoegj5rg@wnqe7flapgbf>
Date: Fri, 28 Mar 2025 12:54:42 +0200
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: "Kirill A. Shutemov" <kirill@...temov.name>, 
	Steven Rostedt <rostedt@...dmis.org>, Tom Lendacky <thomas.lendacky@....com>, 
	"Aithal, Srikanth" <sraithal@....com>, Jason Baron <jbaron@...mai.com>, 
	Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>, 
	Linux-Next Mailing List <linux-next@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>, 
	"Roth, Michael" <Michael.Roth@....com>
Subject: Re: linux-next regression: SNP Guest boot hangs with certain cpu/mem
 config combination

On Fri, Mar 28, 2025 at 10:33:31AM +0100, Ard Biesheuvel wrote:
> Can you quantify the speedup?

Test is below. I run it 10 times on a VM without unaccepted memory. With
and without has_unaccepted_memory() check in cond_accept_memory().

The difference is not huge, but it is there:

Without static branch:	Mean: 35559993 us, StdDev: 167264
With static branch:	Mean: 35286227 us, StdDev: 207595
Diff:			-273766 us / -0.77%

static int __init alloc_test(void)
{
	ktime_t start_time, end_time;
	s64 delta, total = 0;
	struct page *page;
	int i, j;

	for (i = 0; i < 10; i++) {
		start_time = ktime_get();
		for (j = 0; j < 100000; j++) {
			page = alloc_pages(GFP_KERNEL, PMD_ORDER);
			__free_pages(page, PMD_ORDER);
		}
		end_time = ktime_get();
		printk("%d: %lld us\n", i, ktime_us_delta(end_time, start_time));
	}

	for (i = 0; i < 100; i++) {
		start_time = ktime_get();
		for (j = 0; j < 100000; j++) {
			page = alloc_pages(GFP_KERNEL, PMD_ORDER);
			__free_pages(page, PMD_ORDER);
		}
		end_time = ktime_get();
		delta = ktime_us_delta(end_time, start_time);
		total += delta;
		printk("%d: %lld us\n", i, delta);
	}

	printk("total: %lld us\n", total);

	return 0;
}
late_initcall(alloc_test);
-- 
  Kiryl Shutsemau / Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ