Subject: Linux-Development Digest #83
From: Digestifier <Linux-Development-Request@senator-bedfellow.MIT.EDU>
To: Linux-Development@senator-bedfellow.MIT.EDU
Reply-To: Linux-Development@senator-bedfellow.MIT.EDU
Date:     Fri, 10 Sep 93 12:13:16 EDT

Linux-Development Digest #83, Volume #1          Fri, 10 Sep 93 12:13:16 EDT

Contents:
  Re: Status of the NET-2 port (Daniel Supernaw-Issen)
  NET2e Alpha4 problems... Xwin / FTP softwares telnet
  Re: Idea, donate a Pentium machine to Linus, anyone? (PERUCCI, PHILIP A.)
  Re: swapfile on NFS mounted fs (Paul Jones)

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

From: daniel@austin.ibm.com (Daniel Supernaw-Issen)
Subject: Re: Status of the NET-2 port
Date: Fri, 10 Sep 1993 13:21:57 GMT


In article <1993Sep10.033246.28836@super.org>, becker@super.org (Donald J. Becker) writes:
> In article <1993Sep10.002132.13102@mel.dit.csiro.au>,
> Robert Smart <smart@squid.mel.dit.CSIRO.AU> wrote:
[stuff deleted]
> This is what is meant by a "chilling effect", no one is willing to
> pick up software that has a questionable legal status.  And if the suit
> goes the wrong way, you "knew, or should have known, that the code was
> the intellectual property of <X>, and sought {unfair advantage},{to
> dilute it's competitive value to <X>},{appropriate the item for your
> own gain}".  Then it starts looking like a criminal rather than
> strictly civil matter.

Despite what 'reasonalbe' people would really think in reality - the courts more
often or not do nothing more than reaffirm the status quo - in this case 
tacit consent to USL owning every every every bit of everything.  Brain 
contamination ....I really don't want to BSD code in the kernel.  I don't wan't
people who have worked with BSD code working in the kernel.  No joke.  If the
suit does go sour (that is USL winning) we'd be screwed.  Moreover, unlike the
regents of the California system - none of us have nearly the funds to fight
such a suit.

> >The USL lawsuit is very dead - they're only arguing about how much
> >compensation UC should get for being maligned. 

you wish.

> >If Linux could
> >be organized internally so that it could easily track networking
> >developments from Berkeley it would be a big plus. For example
> >you would then get:
> > 4. Low level support for lots of networking devices: ethernet, token
> >    ring, FDDI, ISDN, ATM/BISDN, etc...
> 
> I don't that this would necessarily be true.
> 
> >I realise that the (Linux-)NET-2 release is designed to fit into
> >the Linux kernel. I realise that integrating BSD stuff is a pain.
> >The final decision has to come from Linus (and I'll bet he doesn't
> >want to drop work done by people who are particularly friendly
> >to Linux). It would be really nice if the people who've worked on
> >Linux Net-2 would say to Linus "We've learnt a lot and won't be 
> >upset if you change again".

What I like most about Linux above all else is that it accomplishes so 
incredibly much with such underpowered hardware and so little code.  I really
think introducing BSD code which has grown/bloated/and hadn't been rewritten long
after it should have is a bad idea.  Frankly, I see bug fixes alot faster here
than I have ever seen associated with any BSD product - It is my opinion that this
is do to the relative complexity difference between Linux and BSD.

 
> I fall on both sides of this issue.  I've put a _lot_ of effort into
> the low levels of Linux networking, as almost all of the device-level
> code was written by me.  I would be very disappointed to see that
> thrown away.  I think many users would be disappointed as well -- the
> ethercard drivers have been very solid, and going to BSD code would
> mean dropping support for most of the not-quite-clone ethercards that
> many Linux users have.
> 
> On the other hand, I see the not yet released "Net-2e" development
> picking up significant parts of the BSD code, and I can't help
> wondering what their goals really are.  I see little difference
> between having 1/3 of the code being from BSD with the existing
> networking code changed to fit it (e.g.  changed from sk_buffs to
> mbufs), and 9/10 of being from BSD with only a new Linux kernel interface.

