Linux-Development-Sys Digest #447, Volume #6      Tue, 2 Mar 99 21:14:31 EST

Contents:
  The proc filesystem on Linux 2.2.1 (Sandeep Kumar)
  Patch for 2.2.* and some Digital Celebris machines (Christopher Neufeld)
  Re: SMP Support (Michael Hirsch)
  Re: 256 threads limit on linux (Nelson Minar)
  Re: PROOF: Jesus *is* an iMac (Stuart Bell)
  procpc-1.2.9 'w' command??? (Karl Keyte)
  Re: WHY AM I BEING BLAMED? ("Jim H.")
  rtlinux and RedHat 5.2 (2.0.36) ([EMAIL PROTECTED])
  Problem with libstdc++ ("Alahel")
  something like getch needed (John DeBoard)
  V2.2.0 & V2.2.2 kernel do not compile on a m68k Amiga A1200 (Mr Guest)

----------------------------------------------------------------------------

From: Sandeep Kumar <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: The proc filesystem on Linux 2.2.1
Date: 02 Mar 1999 12:20:48 -0800

Hi, I've grappled with understanding how to add a new piece of information
for a process through /proc/pid/ or /proc/self. What I've tried is the
following but it doesn't seem to work. Any suggestions?
===============================================================================
o Added PROC_PID_FOO to the pid_direcory_inos in linux/proc_fs.h as the last
  entry of the enum.
o Created get_pid_foo(int pid, char *buff) in fs/proc/array.c to copy the
  info about the process that I want displayed.
o updated get_process_array() in fs/proc/array.c to dispatch PROC_PID_FOO.
o Created a 
From: Sandeep Kumar <[EMAIL PROTECTED]>
Date: 02 Mar 1999 12:07:42 -0800
Message-ID: <[EMAIL PROTECTED]>
Lines: 23
X-Newsreader: Gnus v5.5/XEmacs 20.4 - "Emerald"
--text follows this line--
  static struct proc_dir_entry proc_pid_foo = {
        PROC_PID_VIN, 3, "foo",
        S_IFREG | S_IRUGO, 1, 0, 0,
        0, &proc_array_inode_operations,
        NULL, proc_pid_fill_inode,
  };

  in fs/proc/base.c.
o Registered proc_pid_foo with 
 
  proc_register(&proc_pid, &proc_pid_vin);

  in fs/proc/base.c.
===============================================================================

The kernel doesn't panic but I never see /proc/self/foo. What am I not
doing?

If possible, please respond directly to me, perhaps in addition to
responding to the newsgroup.

Thanks
--sandeep

------------------------------

Subject: Patch for 2.2.* and some Digital Celebris machines
Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Christopher Neufeld)
Date: 2 Mar 1999 16:03:30 -0500

   Posted and emailed to Linus.

   A few of us have noticed problems with the 2.2.* series kernels and
some Digital Celebris Pentium boxes. The machines hang before console
initialization on 2.2.1 and 2.2.2. In my office we have four such
machines, three of which fail on the boot, and the fourth has no trouble
at all. The folks at Digital are stumped, the motherboards are the same
on all of them.
   Anyway, the problem is that on the problematic boards, the 82C54
programmable interval timer does not clear its output bit after the
countdown is commanded. The result is that a delay loop which is supposed
to take 50 milliseconds instead takes effectively zero time. The number
of CPU clock cycles spent in this 50 ms loop is then divided into a 64
bit number, with the expectation that a valid 32 bit value will be
returned, but because of the short-circuited loop, the resulting quotient
overflows on the division, and everything stops with a division error.
The following patch fixes the problem by detecting when the loop has been
short-circuited, and returning an out-of-bounds value to the calling
subroutine. This means that the TSC cannot be calibrated (at least not by
this technique), so the kernel falls back on non-TSC behaviour. The patch
has been tested, and allows problematical boards to boot into non-TSC
mode while still giving correct TSC behaviour for other Digital Celebris
machines whose CTC is working properly.


