Linux-Development-Sys Digest #338, Volume #8 Mon, 11 Dec 00 13:13:08 EST
Contents:
sorting apache access_log ("Stone")
Re: IPv5 follow-up: OOPS, never mind (Marc SCHAEFER)
Re: What is the command to . . . ? (Sebastian Hans)
Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for (Maciej
Golebiewski)
Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for (Maciej
Golebiewski)
Re: Compile NIC driver? (Tjeerd Mulder)
Re: What is the command to . . . ? (Josef Moellers)
Re: Uninstall Linux SuSE 7.0 ("�迬��")
Re: What is the command to . . . ? ([EMAIL PROTECTED])
Re: are the header file and compiler problems fixed yet in RedHat 7.0?
([EMAIL PROTECTED])
How to optimize the Kernel-Compile (Robert Resch)
Re: ppp to NT RAS server (Clifford Kite)
Re: How to optimize the Kernel-Compile ([EMAIL PROTECTED])
Re: A faster memcpy and bzero for x86 (Robert Krawitz)
how to use raw device ("Marty")
Re: c++ in linux kernel (c++ exceptions) (Kaz Kylheku)
Re: What is the command to . . . ? (Kaz Kylheku)
----------------------------------------------------------------------------
From: "Stone" <[EMAIL PROTECTED]>
Subject: sorting apache access_log
Date: Mon, 11 Dec 2000 11:28:10 +0100
I got 3 clusternodes that log to diffrent access_log files.
What I need to do is to
cat access_log_1 access_log_2 accesss_log_3 | sort ..... > access_log
In c code. I'm did in shell like above (slow). Switched to perl (little
better) but now need to write it all in c.
Do anyone have any pointers to source of have examples?
Thank you in advace!
// Stone
------------------------------
From: Marc SCHAEFER <[EMAIL PROTECTED]>
Subject: Re: IPv5 follow-up: OOPS, never mind
Date: 11 Dec 2000 07:12:12 GMT
[EMAIL PROTECTED] wrote:
: OOPS! never mind, it is this little-endian-bitfield thing. I am
: sorry, I should have checked the layout of struct iphdr
Don't worry. Microsoft for example has used the TCP sequence number
in a little endian way for years without noticing: incrementing
by a big number instead of the BSD 4 (I think).
Still made its TCP/IP stack vulnerable to sequence-number-guessing, though.
------------------------------
From: Sebastian Hans <[EMAIL PROTECTED]>
Crossposted-To:
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: Re: What is the command to . . . ?
Date: Mon, 11 Dec 2000 13:34:30 +0100
Josef Moellers wrote:
>
> Allen Wong wrote:
> >
> > In alt.os.linux.slackware Markus Amersdorfer <[EMAIL PROTECTED]> wrote:
> > > [EMAIL PROTECTED] wrote:
>
> > > find . -name '*.txt' -exec grep "Hello World" {} \;
> >
> > This works, but it's alot slower than "find . -type f -name '*.txt' -print |
> > xargs grep "Hello World".
>
> These solutions won't tell where they found the match.
> Markus' solution can be enhanced to do that:
> find . -name '*.txt' -exec grep "Hello World" {} \; -print
But this will always print the filename, even if the string is not found
in the file.
seb
--
-------------------=====#####OOOOOOOO#####=====----c---c----------
sebastian hans - [EMAIL PROTECTED] `\O/' don't panic
student of comp sci - technical university of munich \-^-/ ...just RUN
i'm a .signature virus! copy me into your ~/.signature to help me spread
------------------------------
From: Maciej Golebiewski <[EMAIL PROTECTED]>
Subject: Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for
Date: Mon, 11 Dec 2000 13:47:35 +0100
Boris Gjenero wrote:
>
> Maciej Golebiewski wrote:
> > Boris, can you share the source for your optimizations? I have code
> > which could benefit from such optimizations (and the concerns expressed
> > by others in this thread do not apply in my case, as all the apps
> > that are going to use will use FPU anyway).
> >
> > Thanks in advance,
> >
> > Maciej
>
> Well, take a look at:
> http://www.mnsi.net/~bgjenero/memcpy/memcpy.c
>
> That has a bunch of versions I was playing with. The best memcpy is
> f3memcpy and the best bzero is f2bzero.
Thanks a lot. I compared (on PIII and PIII Xeon) the copy functions from
your program with the one in libc. "Intel memcpy" imemcpy and f3memcpy
are the fastest for short buffers (below 1K). Then, libc memcpy and imemcpy
have the same performance while all other functions including f3memcpy are
much
slower. fmemcpy and f2memcpy are more than 2 times slower than libc memcpy
and imemcpy. All measurements were for aligned buffers.
Compiled with gcc version 2.95.2 19991024 and
GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version 2.9.5.0.22.
Options: -O3 -mcpu=i686 -march=i686
Maciej
------------------------------
From: Maciej Golebiewski <[EMAIL PROTECTED]>
Subject: Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for
Date: Mon, 11 Dec 2000 14:03:13 +0100
Ken Whaley wrote:
> Intel has a 30-day free evaluation program for their compiler.
> $400 bucks retail. Runs only on m$.
Well, this doesn't solve my problem. Only the administration/mgmt runs
on windoze here.
> You could try checking current development versions of binutils and
> gcc (as opposed to the "stable" version), they may support SSE.
I upgraded binutils to somewhat relatively newer version. This time
it recognized the mnemonics but still refused to compile:
simd_copy.s:47: Error: suffix or operands invalid for `movups'
and the line 47 was:
movups (%esi),%mm0 # get 16-bytes of source
The Intel paper had an example of code for the Linux kernel
so I thought they used the "regular" compiler.
Maybe they have ported their compiler to Linux, but use it only internally
and do not release it? The paper is almost a year old, so even if they
were using a dev. snapshot then, I thought it should have made into the stable
version since then...
> > (and the concerns expressed
> > by others in this thread do not apply in my case, as all the apps
> > that are going to use will use FPU anyway).
> If you are using MMX and floating point simultaneously, you will suffer
> some performance loss when switching between the two. SSE uses
> different registers, so you can mix floating point and SSE w/no performance
> problems.
As far as I know none of those applications use MMX, but they all make use
of FPU.
Oh well, thanks for the info anyway.
Maciej
------------------------------
From: Tjeerd Mulder <[EMAIL PROTECTED]>
Subject: Re: Compile NIC driver?
Date: Mon, 11 Dec 2000 14:02:57 +0100
I assume this is the same as the Western Digital WD 8013 card. The driver is in the
kernel, wd.o. And it was about the first network driver in linux. No need to compile
anything.
> >My network card is an old SMC 8013 EWC (ISA). SMC has a generic Linux
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To:
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: Re: What is the command to . . . ?
Date: Mon, 11 Dec 2000 14:07:43 +0100
Sebastian Hans wrote:
> =
> Josef Moellers wrote:
[ ... ]
> > These solutions won't tell where they found the match.
> > Markus' solution can be enhanced to do that:
> > find . -name '*.txt' -exec grep "Hello World" {} \; -print
> =
> But this will always print the filename, even if the string is not foun=
d
> in the file.
No, it will not. The three items (terms?)
-name '*.txt'
-exec grep "Hello World" {} \;
-print
are implicitly connected by -a (and) operators and short-circuited.
Thus grep will only be exec-ed if the name matches '*.txt' and the name
will only be print-ed if the grep is exec-ed and returns "true" (i.e.
exits with 0) which it only does if matches were found.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: "�迬��" <[EMAIL PROTECTED]>
Subject: Re: Uninstall Linux SuSE 7.0
Date: Mon, 11 Dec 2000 23:03:48 +0900
"Paul" <[EMAIL PROTECTED]> wrote in message
news:90tf0o$3c7$[EMAIL PROTECTED]...
> I have Linux 7.0 SuSE installed on a separate harddisk. My other disk is a
> Windows ME disk.
>
> Now i want to uninstall Linux..... My Windows harddisk cannot see the
Linux
> disk...
>
> What procedure should I follow????????????
>
>
> Please HELP HELP.....
>
>
>
>
first, you log in linux,
and delete partition.
you can see that partition.
if you install lilo,
you can delete in ms-dos prompt
c:> fdisk /mbr
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To:
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: Re: What is the command to . . . ?
Date: Mon, 11 Dec 2000 14:19:46 GMT
On Mon, 11 Dec 2000 04:30:09 GMT, [EMAIL PROTECTED] wrote:
>I am looking for the command that will help me compare two directory
>structures.
>
>I just did a file copy to an NFS drive and I want to make sure that I
>got everything.
>
>I used
>cp -axv /dev /mnt/vol00
>cp -axv /bin /mnt/vol00
>cp -axv/usr /mnt/vol00
>etc . . .
>
>Doing some sampling, it appears that everything copied okay.
>
>What I am looking for is the equivalent to this
>dos command: dir *.* /s
The diff command will compare two directory structures, recursively.
Gord
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: are the header file and compiler problems fixed yet in RedHat 7.0?
Date: Mon, 11 Dec 2000 14:58:36 GMT
Nix <$}xinix{[email protected]> wrote:
> On Sat, 09 Dec 2000, [EMAIL PROTECTED] gibbered:
>> I heard that the C header files and compiler were somehow inconsistent
>> in redhat 7.0.
> You heard wrong. The C library and compiler are both unstable
> development versions, but they should work with each other (for certain
> values of `work'.)
Installing the updates installs a released version of glibc. There is,
alas, no update for gcc since there hasn't been a released version
higher than the snapshot.
As far as I know, the only problem with gcc is the difference in
name-mangling with released versions and the inability to compile the
kernel. Arguably, neither is much of an issue as C++ specifies nothing
about name-mangling and the kernel uses more than one compiler
extension.
It's unfortunate that you're sort of lost in space with RH right now,
particuarly for commercial products. On the other hand, I think I
could actually get to like the idea of a seperate kgcc package, having
been shot in the foot by the kernel once or twice before.
--
Matt Gauthier <[EMAIL PROTECTED]>
------------------------------
From: Robert Resch <[EMAIL PROTECTED]>
Subject: How to optimize the Kernel-Compile
Date: Mon, 11 Dec 2000 17:19:02 +0100
Hi!
I want to use a 486 DX-2-66 as a router. For a little more performance i
want to compile the Kernel for 486.
I've modified all Makefile 's from '-O2' to '-O9 -march=i486 -mcpu=i486'
but the kernel doesn't start.
What modification options can be used in a 2.2.17 Kernel?
Robert
------------------------------
From: Clifford Kite <[EMAIL PROTECTED]>
Subject: Re: ppp to NT RAS server
Date: Mon, 11 Dec 2000 10:51:59 -0600
Andy <[EMAIL PROTECTED]> wrote:
> I need help to login from linux to a NT RAS server.
> I keep getting E-691 PAP authroization fail.
> The RAS server expect the domain\user, but my linux box seems just
> sends the user.
Wrong newgroup. Repost this on comp.os.linux.networking.
In the meanwhile read the file README.MSCHAP80 in the top level
directory of the pppd source tree.
--
Clifford Kite <kite@inet%port.com> Not a guru. (tm)
/* When men do not regard govenmental measures as just and right
they will find a way around them. The effects extend beyond
the source, generate widespread disrespect for the law, and
promote corruption and violence. -Milton Friedman */
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: How to optimize the Kernel-Compile
Date: Mon, 11 Dec 2000 16:36:45 GMT
Robert Resch <[EMAIL PROTECTED]> wrote:
> I want to use a 486 DX-2-66 as a router. For a little more performance i
> want to compile the Kernel for 486.
> I've modified all Makefile 's from '-O2' to '-O9 -march=i486 -mcpu=i486'
> but the kernel doesn't start.
> What modification options can be used in a 2.2.17 Kernel?
There is, in fact, an option to select the cpu type in 'make config'
(or whatever configuration target you used).
--
Matt Gauthier <[EMAIL PROTECTED]>
------------------------------
From: Robert Krawitz <[EMAIL PROTECTED]>
Subject: Re: A faster memcpy and bzero for x86
Date: 11 Dec 2000 12:27:57 -0500
Robert Redelmeier <[EMAIL PROTECTED]> writes:
> Robert Krawitz wrote:
> >
> > Actually, my experience was that by using a somewhat funky pattern of
> > loads, the performance improvement was substantially more --
> > throughput went from 21 MB/sec to 37 MB/sec or so. Without the funky
> > load pattern, it was more like 28 MB/sec. Cache effects and all that.
>
> These are low numbers even to main memory on a P5 (EDO RAM) system.
> Usually REP MOVSD will get ~36 MB/s, and FILD/FISTP ~42. Of course,
> straight 32-bit integer moves are slower, especially on these CPUs.
> Are you sure you weren't using these rather than repeat-string moves?
This was a first generation (I don't count the P5-60/66) P90 with FP
DRAM and the old Neptune chipset, not EDO. BTW, straight integer
moves weren't slower than REP MOVSD if you used 4 registers; indeed,
it was a bit faster.
> > Except, of course, when it isn't. Even on a Pentium II, the FPU gives
> > a slight performance boost.
>
> Not that I've been able to measure compared to REP MOVSD. But
> quite FP is quite likely better than ordinary 32 bit MOV's.
The difference was quite small, on the order of 1-2%.
--
Robert Krawitz <[EMAIL PROTECTED]> http://www.tiac.net/users/rlk/
Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail [EMAIL PROTECTED]
Project lead for The Gimp Print -- http://gimp-print.sourceforge.net
"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
------------------------------
From: "Marty" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,linux.dev.kernel
Subject: how to use raw device
Date: Tue, 12 Dec 2000 01:07:25 +0800
I would like to ask how to use the raw device to read/write ???
I have used the raw function on a SCSI hard disk like this : raw
/dev/raw/raw1 /dev/sda1
then, how do I issue read/write call on this raw device?
I have tried to issue the conventional system call open and read but failed.
fd = open("/dev/raw/raw1", O_RDONLY);
read(fd, buf, 4096);
what is the correct way to read/write ???
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: c++ in linux kernel (c++ exceptions)
Reply-To: [EMAIL PROTECTED]
Date: Mon, 11 Dec 2000 17:52:27 GMT
On Mon, 11 Dec 2000 09:50:26 +0100, O.Petzold <[EMAIL PROTECTED]> wrote:
>Hello,
>
>this is related to one of the last thread "c++ in kernel and linker
>problems".
>Over teh weekend I studied the libstdc++/gcc sources. There are some
>startup
>code for calling dtors (__do_global_Xtors_aux) and for stack unwinding
Don't bother trying to use global constructors or destructors. There is no
provision in the module loading and unloading mechanism to have these called.
>on exceptions (__XXregister_frame_info) at gcc.
>Well, from this side here I could use g++ and exceptions inside kernel
>but,
>there are the terminate function from glibc, which is needed by
>libstdc++.
>This would be one of the bigger problem. How can I terminate a module?
An unhandled exception is a serious problem in a C++ program. In the kernel,
right thing to do would be to call panic() to bring the whole thing down,
sicne the default response in hosted C++ is to terminate the program abnormally
when there is an unhandled exception.
A kernel module is not like a process. It's just a piece of code that is
loaded into the kernel. You can't just terminate it the way you kill a process.
In order to remove a module, you must ensure that it's no longer in use, which
means that there are no more dynamic resources associated with it and that it's
not registered anywhere to be called. If it has resources, they will be leaked.
If it's still registered somewhere, then the call will blow up when the code is
no longer present.
>The best solution would be the call all destructors and "auto
>cleanup_module"
>for this imo. Or are here better solutions (maybee I'm wrong ?).
The better solution is to avoid declaring any objects at file scope so that you
don't need global constructors. Allocate everything you need dynamically.
You can also use placement new to explicitly call the constructors of any
file scope objects. Another solution may be to declare them within functions;
code emitted by g++ constructs static objects within a statement block
the first time that block is executed. But watch it: this mechanism isn't
thread safe; it's based on testing a hidden flag. It should be okay if you do
it inside the function init_module(). Then set some globally visible pointers
to refer to these objects. In cleanup_module() you can call their destructors
explicitly using the standard C++ syntax for doing that.
>The next is the .init section of user space programms. Is there for
>kernel space
>as well? What did I have forgotten ????
You have forgotten that the kernel is written using C, and that any support
for other languages is something you have to roll yourself.
>Porting code the other problem, but without exceptions, porting is very
>heavy.
Why did you write, in C++ with exceptions, code that is targetted at operating
systems? What environments do you expect this to port to? One must be
conservative when doing embedded work, not rely on the latest gadgets. If you
want maximum portability, write it in C.
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To:
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: Re: What is the command to . . . ?
Reply-To: [EMAIL PROTECTED]
Date: Mon, 11 Dec 2000 17:58:50 GMT
On Mon, 11 Dec 2000 08:15:34 +0100, Josef Moellers
<[EMAIL PROTECTED]> wrote:
>Allen Wong wrote:
>>
>> In alt.os.linux.slackware Markus Amersdorfer <[EMAIL PROTECTED]> wrote:
>> > [EMAIL PROTECTED] wrote:
>
>> > find . -name '*.txt' -exec grep "Hello World" {} \;
>>
>> This works, but it's alot slower than "find . -type f -name '*.txt' -print |
>> xargs grep "Hello World".
>
>These solutions won't tell where they found the match.
>Markus' solution can be enhanced to do that:
> find . -name '*.txt' -exec grep "Hello World" {} \; -print
So can the other one:
... xargs grep --with-filename "Hello World"
or, more portably:
... xargs grep /dev/null "Hello World"
Note that exec'ing grep for each file may be a lot slower compared to using
xargs to build up a long argument list to pass to one grep instance.
------------------------------
** 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 by posting to the
comp.os.linux.development.system newsgroup.
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
******************************