From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: f4671,b1738035b01d4980 X-Google-Attributes: gidf4671,public X-Google-Thread: 1164f8,b1738035b01d4980 X-Google-Attributes: gid1164f8,public X-Google-Thread: 11035d,b1738035b01d4980 X-Google-Attributes: gid11035d,public X-Google-Thread: fcfb9,37054c7b7cf8c10a X-Google-Attributes: gidfcfb9,public X-Google-Thread: 1070f0,b1738035b01d4980 X-Google-Attributes: gid1070f0,public From: Timothy Watson Subject: Re: Why not Solaris on Alpha? Date: 1997/06/13 Message-ID: X-Deja-AN: 248151270 Distribution: inet References: <5mrt16$eo3@percy.cs.bham.ac.uk> <5nn6oh$4rq@panix.com> <5nnup0$3j7@cynic.portal.ca> <5nqfmq$tss@pell.pell.portland.or.us> Organization: What am I doing? Newsgroups: comp.unix.solaris,comp.sys.sun.admin,comp.sys.sun.hardware,comp.sys.dec,comp.os.linux.advocacy And also (maybe Curt understands this stuff) &&&&&&&&&&&&&&&&&&&&&&&& Re: kernel > 2.1.36 & nfs David S. Miller (davem@jenolan.rutgers.edu) Tue, 3 Jun 1997 19:54:31 -0400 Messages sorted by: [ date ][ thread ][ subject ][ author ] Next message: Linus Torvalds: "Re: kernel > 2.1.36 & nfs" Previous message: Philip Gladstone: "linux-pre2.0.31" Maybe in reply to: Steven N. Hirsch: "kernel > 2.1.36 & nfs" Date: Tue, 3 Jun 1997 16:50:55 -0700 (PDT) From: Linus Torvalds Note that this is a different VM trick from the one that uses _kernel_ virtual memory to actually make the packet look contiguous in kernel memory even though we only allocate one page at a time. Alan was advocating something that approaches "vmalloc()" (not quite, but it had some of the same properties), and that I'm dead set against. Oh, ok, Alan that's a stupid idea, listen to pinhead ;-) While I'm at it, I will advocate that using a chaining mechanim that might even look something like BSD MBUF chains, but _ONLY_ for > PAGE_SIZE MTU's devices, makes a _lot_ of sense. For < PAGE_SIZE MTU'd devices (ie. ethernet) it makes no sense and that is why we should continue to do what we do now for them. Except of course when a huge fragmented thing comes in, then the frag code builds the chains and passes them up as if this was some huge packet coming from a >PAGE_SIZE MTU'd device, the upper layers do not even need to know the difference. ---------------------------------------------//// Yow! 11.26 MB/s remote host TCP bandwidth & //// 199 usec remote TCP latency over 100Mb/s //// ethernet. Beat that! //// -----------------------------------------////__________ o David S. Miller, davem@caip.rutgers.edu /_____________/ / // /_/ >< &&&&&&&&&&&&&&&&&&&&&&&& (much of the rest of the thread) *********** Re: kernel > 2.1.36 & nfs Alan Cox (���) Tue, 3 Jun 1997 22:21:12 +0100 (BST) Messages sorted by: [ date ][ thread ][ subject ][ author ] Next message: Andi Gutmans: "Non-Executable Stack Patch" Previous message: Alan Cox: "Re: kernel > 2.1.36 & nfs" > The point is that the copy is _never_ needed - we'd be better off just > leaving the packets fragmented, and let the higher level protocols (tcp > and udp) take care of "reassembly" (ie copy them to user mode or to the > page cache and only _then_ do we make the DATA contiguous - never the > actual packet itself). Second point. We can't make a 65280 byte HIPPI NFS UDP packet contiguous without fixing the underlying page allocator (preferred) or doing vm games as I suggested below. ************** Re: kernel > 2.1.36 & nfs Linus Torvalds (torvalds@transmeta.com) Tue, 3 Jun 1997 16:12:21 -0700 (PDT) Messages sorted by: [ date ][ thread ][ subject ][ author ] Next message: Gabriel Paubert: "Re: NMI trap and 2.1.37-7" Previous message: Andi Gutmans: "Re: Non-Executable Stack Patch" In reply to: Alan Cox: "Re: kernel > 2.1.36 & nfs" On Tue, 3 Jun 1997, Alan Cox wrote: > > > reception is definitly a multi-CPU issue (one CPU takes the actual > > interrupt and creates the packet, but it's very possible that the packet > > will be used on another CPU). > > It is far better at least on Intel that we don't do that - the cross cache > copy is expensive. What cross-cache copy? When we're talking really high performance, we're talking DMA and cards that do the checksum on the card themselves. In that case the data never even touches the caches on the CPU that takes the interrupt - or at least only the headers for finding out what the packet is all about. > The header can be in multiple parts. Also stuff like the NFS rpc code would > need a rewrite to cope with fragmented rpc headers I certainly agree on the need to have the headers in one fragment, but that still doesn't mean we need to reassemble _all_ fragments. Linus ************** Re: kernel > 2.1.36 & nfs Linus Torvalds (torvalds@transmeta.com) Tue, 3 Jun 1997 16:04:11 -0700 (PDT) Messages sorted by: [ date ][ thread ][ subject ][ author ] Next message: Philip Gladstone: "linux-pre2.0.31" Previous message: Gabriel Paubert: "Re: NMI trap and 2.1.37-7" In reply to: Andi Gutmans: "Non-Executable Stack Patch" Next in thread: Christopher Blizzard: "Re: Non-Executable Stack Patch" On Tue, 3 Jun 1997, Alan Cox wrote: > > The point is that the copy is _never_ needed - we'd be better off just > > leaving the packets fragmented, and let the higher level protocols (tcp > > and udp) take care of "reassembly" (ie copy them to user mode or to the > > page cache and only _then_ do we make the DATA contiguous - never the > > actual packet itself). > > Second point. We can't make a 65280 byte HIPPI NFS UDP packet contiguous > without fixing the underlying page allocator (preferred) or doing vm games > as I suggested below. Large non-fragmented packets are a totally different problem, and there are various ways to handle them. Almost _all_ the ways are 100% preferable to stupid VM games. Just off the top of my head I'll give you two totally different approaches which both work fine and avoid the VM games: - simple approach: Have the driver have a internal buffer of say 10-20 full packets worth. If you are using HIPPI and expect to have good performance, you can easily spare one megabyte of RAM just for temporary network packets. If the system cannot keep up and empty the (shortish) packet queue quickly enough we start dropping packets, but we have to do that at some point anyway. - slightly more comple approach: Have the driver create <4kB fragments and make a linked list of them. This is essentially the same as the VM approach, except we do it in software, which is going to be a lot simpler. We may require that the headers be completely in the first packet, but that isn't going to be much of a problem. The advantage of the slightly more complex approach is that if it is done right we can essentially use the same linked list code for _real_ fragmented packets as for "pseudo-fragmented" packets that are just the side effect of memory management. That way we could handle real fragments without coalescing them at all (except for maybe coalescing the first few really small fragments to make sure we have the headers intact). People who think that VM games are faster than a simple linked list need to go out and do the math - it is infinitely more desirable to do the memory management by hand both from a flexibility AND a speed standpoint. Linus ************** Re: kernel > 2.1.36 & nfs David S. Miller (davem@jenolan.rutgers.edu) Tue, 3 Jun 1997 19:54:31 -0400 Messages sorted by: [ date ][ thread ][ subject ][ author ] Next message: Linus Torvalds: "Re: kernel > 2.1.36 & nfs" Previous message: Philip Gladstone: "linux-pre2.0.31" Maybe in reply to: Steven N. Hirsch: "kernel > 2.1.36 & nfs" Date: Tue, 3 Jun 1997 16:50:55 -0700 (PDT) From: Linus Torvalds Note that this is a different VM trick from the one that uses _kernel_ virtual memory to actually make the packet look contiguous in kernel memory even though we only allocate one page at a time. Alan was advocating something that approaches "vmalloc()" (not quite, but it had some of the same properties), and that I'm dead set against. Oh, ok, Alan that's a stupid idea, listen to pinhead ;-) While I'm at it, I will advocate that using a chaining mechanim that might even look something like BSD MBUF chains, but _ONLY_ for > PAGE_SIZE MTU's devices, makes a _lot_ of sense. For < PAGE_SIZE MTU'd devices (ie. ethernet) it makes no sense and that is why we should continue to do what we do now for them. Except of course when a huge fragmented thing comes in, then the frag code builds the chains and passes them up as if this was some huge packet coming from a >PAGE_SIZE MTU'd device, the upper layers do not even need to know the difference. ---------------------------------------------//// Yow! 11.26 MB/s remote host TCP bandwidth & //// 199 usec remote TCP latency over 100Mb/s //// ethernet. Beat that! //// -----------------------------------------////__________ o David S. Miller, davem@caip.rutgers.edu /_____________/ / // /_/ >< ****************** Re: kernel > 2.1.36 & nfs David S. Miller (davem@jenolan.rutgers.edu) Tue, 3 Jun 1997 19:43:56 -0400 Messages sorted by: [ date ][ thread ][ subject ][ author ] Next message: David S. Miller: "Re: Non-Executable Stack Patch" Previous message: Andi Gutmans: "Non-Executable Stack Patch" Maybe in reply to: Steven N. Hirsch: "kernel > 2.1.36 & nfs" Next in thread: Linus Torvalds: "Re: kernel > 2.1.36 & nfs" Date: Tue, 3 Jun 1997 16:04:11 -0700 (PDT) From: Linus Torvalds People who think that VM games are faster than a simple linked list need to go out and do the math - it is infinitely more desirable to do the memory management by hand both from a flexibility AND a speed standpoint. I don't think they're needed to give the card memory for incoming frames. Nearly all such cards allow you to feed them a linked list of buffers which typically look like this: buffer 0 HIPPI + IP + TCP headers buffer 1 First page of data buffer 2 Second page of data buffer 3 etc... Typically the buffer 0 stuff is allocated from a SLAB cache of some sort, or something like this, so the header buffer is allocated quickly and in a cache friendly manner (one thing here is that we know these cache lines will be pulled around between the DMA controller and the CPU L2 cache, so when we miss we want to only need to bring in the minimum number of cache lines, SLAB can lay things out so that this is in fact the case). The VM tricks _are_ necessary for allowing the non-touching movement of those pages to/from userspace and the controller (or the page cache and the controller). I think VM tricks is too strong a phrase, it just requires a mechanism to pin down pages. This essentially means: 1) Blast all mappings of this page from userspace, or mark them COW. 2) Mark the page for exclusive access by us until the networking is done with the page 3) When networking is done, unpin the page and unCOW the page in user mappings if they have not tried to write to it (and thus now have a private copy) already And then you have other schemes, such as under IRIX, where they use 64k page sizes on the larger systems to make this all even faster. ---------------------------------------------//// Yow! 11.26 MB/s remote host TCP bandwidth & //// 199 usec remote TCP latency over 100Mb/s //// ethernet. Beat that! //// -----------------------------------------////__________ o David S. Miller, davem@caip.rutgers.edu /_____________/ / // /_/ >< ****************** -- ________________________________________________________________________ T i m o t h y W a t s o n tmwatson@umich.edu __/| Something there is that doesn't love a wall, that wants it down