agreed.
 
> Coupled with this is my frustration at the way new bugs were introduced
> with "Net-2", and then "development team" abandoned the code with the
> promise "everything will be fixed when we come out with yet another
> completely new structure".  I feel hamstrung, because any improvement
> or bug fix I make is destined to be swept away.  I've been working on
> an IP "fast-path" (to recover the significant drop in performance
> going to "Net-2") and constant-expected-time fragment reassembly based
> on Clark's algorithm.  I'm not going to release these, or even keep
> working on them, if they are only going to be in for a kernel
> patchlevel or two.  The same holds true for changing the device drivers
> to be real devices, allocating low-memory buffers for DMA, and
> implementing promiscuous and multicast modes -- these are trivial but
> not worth doing if they will be immediately discarded.
>
> Even if the USL lawsuit didn't exist, I think it's a good thing that
> we are doing a publically-available networking implementation separate
> and distinct from BSD.  BSD has historic cruft, and most of the design
> decisions date from a far different era and are ripe to be
> revisited.  A notable example is the use of 'mbufs', a structure that
> is at the core of BSD networking.  It was designed to hold packets as
> a linked list of protocol headers and data pages.  This was a good
> idea in the days of microcoded machines with complex addressing modes,
> short pipelines, and very small memories.  On modern machines they are
> slower than storing always storing the packet linearly.  (Would
> someone care to comment on how many times 'mpullup()' occurs in BSD,
> and how expensive it is?)
> 
> Reading back over this letter I'm beginning to wonder if it's a good
> time to join Ross.

Please don't.  Your work has been invaluable.  If I wanted BSD I would have 
gotten it by now.

> -- 
> 
> Donald Becker                                        becker@super.org
> IDA Supercomputing Research Center
> 17100 Science Drive, Bowie MD 20715                      301-805-7482


Daniel Supernaw-Issen
please send all mail/flames/etc to danielsi@cs.utexas.edu
I speak for nobody but myself.

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

Date: Fri, 10 Sep 1993 11:33:15 EDT
From: <MTF108@psuvm.psu.edu>
Subject: NET2e Alpha4 problems... Xwin / FTP softwares telnet

Hello out there..  I've finally got pl12 going with the newest net stuff, but
unfortunately I'm running into some major problems..

Whenever I try to telnet into my Linux box from an IBM ps2 model 50 running
ftp software's telnet it locks whenever I try to do anything with a lot of
output.  Like  ls -al /etc    or   cat bigfile.   This is the same problem
I had when I was using pl8.

Whenever I pipe an Xapp over to my linux box that requires a lot of bandwidth,
like refressing the screen every 20th of a second or so, it will work fine for
about a minute and then the packet collision light will start flashing.. things
will slow down and then just stop.   If I do an ifconfig it says the the
ethernet card..  eth1 in this case is gone.. ie not even in ifconfig anymore.
has anyone had these problems is there a fix?  I really need to be able to run
remote apps.

                                                            Mark

ps.. why does my ethernet card come up as eth1?

specs:  486/dx50 clone..  Alta ne2000 clone ethernet card..  8 megs or ram
        30 megs swap..

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

From: SSB1PZP@imcvms.med.navy.mil (PERUCCI, PHILIP A.)
Subject: Re: Idea, donate a Pentium machine to Linus, anyone?
Date: Fri, 10 Sep 1993 15:10:30 GMT

In <26n39a$odv@noc.usfca.edu> callis@noc.usfca.edu writes:
> 
> Of course this would never work, but just think if everyone who has
> Linux going or anyone who used to use Linux donated a single $1 bill...
> We probably would be able to get a brand new, nifty machine for Linus.
> Just think, with a Pentium(tm) based machine, he could start designing
> Linux: The Next Generation (coming soon to a theatre near you!).
> 

