2003-09-12 04:36:27

by tabris

[permalink] [raw]
Subject: Jiffies_64 for 2.4.22-ac

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I took Tim Schmielau's jiffies_64 patch, and ported it to -ac

currently running on my machine here.
comments? did i screw up horribly?

- --
tabris
- -
We have art that we do not die of the truth.
-- Nietzsche
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/YU0PtTgrITXtL+8RAsiHAJ9j7y8qzFwrIiMCpTfyVR+CpDetWACgpWaQ
hJQSYKqtVNYgc6tf6C5gFhU=
=yz0I
-----END PGP SIGNATURE-----


Attachments:
(No filename) (449.00 B)
clearsigned data
jif64-2.4.22-ac1.diff (16.71 kB)
Download all attachments

2003-09-12 14:00:19

by Tim Schmielau

[permalink] [raw]
Subject: Re: Jiffies_64 for 2.4.22-ac

On Fri, 12 Sep 2003, Tabris wrote:

> I took Tim Schmielau's jiffies_64 patch, and ported it to -ac
>
> currently running on my machine here.
> comments? did i screw up horribly?

see my comments below:


> +#define get_uidle_64() get_64bits(&(init_tasks[0]->times.tms_utime),\
> + &uidle_msb_flips)
> +#define get_sidle_64() get_64bits(&(init_tasks[0]->times.tms_stime),\
> + &sidle_msb_flips)

for -ac this needs to be

+#define get_uidle_64() get_64bits(&(init_task.times.tms_utime),\
+ &uidle_msb_flips)
+#define get_sidle_64() get_64bits(&(init_task.times.tms_stime),\
+ &sidle_msb_flips)


> + check_one(init_tasks[0]->times.tms_utime, &uidle_msb_flips);
> + check_one(init_tasks[0]->times.tms_stime, &sidle_msb_flips);

ditto


+#define get_uidle_64() (init_tasks[0]->times.tms_utime)
+#define get_sidle_64() (init_tasks[0]->times.tms_stime)

ditto


> - unsigned long uptime;
> - unsigned long idle;
> + u64 uptime, idle;
> int len;

the declaration
unsigned long uptime_remainder, idle_remainder;
is missing


> #if HZ!=100
> len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
> - uptime / HZ,
> - (((uptime % HZ) * 100) / HZ) % 100,
> - idle / HZ,
> - (((idle % HZ) * 100) / HZ) % 100);
> + (unsigned long) uptime,
> + uptime_remainder,
> + (unsigned long) idle / HZ,
> + idle_remainder);

since we're in the HZ!=100 branch, this needs to be

+ (uptime_remainder * 100) / HZ,
+ (unsigned long) idle,
+ (idle_remainder * 100) / HZ);



I wonder it actually compiled, but otherwise it looks good.

Tim

2003-09-12 15:07:40

by tabris

[permalink] [raw]
Subject: Re: Jiffies_64 for 2.4.22-ac

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 12 September 2003 10:00 am, Tim Schmielau wrote:
> On Fri, 12 Sep 2003, Tabris wrote:
> > I took Tim Schmielau's jiffies_64 patch, and ported it to -ac
> >
> > currently running on my machine here.
> > comments? did i screw up horribly?
>
> see my comments below:
> > +#define get_uidle_64()
> > get_64bits(&(init_tasks[0]->times.tms_utime),\ +
> > &uidle_msb_flips)
> > +#define get_sidle_64()
> > get_64bits(&(init_tasks[0]->times.tms_stime),\ +
> > &sidle_msb_flips)
>
> for -ac this needs to be
>
> +#define get_uidle_64() get_64bits(&(init_task.times.tms_utime),\
> + &uidle_msb_flips)
> +#define get_sidle_64() get_64bits(&(init_task.times.tms_stime),\
> + &sidle_msb_flips)
>
> > + check_one(init_tasks[0]->times.tms_utime, &uidle_msb_flips);
> > + check_one(init_tasks[0]->times.tms_stime, &sidle_msb_flips);
>
> ditto
>
>
> +#define get_uidle_64() (init_tasks[0]->times.tms_utime)
> +#define get_sidle_64() (init_tasks[0]->times.tms_stime)
>
> ditto
>
> > - unsigned long uptime;
> > - unsigned long idle;
> > + u64 uptime, idle;
> > int len;
>
> the declaration
> unsigned long uptime_remainder, idle_remainder;
> is missing
>
> > #if HZ!=100
> > len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
> > - uptime / HZ,
> > - (((uptime % HZ) * 100) / HZ) % 100,
> > - idle / HZ,
> > - (((idle % HZ) * 100) / HZ) % 100);
> > + (unsigned long) uptime,
> > + uptime_remainder,
> > + (unsigned long) idle / HZ,
> > + idle_remainder);
>
> since we're in the HZ!=100 branch, this needs to be
>
> + (uptime_remainder * 100) / HZ,
> + (unsigned long) idle,
> + (idle_remainder * 100) / HZ);
>
>
>
> I wonder it actually compiled, but otherwise it looks good.
>
> Tim
>
oops.
yeah, i merged it originally against a different tree... that patch didn't
apply against 2.4.22-ac
and i forgot to compile test it since i was too tired.

