[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0812191114070.28744@gandalf.stny.rr.com>
Date: Fri, 19 Dec 2008 11:16:32 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Mike Travis <travis@....com>
cc: Ingo Molnar <mingo@...hat.com>,
Rusty Russell <rusty@...tcorp.com.au>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/8] cpumask: convert kernel trace functions
On Fri, 19 Dec 2008, Mike Travis wrote:
> Impact: Reduce memory usage, use new cpumask API.
>
> Convert kernel trace functions to use struct cpumask.
>
[..]
> #define for_each_buffer_cpu(buffer, cpu) \
> - for_each_cpu_mask(cpu, buffer->cpumask)
> + for_each_cpu(cpu, buffer->cpumask)
>
> #define TS_SHIFT 27
> #define TS_MASK ((1ULL << TS_SHIFT) - 1)
> @@ -262,7 +262,7 @@ struct ring_buffer {
> unsigned pages;
> unsigned flags;
> int cpus;
> - cpumask_t cpumask;
> + cpumask_var_t cpumask;
> atomic_t record_disabled;
>
> struct mutex mutex;
> @@ -453,6 +453,9 @@ struct ring_buffer *ring_buffer_alloc(un
> if (!buffer)
> return NULL;
>
> + if (!alloc_cpumask_var(&buffer->cpumask, GFP_KERNEL))
> + goto fail_free_buffer;
> +
How does this save memory if we just allocate a cpumask var everytime
we allocate a ring buffer? Is cpumask_var_t a mask of possible CPUS and
not NR_CPUS?
Otherwise, I see this as just adding one extra pointer.
-- Steve
--
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