lkml.org 
[lkml]   [1998]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Cyrix setup
Hi!

> > > If set6x86 really optimizes something, you'll need to recalculate
> > > bogomips - which is something that can not be done from userland.
> >
> > Thats a good point, and maybe we should support a recalc_bogomips
> > in the linux magic ioctl collection
> >
> > Alan
>
> I think I brought this up several years back when I wrote the 1st user space
> cyrix enable program (for the i386 DLC/SLC pin compatible chips). However
> back then udelay() wasn't used that much and so I guess nobody thought it
> was too important (myself included).
>
> Anyway, assemble/link the following "recal.s" and also apply the
> following diff (2.1.89) if there is a demand for such a syscall.

It is not *really* safe, either. Where you recompute bogomips? After your
setup. Aha, but CPU is for a while in state with completely bad
bogomips. (Kind of race).

> --- linux/kernel/sys.c.orig Sun Nov 30 20:34:44 1997
> +++ linux/kernel/sys.c Tue Mar 10 14:00:50 1998
> +
> +extern void calibrate_delay(void);
> +
> +asmlinkage int sys_recalibrate_delay(void)
> +{
> + unsigned long old_policy = current->policy;
> + unsigned long old_priority = current->rt_priority;
> +
> + if (!suser())
> + return -EPERM;
> + current->policy = SCHED_FIFO;
> + current->rt_priority = 99;
> + calibrate_delay();
> + current->rt_priority = old_priority;
> + current->policy = old_policy;

Current->priority settings are completely unneccessary. Kernel can not
be preempted unless it wants to.

> + return 0;
> +}
> +
> asmlinkage int sys_setpriority(int which, int who, int niceval)
> {
> struct task_struct *p;

Pavel

--
I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.050 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site