*** linux/arch/i386/kernel/time.c.orig  Thu Jan 21 09:09:30 1999
--- linux/arch/i386/kernel/time.c       Tue Mar  2 16:06:54 1999
***************
*** 587,605 ****
--- 587,620 ----
                 "movl %%eax, %%ebx\n\t"
                 "movl %%edx, %%ecx\n\t"
  
               /* Busy wait. Only 50 ms wasted at boot time. */
                 "0: inb $0x61, %%al\n\t" /* Read Speaker Output Port */
+              "incl  %3\n\t"          /* Add one to loop counter. */
               "testb $0x20, %%al\n\t" /* Check CTC channel 2 output (bit 5) */
                 "jz 0b\n\t"
  
                 /* And read the TSC.  5 jiffies (50.00077ms) have elapsed. */
                 "rdtsc\n\t"
  
                 /* Great.  So far so good.  Store last TSC reading in
                  * last_tsc_low (only 32 lsb bits needed) */
                 "movl %%eax, last_tsc_low\n\t"
+ 
+              /* If the loop counter is zero, then there's a problem with
+               * the CTC (maybe a Digital Celebris Pentium machine?).
+               * The calibration fails. */
+              "movl  %3, %%eax\n\t"
+              "andl  $0xffffffff, %%eax\n\t"
+              "jz    1f\n\t"   /* Bad CTC. Give up on this
+                                * optimization. The '0' in %eax will
+                                * be returned to the caller. */
+ 
+              /* Values were OK. Load the %eax again for the
+                 * subsequent math. */
+              "movl last_tsc_low, %%eax\n\t"
+ 
                 /* And now calculate the difference between the readings. */
                 "subl %%ebx, %%eax\n\t"
                 "sbbl %%ecx, %%edx\n\t" /* 64-bit subtract */
               /* but probably edx = 0 at this point (see below). */
                 /* Now we have 5 * (TSC counts per jiffy) in eax.  We want
***************
*** 613,625 ****
                 "movl %%eax, %%ecx\n\t"
                 "xorl %%eax, %%eax\n\t"
                 "movl %2, %%edx\n\t"
                 "divl %%ecx\n\t" /* eax= 2^32 / (1 * TSC counts per microsecond) */
               /* Return eax for the use of fast_gettimeoffset */
!                "movl %%eax, %0\n\t"
                 : "=r" (retval)
!                : "r" (5 * LATCH), "r" (5 * 1000020/HZ)
                 : /* we clobber: */ "ax", "bx", "cx", "dx", "cc", "memory");
         return retval;
  }
  
  __initfunc(void time_init(void))
--- 628,640 ----
                 "movl %%eax, %%ecx\n\t"
                 "xorl %%eax, %%eax\n\t"
                 "movl %2, %%edx\n\t"
                 "divl %%ecx\n\t" /* eax= 2^32 / (1 * TSC counts per microsecond) */
               /* Return eax for the use of fast_gettimeoffset */
!                "1: movl %%eax, %0\n\t"
                 : "=r" (retval)
!                : "r" (5 * LATCH), "r" (5 * 1000020/HZ), "m" (0xffffffff)
                 : /* we clobber: */ "ax", "bx", "cx", "dx", "cc", "memory");
         return retval;
  }
  
  __initfunc(void time_init(void))
***************
*** 652,668 ****
         *      moaned if you have the only one in the world - you fix it!
         */
   
        dodgy_tsc();
        
