All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Mike Travis <travis@sgi.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@suse.de>
Subject: Re: [PATCH 06/10] x86: reduce memory and stack usage in	intel_cacheinfo
Date: Wed, 26 Mar 2008 10:28:56 -0700	[thread overview]
Message-ID: <47EA87D8.8030305@zytor.com> (raw)
In-Reply-To: <20080326171241.GC20016@elte.hu>

Ingo Molnar wrote:
>> The main goal was to avoid allocating 4096 bytes when only 32 would do 
>> (characters needed to represent nr_cpu_ids cpus instead of NR_CPUS 
>> cpus.) But I'll look at cleaning it up a bit more.  It wouldn't have 
>> to be a function if CHUNKSZ in cpumask_scnprintf() were visible (or a 
>> non-changeable constant.)
> 
> well, do we care about allocating 4096 bytes, as long as we also free 
> it? It's not like we need to clear all the bytes or something. Am i 
> missing something here?

Well, 32 bytes fits on the stack, whereas 4096 bytes requires allocating 
a page -- which means either taking the risk of failing or blocking.  Of 
course, we're doing this for output, which has the same issue.

	-hpa

WARNING: multiple messages have this Message-ID (diff)
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Mike Travis <travis@sgi.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@suse.de>
Subject: Re: [PATCH 06/10] x86: reduce memory and stack usage in	intel_cacheinfo
Date: Wed, 26 Mar 2008 10:28:56 -0700	[thread overview]
Message-ID: <47EA87D8.8030305@zytor.com> (raw)
In-Reply-To: <20080326171241.GC20016@elte.hu>

Ingo Molnar wrote:
>> The main goal was to avoid allocating 4096 bytes when only 32 would do 
>> (characters needed to represent nr_cpu_ids cpus instead of NR_CPUS 
>> cpus.) But I'll look at cleaning it up a bit more.  It wouldn't have 
>> to be a function if CHUNKSZ in cpumask_scnprintf() were visible (or a 
>> non-changeable constant.)
> 
> well, do we care about allocating 4096 bytes, as long as we also free 
> it? It's not like we need to clear all the bytes or something. Am i 
> missing something here?

Well, 32 bytes fits on the stack, whereas 4096 bytes requires allocating 
a page -- which means either taking the risk of failing or blocking.  Of 
course, we're doing this for output, which has the same issue.

	-hpa

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-03-26 17:30 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 22:06 [PATCH 00/10] NR_CPUS: third reduction of NR_CPUS memory usage x86-version v2 Mike Travis
2008-03-25 22:06 ` Mike Travis
2008-03-25 22:06 ` [PATCH 01/10] x86_64: Cleanup non-smp usage of cpu maps v2 Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-26  6:40   ` Ingo Molnar
2008-03-26  6:40     ` Ingo Molnar
2008-03-26 16:11     ` Mike Travis
2008-03-26 16:11       ` Mike Travis
2008-04-07 20:36     ` Mike Travis
2008-04-07 21:32       ` Ingo Molnar
2008-03-25 22:06 ` [PATCH 02/10] init: move setup of nr_cpu_ids to as early as possible v2 Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-26  6:27   ` Ingo Molnar
2008-03-26  6:27     ` Ingo Molnar
2008-03-26 15:43     ` Mike Travis
2008-03-26 15:43       ` Mike Travis
2008-03-26 17:09       ` Ingo Molnar
2008-03-26 17:09         ` Ingo Molnar
2008-03-26 18:22         ` Mike Travis
2008-03-26 18:22           ` Mike Travis
2008-03-25 22:06 ` [PATCH 03/10] cpufreq: change cpu freq arrays to per_cpu variables Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-25 22:06 ` [PATCH 04/10] acpi: change processors from array to per_cpu variable Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-25 22:06 ` [PATCH 05/10] cpumask: Add cpumask_scnprintf_len function Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-25 22:06 ` [PATCH 06/10] x86: reduce memory and stack usage in intel_cacheinfo Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-26  6:50   ` Ingo Molnar
2008-03-26  6:50     ` Ingo Molnar
2008-03-26 15:41     ` Mike Travis
2008-03-26 15:41       ` Mike Travis
2008-03-26 16:13       ` Jeremy Fitzhardinge
2008-03-26 16:13         ` Jeremy Fitzhardinge
2008-03-26 16:27         ` Mike Travis
2008-03-26 16:27           ` Mike Travis
2008-03-26 16:59           ` Jeremy Fitzhardinge
2008-03-26 16:59             ` Jeremy Fitzhardinge
2008-03-26 18:15             ` Mike Travis
2008-03-26 18:15               ` Mike Travis
2008-03-26 17:12       ` Ingo Molnar
2008-03-26 17:12         ` Ingo Molnar
2008-03-26 17:28         ` H. Peter Anvin [this message]
2008-03-26 17:28           ` H. Peter Anvin
2008-03-26 17:35           ` Ingo Molnar
2008-03-26 17:35             ` Ingo Molnar
2008-03-26 18:20             ` Mike Travis
2008-03-26 18:20               ` Mike Travis
2008-03-25 22:06 ` [PATCH 07/10] cpu: change cpu_sys_devices from array to per_cpu variable Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-25 22:06 ` [PATCH 08/10] net: remove NR_CPUS arrays in net/core/dev.c v2 Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-25 22:06 ` [PATCH 09/10] x86: oprofile: remove NR_CPUS arrays in arch/x86/oprofile/nmi_int.c Mike Travis
2008-03-25 22:06   ` Mike Travis
2008-03-26  6:53   ` Ingo Molnar
2008-03-26  6:53     ` Ingo Molnar
2008-03-25 22:07 ` [PATCH 10/10] sched: Remove fixed NR_CPUS sized arrays in kernel_sched.c Mike Travis
2008-03-25 22:07   ` Mike Travis
2008-03-26  6:34 ` [PATCH 00/10] NR_CPUS: third reduction of NR_CPUS memory usage x86-version v2 Ingo Molnar
2008-03-26  6:34   ` Ingo Molnar
2008-03-26 15:48   ` Mike Travis
2008-03-26 15:48     ` Mike Travis
  -- strict thread matches above, loose matches on Subject: below --
2008-03-25  2:19 [PATCH 00/10] NR_CPUS: third reduction of NR_CPUS memory usage Mike Travis
2008-03-25  2:20 ` [PATCH 06/10] x86: reduce memory and stack usage in intel_cacheinfo Mike Travis
2008-03-25  2:20   ` Mike Travis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EA87D8.8030305@zytor.com \
    --to=hpa@zytor.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=travis@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.