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] [day] [month] [year] [list]
Date:	Wed, 21 Nov 2007 08:30:37 -0800
From:	Mike Travis <travis@....com>
To:	Andi Kleen <ak@...e.de>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Lameter <clameter@....com>, mingo@...e.hu,
	apw@...dowen.org, Jack Steiner <steiner@....com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] x86: Reduce pressure on stack from cpumask usage
 -v2

Andi Kleen wrote:
> On Wednesday 21 November 2007 11:02:01 travis@....com wrote:
>> v2:
>>     - fix some compile errors when NR_CPUS > default for ia386 (128 & 4096)
>>     - remove unnecessary includes
>>
>> Convert cpumask_of_cpu to use a static percpu data array and
>> set_cpus_allowed to pass the cpumask_t arg as a pointer.
> 
> I'm not sure that is too useful alone because you didn't solve the
> set_cpus_allowed(oldmask) problem.

Passing by reference does reduce the amount of data pushed onto the stack
for all cases.

I've been looking at a couple of options to fix up the rest of the cpumask_t
users.  The least disruptive would be to make cpumask_t a "const *cpumask"
type and then fix up instances where a cpumask var is needed.  It does get
messy attempting to keep cpumask_t a simple integer in the NR_CPUS <=
BITS_PER_LONG case, in a transparent manner.

The other is to continue to modify subroutines that expect cpumask_t
arguments and work back up the call chain passing by reference instead.
In this case I could use the idea of allocating a "scratch" cpumask_t
array in the task struct (or somewhere else?) to accommodate trivial
changes, to lessen local frame storage.  Again though, the code gets
messy in the same manner as above.

The set_cpus_allowed is about 30% of the "cpumask_t pass by value" code
though much lower in call usage.  The highest call count goes to the
send_IPI_mask, irq and smp_call functions.

Btw, is there a good source code call trace analyzer tool around someplace?

Thanks,
Mike

-
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