As long as we are buying Linus a PC, it may be worth getting him
one with dual processors.  Symetric multiprocessing is already in
NT, and OS/2 will have it soon...

Maybe if we all kick it $5, we could actually make this happen.  
Is there a way to:

  1) Automate transmission of funds to Linus?
  2) Post weekly the current total funds contributed thus far?


===========================================================================
 Phil Perucci, Systems Programmer   | "I don't speak for any organization
 ssb1pzp@imcvms.med.navy.mil        |  and no organization speaks for me"
===========================================================================

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

From: paulj@cs.kun.nl (Paul Jones)
Subject: Re: swapfile on NFS mounted fs
Date: Fri, 10 Sep 1993 15:29:44 GMT

While setting up a (hard)diskless machine I was in need of some
extra virtual memory, so I decided to create a swapfile on /tmp
(which is actually NFS mounted from a fileserver). Much to my
surprise I got an error about reading the swapspace-signature.
As I had just done an mkswap on that file I was a little 
surprised, and decided that maybe swapfiles can not be on a
NFS mounted dir. A quick look in mm/swap.c confirmed my 
hunch. The current implementation for swapfiles depend on having 
a mapping onto a block-device (which a NFS mounted fs does not have). 
So what I need is an implementation for swapfiles that uses the VFS 
layer to read and write pages. 

I already gave this a try, but I am running into some minor =B^) 
problems (a small case of rebooting/hanging after swapping a few
pages). As far as I can tell the write request I make do not 
get satisfied (does the NFS code allocate some pages somewhere?) i.e. 
I see a whole bunch of: `rw_swap_page: writing page xx' 
and then either the system hangs or reboots =B^(. I hardly ever see 
the kernel message: `rw_swap_page: wrote page xx'. 

Running same code on a swapfile allocated on a local (ext2) filesystem
works like a charm.... =B^)   

So I need some help from somebody with more knowledge of the NFS-code 
to take a look at the diffs and tell me what the hell is going wrong 
or give me some hints as to where the problem might be. 

Apply folowing patch to mm/swap.c:
============================8<==8<================================
*** swap.c.orig Fri Sep 10 17:07:07 1993
--- swap.c      Fri Sep 10 17:08:41 1993
***************
*** 19,24 ****
--- 19,25 ----
  
  #include <asm/system.h> /* for cli()/sti() */
  #include <asm/bitops.h>
+ #include <asm/segment.h> 
  
  #define MAX_SWAPFILES 8
  
