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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Nov 2011 10:00:21 -0600 (CST)
From:	Christoph Lameter <cl@...ux.com>
To:	Gilad Ben-Yossef <gilad@...yossef.com>
cc:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Russell King <linux@....linux.org.uk>, linux-mm@...ck.org,
	Pekka Enberg <penberg@...nel.org>,
	Matt Mackall <mpm@...enic.com>,
	Sasha Levin <levinsasha928@...il.com>,
	Rik van Riel <riel@...hat.com>,
	Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH v3 5/5] mm: Only IPI CPUs to drain local pages if they
 exist

On Sun, 13 Nov 2011, Gilad Ben-Yossef wrote:

> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 9dd443d..44dc6c5 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1119,7 +1119,23 @@ void drain_local_pages(void *arg)
>   */
>  void drain_all_pages(void)
>  {
> -	on_each_cpu(drain_local_pages, NULL, 1);
> +	int cpu;
> +	struct zone *zone;
> +	cpumask_var_t cpus;
> +	struct per_cpu_pageset *pageset;

We usually name such pointers "pcp" in the page allocator.

> +
> +	if (likely(zalloc_cpumask_var(&cpus, GFP_ATOMIC))) {
> +		for_each_populated_zone(zone) {
> +			for_each_online_cpu(cpu) {
> +				pageset = per_cpu_ptr(zone->pageset, cpu);
> +				if (pageset->pcp.count)
> +					cpumask_set_cpu(cpu, cpus);
> +		}

The pagesets are allocated on bootup from the per cpu areas. You may get a
better access pattern by using for_each_online_cpu as the outer loop
because their is a likelyhood of linear increasing accesses as you loop
through the zones for a particular cpu.

Acked-by: Christoph Lameter <cl@...ux.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