Re: [PATCH] Dynamic tick for x86 version 050609-2

From: Pavel Machek
Date: Fri Jun 10 2005 - 04:13:04 EST


Hi!

Some more nitpicking...

> +/*
> + * ---------------------------------------------------------------------------
> + * Command line options
> + * ---------------------------------------------------------------------------
> + */
> +static int __initdata dyntick_autoenable = 0;
> +static int __initdata dyntick_useapic = 0;
> +
> +/*
> + * dyntick=[enable|disable],[forceapic]
> + */
> +static int __init dyntick_setup(char *options)
> +{
> + if (!options)
> + return 0;
> +
> + if (strstr(options, "enable"))
> + dyntick_autoenable = 1;
> +
> + if (strstr(options, "forceapic"))
> + dyntick_useapic = 1;
> +
> + return 0;
> +}
> +
> +__setup("dyntick=", dyntick_setup);


Well, your parsing is little too simplistic. If I pass
dyntick=do_not_dare_to_enable_it, it still enables :-).

> +/*
> + * ---------------------------------------------------------------------------
> + * Sysfs interface
> + * ---------------------------------------------------------------------------
> + */
> +
> +extern struct sys_device device_timer;
> +
> +static ssize_t show_dyn_tick_state(struct sys_device *dev, char *buf)
> +{
> + return sprintf(buf, "suitable:\t%i\n"
> + "enabled:\t%i\n"
> + "using APIC:\t%i\n",
> + dyn_tick->state & DYN_TICK_SUITABLE,
> + (dyn_tick->state & DYN_TICK_ENABLED) >> 1,
> + (dyn_tick->state & DYN_TICK_USE_APIC) >> 3);

You basically hardcode values of DYN_TICK_* here. Why not use !!() and
loose dependency?

Pavel
-
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/