***************
*** 34,40 ****
  
  static struct swap_info_struct {
        unsigned long flags;
!       struct inode * swap_file;
        unsigned int swap_device;
        unsigned char * swap_map;
        unsigned char * swap_lockmap;
--- 35,41 ----
  
  static struct swap_info_struct {
        unsigned long flags;
!       struct file swap_file;
        unsigned int swap_device;
        unsigned char * swap_map;
        unsigned char * swap_lockmap;
***************
*** 85,105 ****
                sleep_on(&lock_queue);
        if (p->swap_device) {
                ll_rw_page(rw,p->swap_device,offset,buf);
!       } else if (p->swap_file) {
!               unsigned int zones[8];
!               unsigned int block;
!               int i, j;
! 
!               block = offset << (12 - p->swap_file->i_sb->s_blocksize_bits);
! 
!               for (i=0, j=0; j< PAGE_SIZE ; i++, j +=p->swap_file->i_sb->s_blocksize)
!                       if (!(zones[i] = bmap(p->swap_file,block++))) {
!                               printk("rw_swap_page: bad swap file\n");
!                               return;
!                       }
!               ll_rw_swap_file(rw,p->swap_file->i_dev, zones, i,buf);
!       } else
!               printk("re_swap_page: no swap file or device\n");
        if (!clear_bit(offset,p->swap_lockmap))
                printk("rw_swap_page: lock already cleared\n");
        wake_up(&lock_queue);
--- 86,129 ----
                sleep_on(&lock_queue);
        if (p->swap_device) {
                ll_rw_page(rw,p->swap_device,offset,buf);
!       } else {
!                 unsigned long old_fs = get_fs();
!                 /* 
!                 ** buffer is in kernel space, but fileops go to user space
!                 ** so we set fs to ds
!                 */
!                 set_fs(get_ds());
!               
!                 /*
!                 ** seek to pagenr offset in swapfile 
!                 */
!                 if (p->swap_file.f_op->lseek) {
!                   p->swap_file.f_op->lseek(p->swap_file.f_inode,&(p->swap_file),offset<<12,0); 
!                 } else {
!                   p->swap_file.f_pos = offset<<12;
!                   p->swap_file.f_reada = 0;
!                 };
! 
!                 /*
!                 ** read/write that page
!                 */
!                 if (rw==READ) {
!                 printk("rw_swap_page: reading page %d\n",offset);
!                   p->swap_file.f_op->read(p->swap_file.f_inode,&(p->swap_file),buf,1<<12);
!                 printk("rw_swap_page: read page %d\n",offset);
!                 } else
!                 if (rw==WRITE) {
!                 printk("rw_swap_page: writing page %d\n",offset);
!                   p->swap_file.f_op->write(p->swap_file.f_inode,&(p->swap_file),buf,1<<12);
!                 printk("rw_swap_page: wrote page %d\n",offset);
!                 } else
!                 printk("rw_swap_page: Huh, not reading or writing...\n");
! 
!                 /*
!                 ** restore the fs of user process
!                 */
!                 set_fs(old_fs);
!       };
        if (!clear_bit(offset,p->swap_lockmap))
                printk("rw_swap_page: lock already cleared\n");
        wake_up(&lock_queue);
***************
*** 685,692 ****
        for (type = 0 ; type < nr_swapfiles ; type++,p++) {
                if ((p->flags & SWP_WRITEOK) != SWP_WRITEOK)
                        continue;
!               if (p->swap_file) {
!                       if (p->swap_file == inode)
                                break;
                } else {
                        if (!S_ISBLK(inode->i_mode))
--- 709,716 ----
        for (type = 0 ; type < nr_swapfiles ; type++,p++) {
                if ((p->flags & SWP_WRITEOK) != SWP_WRITEOK)
                        continue;
!               if (p->swap_device==0) {
!                       if (p->swap_file.f_inode == inode)
                                break;
                } else {
                        if (!S_ISBLK(inode->i_mode))
***************
*** 705,712 ****
                return i;
        }
        nr_swap_pages -= p->pages;
!       iput(p->swap_file);
!       p->swap_file = NULL;
        p->swap_device = 0;
        free_page((long) p->swap_map);
        p->swap_map = NULL;
--- 729,736 ----
                return i;
        }
        nr_swap_pages -= p->pages;
!       iput(p->swap_file.f_inode);
!       p->swap_file.f_inode = NULL;
        p->swap_device = 0;
        free_page((long) p->swap_map);
        p->swap_map = NULL;
***************
*** 726,732 ****
        struct swap_info_struct * p;
        struct inode * swap_inode;
        unsigned int type;
!       unsigned char * tmp;
        int i,j;
  
        if (!suser())
--- 750,756 ----
        struct swap_info_struct * p;
        struct inode * swap_inode;
        unsigned int type;
!         unsigned char * tmp;
        int i,j;
  
        if (!suser())
***************
*** 740,746 ****
        if (type >= nr_swapfiles)
                nr_swapfiles = type+1;
        p->flags = SWP_USED;
!       p->swap_file = NULL;
        p->swap_device = 0;
        p->swap_map = NULL;
        p->swap_lockmap = NULL;
--- 764,770 ----
        if (type >= nr_swapfiles)
                nr_swapfiles = type+1;
        p->flags = SWP_USED;
!       p->swap_file.f_inode = NULL;
        p->swap_device = 0;
        p->swap_map = NULL;
        p->swap_lockmap = NULL;
***************
*** 772,780 ****
                                return -EBUSY;
                        }
                }
!       } else if (S_ISREG(swap_inode->i_mode))
!               p->swap_file = swap_inode;
!       else {
                iput(swap_inode);
                p->flags = 0;
                return -EINVAL;
--- 796,821 ----
                                return -EBUSY;
                        }
                }