updated/fixed patch later today.

- --
tabris
- -
"...A strange enigma is man!"
"Someone calls him a soul concealed in an animal," I suggested.
"Winwood Reade is good upon the subject," said Holmes. "He remarked
that, while the individual man is an insoluble puzzle, in the aggregate he
becomes a mathematical certainty. You can, for example, never foretell
what any one man will do, but you can say with precision what an average
number will be up to. Individuals vary, but percentages remain constant.
So says the statistician."
-- Sherlock Holmes, "The Sign of Four"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/YeEYtTgrITXtL+8RAm6zAJ93ljgW0p70fgrrjvhu52Dod+fOawCcCLjc
Ns6HWVXlCbIHWf8t2FB9BzI=
=ya6P
-----END PGP SIGNATURE-----

2003-09-12 16:01:24

by tabris

[permalink] [raw]
Subject: Re: Jiffies_64 for 2.4.22-ac

this one is changed as per my current running kernel, and compile tested.
sorry about the last one... -ENOCAFFEINE


Attachments:
(No filename) (115.00 B)
jif64-2.4.22-ac1.diff (16.76 kB)
Download all attachments

2003-09-12 17:10:12

by Tim Schmielau

[permalink] [raw]
Subject: Re: Jiffies_64 for 2.4.22-ac

On Fri, 12 Sep 2003, Tabris wrote:

> this one is changed as per my current running kernel, and compile tested.
> sorry about the last one... -ENOCAFFEINE

still one knit:

> #if HZ!=100
> len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
> - uptime / HZ,
> - (((uptime % HZ) * 100) / HZ) % 100,
> - idle / HZ,
> - (((idle % HZ) * 100) / HZ) % 100);
> + (unsigned long) uptime,
> + (uptime_remainder * 100) / HZ,
> + (unsigned long) idle / HZ,
> + (idle_remainder * 100) / HZ);

the last lines should read

+ (unsigned long) idle,
+ (idle_remainder * 100) / HZ);

since idle already got divided by HZ a couple of lines earlier.


Btw., the common convention used by kernel hackers is that you can do

> cd linux-2.4.22-ac1
> patch -p1 < ../whatever.patch

while with your patches one has to use -p2.

Tim

2003-09-12 17:38:30

by tabris

[permalink] [raw]
Subject: Re: Jiffies_64 for 2.4.22-ac

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 12 September 2003 01:10 pm, Tim Schmielau wrote:
> On Fri, 12 Sep 2003, Tabris wrote:
> > this one is changed as per my current running kernel, and compile
> > tested. sorry about the last one... -ENOCAFFEINE
>
> still one knit:
<snip>
> the last lines should read
>
> + (unsigned long) idle,
> + (idle_remainder * 100) / HZ);
>
> since idle already got divided by HZ a couple of lines earlier.
>
fixed.
>
> Btw., the common convention used by kernel hackers is that you can do
>
> > cd linux-2.4.22-ac1
> > patch -p1 < ../whatever.patch
>
> while with your patches one has to use -p2.
>
short of running sed on my patches or changing my own tree structure, I'm
not sure how to change this.

FWIW, my current method is actually closer to how Linus used to do it...
Marcelo changed it from $version/linux to linux-$version and when using
old Linus 2.4 patches, one does a patch -p 1 from $version/ but Marcelo
patches, i have to do it from linux/

Maybe I'm just being an old timer on this... but i think i liked Linus'
old way better.
> Tim
- --
tabris
- -
A programmer from a very large computer company went to a software
conference and then returned to report to his manager, saying: "What sort
of programmers work for other companies? They behaved badly and were
unconcerned with appearances. Their hair was long and unkempt and their
clothes were wrinkled and old. They crashed out hospitality suites and
they made rude noises during my presentation."
The manager said: "I should have never sent you to the conference.
Those programmers live beyond the physical world. They consider life
absurd, an accidental coincidence. They come and go without knowing
limitations. Without a care, they live only for their programs. Why
should they bother with social conventions?"
"They are alive within the Tao."
-- Geoffrey James, "The Tao of Programming"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/YgR4tTgrITXtL+8RAiHYAJsF/KGLO1rGySnkcbJ/XhQqAoDdpQCff4fJ
omrBweDu942bMXDQp9J+3QA=
=gU7d
-----END PGP SIGNATURE-----


Attachments:
(No filename) (2.10 kB)
clearsigned data
jif64-2.4.22-ac1.diff (16.75 kB)
Download all attachments

2003-09-13 01:46:28

by Tim Schmielau

[permalink] [raw]
Subject: Re: Jiffies_64 for 2.4.22-ac

> > while with your patches one has to use -p2.
> >
> short of running sed on my patches or changing my own tree structure, I'm
> not sure how to change this.

sed is one option, links are another.

> Marcelo changed it from $version/linux to linux-$version and when using
> old Linus 2.4 patches, one does a patch -p 1 from $version/ but Marcelo
> patches, i have to do it from linux/

Linus' 2.4 patches used $version/linux/ for the old tree and linux/ for
the new one, so they worked with -p1 from inside linux/ as well.

Anyways, I don't bother too much. It's just a short moment of irritation
when the first filename isn't found.

Tim