Re: [PATCH 3/3] relay: Add buffer-only channels; useful for earlylogging.

From: Pekka Enberg
Date: Fri Jun 13 2008 - 03:07:40 EST


Hi Eduard,

Eduard - Gabriel Munteanu wrote:
@@ -578,12 +592,15 @@ struct rchan *relay_open(const char *base_filename,
chan->alloc_size = FIX_SIZE(subbuf_size * n_subbufs);
chan->parent = parent;
chan->private_data = private_data;
- strlcpy(chan->base_filename, base_filename, NAME_MAX);
+ if (base_filename) {
+ chan->has_base_filename = 1;
+ strlcpy(chan->base_filename, base_filename, NAME_MAX);
+ }
setup_callbacks(chan, cb);
kref_init(&chan->kref);
mutex_lock(&relay_channels_mutex);
- for_each_online_cpu(i) {
+ for_each_present_cpu(i) {
chan->buf[i] = relay_open_buf(chan, i);
if (!chan->buf[i])
goto free_bufs;
@@ -594,7 +611,7 @@ struct rchan *relay_open(const char *base_filename,
return chan;
free_bufs:
- for_each_online_cpu(i) {
+ for_each_present_cpu(i) {
if (!chan->buf[i])
break;
relay_close_buf(chan->buf[i]);

Why do we need to change for_each_online_cpu to for_each_present_cpu?
I guess it's because we don't have all the CPUs online at early
boot? Wouldn't it then be better to implement CPU hotplug support
instead?

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