!       } else if (S_ISREG(swap_inode->i_mode)) {
!                         /*
!                         ** code derived from do_open in fs/open.c
!                         */
!                       p->swap_file.f_flags = 3; /* RW */
!                       p->swap_file.f_mode = 0;
!                       p->swap_file.f_inode = swap_inode;
!                       p->swap_file.f_pos = 0;
!                       p->swap_file.f_reada = 0;
!                       p->swap_file.f_op = NULL;
!                       if (swap_inode->i_op);
!                         p->swap_file.f_op = swap_inode->i_op->default_file_ops;
!                       if (p->swap_file.f_op && p->swap_file.f_op->open) {
!                         int error = p->swap_file.f_op->open(swap_inode,&(p->swap_file));
!                           if (error) {
!                               iput(swap_inode);
!                               return error; 
!                           };
!                         };       
!       } else {
                iput(swap_inode);
                p->flags = 0;
                return -EINVAL;
***************
*** 785,793 ****
                printk("Unable to start swapping: out of memory :-)\n");
                free_page((long) tmp);
                free_page((long) p->swap_lockmap);
!               iput(p->swap_file);
                p->swap_device = 0;
!               p->swap_file = NULL;
                p->swap_map = NULL;
                p->swap_lockmap = NULL;
                p->flags = 0;
--- 826,834 ----
                printk("Unable to start swapping: out of memory :-)\n");
                free_page((long) tmp);
                free_page((long) p->swap_lockmap);
!               iput(p->swap_file.f_inode);
                p->swap_device = 0;
!               p->swap_file.f_inode = NULL;
                p->swap_map = NULL;
                p->swap_lockmap = NULL;
                p->flags = 0;
***************
*** 798,806 ****
                printk("Unable to find swap-space signature\n");
                free_page((long) tmp);
                free_page((long) p->swap_lockmap);
!               iput(p->swap_file);
                p->swap_device = 0;
!               p->swap_file = NULL;
                p->swap_map = NULL;
                p->swap_lockmap = NULL;
                p->flags = 0;
--- 839,847 ----
                printk("Unable to find swap-space signature\n");
                free_page((long) tmp);
                free_page((long) p->swap_lockmap);
!               iput(p->swap_file.f_inode);
                p->swap_device = 0;
!               p->swap_file.f_inode = NULL;
                p->swap_map = NULL;
                p->swap_lockmap = NULL;
                p->flags = 0;
***************
*** 821,829 ****
                printk("Empty swap-file\n");
                free_page((long) tmp);
                free_page((long) p->swap_lockmap);
!               iput(p->swap_file);
                p->swap_device = 0;
!               p->swap_file = NULL;
                p->swap_map = NULL;
                p->swap_lockmap = NULL;
                p->flags = 0;
--- 862,870 ----
                printk("Empty swap-file\n");
                free_page((long) tmp);
                free_page((long) p->swap_lockmap);
!               iput(p->swap_file.f_inode);
                p->swap_device = 0;
!               p->swap_file.f_inode = NULL;
                p->swap_map = NULL;
                p->swap_lockmap = NULL;
                p->flags = 0;
======================8<===========8<=============================


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


** 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: Linux-Development-Request@NEWS-DIGESTS.MIT.EDU

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

    Internet: Linux-Development@NEWS-DIGESTS.MIT.EDU

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

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