!       if (boot_cpu_data.x86_capability & X86_FEATURE_TSC) {
  #ifndef do_gettimeoffset
                do_gettimeoffset = do_fast_gettimeoffset;
  #endif
                do_get_fast_time = do_gettimeofday;
                use_tsc = 1;
-               fast_gettimeoffset_quotient = calibrate_tsc();
                
                /* report CPU clock rate in Hz.
                 * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) =
                 * clock/second. Our precision is about 100 ppm.
                 */
--- 667,683 ----
         *      moaned if you have the only one in the world - you fix it!
         */
   
        dodgy_tsc();
        
!       if (boot_cpu_data.x86_capability & X86_FEATURE_TSC &&
!           (fast_gettimeoffset_quotient = calibrate_tsc()) != 0) {
  #ifndef do_gettimeoffset
                do_gettimeoffset = do_fast_gettimeoffset;
  #endif
                do_get_fast_time = do_gettimeofday;
                use_tsc = 1;
                
                /* report CPU clock rate in Hz.
                 * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) =
                 * clock/second. Our precision is about 100 ppm.
                 */



=== CUT HERE ===

-- 
 Christopher Neufeld - Not a graduate student   [EMAIL PROTECTED]
 Home page:  http://caliban.physics.utoronto.ca/neufeld/Intro.html
 "Don't edit reality for the sake of simplicity"

------------------------------

From: Michael Hirsch <[EMAIL PROTECTED]>
Subject: Re: SMP Support
Date: 02 Mar 1999 09:49:27 -0500

[EMAIL PROTECTED] (Adam P. Jenkins) writes:

> Unfortunately I don't have access to that machine anymore because I
> don't work there anymore.  Anyone with a dual-processor Pentium want
> to try it and let us know the results?  That is, try compiling your
> kernel with "make -j 2", and then try it with some other numbers
> higher than 2 to see how the compile times compare.  I do seem to
> remember that "make -j 2 dep zImage modules" took about 2 1/2 minutes
> to compile.  Or maybe it was just "make -j 2 zImage modules".  That
> was with dual PII 200s and 256 megs RAM.

Okay, here's what I got.  My box is a dual PII 350 with 128M of RAM,
an ultra II SCSI can and a Viking II HD.  So these are fairly fast
CPUs with a fairly fast disk.

I ran the first make twice to get the source into the cache.  I ran
'make clean' between before each compile (though as you can see, that
make only 7 seconds difference).  As you can see, -j2 was
slower than -j4 but only by 10 seconds.  -j6 was 3 seconds slower than
-j4 which hardly seems significant.  As you can see, CPU usage varied
from 178% to 190% (I'm ignoring the 170% when the cache wasn't full).

I should try this at home.  I have a P166 with a SCSI disk and I've
always the impression that -j3 saved me a lot of time.  I'll try to
measure. 

[root@vector linux]# time make -j2 bzImage > /dev/null
Root device is (8, 1)
Boot sector 512 bytes.
Setup is 1380 bytes.
System is 505 kB
242.86user 18.59system 2:33.22elapsed 170%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (254887major+329129minor)pagefaults 0swaps

[root@vector linux]# time make -j2 bzImage > /dev/null
Root device is (8, 1)
Boot sector 512 bytes.
Setup is 1380 bytes.
System is 505 kB
242.89user 18.36system 2:26.49elapsed 178%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (252083major+329129minor)pagefaults 0swaps

[root@vector linux]# time make -j4 bzImage > /dev/null
Root device is (8, 1)
Boot sector 512 bytes.
Setup is 1380 bytes.
System is 505 kB
243.93user 18.68system 2:16.95elapsed 191%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (252083major+329082minor)pagefaults 0swaps

[root@vector linux]# time make -j6 bzImage > /dev/null
Root device is (8, 1)
Boot sector 512 bytes.
Setup is 1380 bytes.
System is 505 kB
244.10user 18.68system 2:19.77elapsed 188%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (252083major+329080minor)pagefaults 0swaps
[root@vector linux]# 


-- 
Michael D. Hirsch                       Work: (404) 727-7940
Emory University, Atlanta, GA 30322     FAX: (404) 727-5611
email:  [EMAIL PROTECTED]         http://www.mathcs.emory.edu/~hirsch/

Public key for encrypted mail available upon request (or finger
[EMAIL PROTECTED]).

------------------------------

From: Nelson Minar <[EMAIL PROTECTED]>
Subject: Re: 256 threads limit on linux
Date: 02 Mar 1999 17:30:38 -0500

"Olga Sivash" <[EMAIL PROTECTED]> writes:
> I'm using RH 5.2 linux 2.0.36 I can't produce more then 256
> processes or threads per user. Why is it so?

I looked into this a bit for Java on Linux. Native thread versions of
Java have the same concern about thread limitations.. Here's what I
found, in a discussion there titled "Green/Native threads" around
February 8, 1999:

======================================================================
A bit more info on thread limits.. Linux 2.0 defines NR_TASKS in
/usr/src/linux/include/linux/tasks.h. The default is 512, but then
there's MAX_TASKS_PER_USER which is defined as NR_TASKS/2. So if I
understand right, that means that a Java process using native threads
is limited to 256 threads in the default kernel. It's possible that
boosting NR_TASKS up and recompiling the kernel will Just Work, but I
don't know. I also don't know the implications on kernel memory used
or scheduler performance.

The reason kernels have compiled-in limits like this is it greatly
simplifies and speeds up the scheduler. Dealing with dynamic memory
structures is a mess, particularly if you can't rely on the VM system
in the kernel to manage your memory. Most Unix kernels I know have
similar limits.
======================================================================

                                                  [EMAIL PROTECTED]
.       .      .     .    .   .  . . http://www.media.mit.edu/~nelson/

------------------------------

From: [EMAIL PROTECTED] (Stuart Bell)
Crossposted-To: 
alt.society.underwear,comp.sys.mac.misc,comp.sys.amiga.hardware,fr.rec.voyages
Subject: Re: PROOF: Jesus *is* an iMac
Date: Tue, 2 Mar 1999 14:08:07 +0000

Stuart Bell <[EMAIL PROTECTED]> wrote:

> Pablo <[EMAIL PROTECTED]> wrote:
> 
> > Per Olsson wrote:
> > 
> > In bible class today, our teacher said that I am a Jesus Freak!
> 
> Pablo: If you delete all that someone else has written, please also
> delete the line "XXX XXXX wrote".
> 
> In this case, it appears that Per said "In bible class. . ." whereas in
> fact you wrote it. OK?


-- 
Stuart Bell - happily working on Macs in a Wintel-free zone
  PB-100 FAQ at www.argonet.co.uk/users/sabell/pb100.html
  JR's Duo FAQ at www.argonet.co.uk/users/sabell/duo.html
 6400/6500 users: http://hometown.aol.com/tmk12v/home.html

------------------------------

From: Karl Keyte <[EMAIL PROTECTED]>
Subject: procpc-1.2.9 'w' command???
Date: Tue, 02 Mar 1999 09:26:54 +0000

I've just built the package procpc-1.2.9 on a 2.2.1 kernel system with
glibc-2.0.7 libraries. All seemed to compile fine and most of it runs
without a problem.

But...the 'w' command returns no users. uptime also gives the usual
(correct) data but indicates no users. Is there an incompatibility in
the
utmp file which is causing this? I haven't rebooted the system but can't

imagine why I would have to?

Could anyone with any ideas please e-mail me directly?

Many thanks for your help.

Karl



------------------------------

From: "Jim H." <[EMAIL PROTECTED]>
Crossposted-To: alt.society.underwear,comp.sys.mac.misc,comp.sys.amiga.hardware
Subject: Re: WHY AM I BEING BLAMED?
Date: Tue, 02 Mar 1999 15:29:14 -0800
Reply-To: [EMAIL PROTECTED]

Don't blame him Gary Rice! It clearly is all your fault! <g>

[EMAIL PROTECTED] wrote:

> In article <[EMAIL PROTECTED]>,
>   Julian Robert Yon <[EMAIL PROTECTED]> wrote:
> > This is going too far. Will you French please stop making me a
> > scapegoat. I am not responsible for the original postings, and my only
> > crime seems to be contributing to a long running discussion, which just
> > happens to have been off-topic.
>
> If you don't want to be "blamed" for contributing to a thread that was no
> place in the newsgroup where it was posted, DON'T REPLY to it.
>
> Gary Rice
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




------------------------------

From: [EMAIL PROTECTED]
Subject: rtlinux and RedHat 5.2 (2.0.36)
Date: Tue, 02 Mar 1999 23:17:13 GMT

All:

I'm new to Linux and I'm trying to install the real time patches
(www.rtlinux.org) to Linux 2.0.36.  This requires adding patches to the kernel
which I've never done.  The recompileing the kernel doesn't seem too bad, but
the directions detailing how to add the patch are confusing.  Any
tips/help/advice/etc.. about how to do this would be greatly appreciated!

Thanks,

Matt
[EMAIL PROTECTED]

============= Posted via Deja News, The Discussion Network ============
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

------------------------------

From: "Alahel" <[EMAIL PROTECTED]>
Subject: Problem with libstdc++
Date: Tue, 2 Mar 1999 16:51:57 +0100

Hi, I've tried to compile the libstc++ v.2.8.1.1 and all the bootstrap gone
fine. But when I try to compile something the program can't load the library
saying that can't find "__register_frame_info". Someone can help me? Thanks
a lot. Alex.



------------------------------

From: John DeBoard <[EMAIL PROTECTED]>
Subject: something like getch needed
Date: Tue, 02 Mar 1999 12:11:56 -0500

something like getch needed, is there any kind of hack to get the same
effect as getch?

Heres a hack for  kbhit()

#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

int kbhit(void)
{
    fd_set rfds;
    struct timeval tv;

    FD_ZERO(&rfds);
    FD_SET(0, &rfds);

    tv.tv_sec = 0;
    tv.tv_usec = 0;

    if(select(1, &rfds, NULL, NULL, &tv))
    {
        return(1);
    }

    return(0);
}


Thank you for the help,

John DeBoard

------------------------------

From: [EMAIL PROTECTED] (Mr Guest)
Subject: V2.2.0 & V2.2.2 kernel do not compile on a m68k Amiga A1200
Date: Tue, 02 Mar 1999 17:14:23 GMT

 I have tried to compile linux kernal v2_2_0 and v2_2_2 and get a
compilation error.
 My system is an Amiga A1200 with a Blizzard 1260 and SCSI interface. 
 48Mb Ram and approx 5.5Gb of disk space on the SCSI port and .5Gb on
 the IDE port. 
 A CDROM and a HP T4000s tape streamer are also on the SCSI port.
 
 I am running 2_0_36 at present and I would like to upgrade as I am 
having trouble getting linux to boot when I have a Zip drive connected
 to the SCSI port.
 
 On typing make I get the following output. 
 Has anyone tried to compile this before and if so how did you
overcome this error.
 
 Thank you.

 --------------------------------------------------------------------
 
  gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
 -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -ffixed-a2
-m68060
  -c -o init/main.o init/main.c
 
 /usr/src/linux/include/asm/semaphore.h: In function
`waking_non_zero':
 In file included from /usr/src/linux/include/linux/fs.h:161,
                  from /usr/src/linux/include/linux/capability.h:13,
                  from /usr/src/linux/include/linux/binfmts.h:5,
                  from /usr/src/linux/include/linux/sched.h:8,
                  from /usr/src/linux/include/linux/mm.h:4,
                  from /usr/src/linux/include/linux/slab.h:14,
                  from /usr/src/linux/include/linux/malloc.h:4,
                  from /usr/src/linux/include/linux/proc_fs.h:5,
                  from init/main.c:15:
 /usr/src/linux/include/asm/semaphore.h:61: `owner_depth' undeclared
 (first use this function)
 /usr/src/linux/include/asm/semaphore.h:61: (Each undeclared
identifier
 is reported only once
 /usr/src/linux/include/asm/semaphore.h:61: for each function it
appears in.)
 make: *** [init/main.o] Error 1

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to