lkml.org 
[lkml]   [2008]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] relay: Add buffer-only channels; useful for early logging.
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


\
 
 \ /
  Last update: 2008-06-13 09:09    [W:0.079 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site