RE: Vinum RAID-5 performance problem

2000-09-08 Thread Brandon Gale

Note*  rawio will overwrite your data, so be careful!

Here are tests that I ran using a 4 disk array (10k RPM SCSI disks).  I have
about 20 datafiles comprising 8 different stripe sizes for 3 different raid
configurations (0,5,1+0) if anyone is interested (Greg?).

Thanks,

brandon

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Greg Lehey
> Sent: Friday, September 08, 2000 10:03 PM
> To: Esko Petteri Matinsola; Clark Shishido
> Cc: [EMAIL PROTECTED]
> Subject: Re: Vinum RAID-5 performance problem
>
>
> On Friday,  8 September 2000 at 22:24:51 +0300, Esko Petteri
> Matinsola wrote:
> > Thank you for your last reply about the Promise 100 controller, I got it
> > working with that patch.
> >
> > But now, I have Asus P2L97 mobo with 64MB RAM, 266MHz P2 and 4 Maxtor
> > 54098H8's, two per channel. OS is FreeBSD 4.1-STABLE.
> >
> > When I use vinum with the following config:
> >
> > drive drive0 device /dev/ad0e
> > drive drive1 device /dev/ad1e
> > drive drive2 device /dev/ad2e
> > drive drive3 device /dev/ad3e
> >
> >
> > volume raid0
> > plex org striped 256k
> > sd length 512m drive drive0
> > sd length 512m drive drive1
> >
> >
> > so I have RAID-0 with the master and slave drive from controller one.
> > bonnie -s 512 on that gives me:
> >
> >
> > ---Sequential Output ---Sequential Input-- --Random--
> > -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
> >  MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
> > 512 13287 97.3 20237 41.0  8023 25.6  8572 97.8 21442 29.4 128.1  2.2
>
> Please don't use bonnie.  It's not measuring what you think it is.
>
> > not bad, even when two drives on the same controller. Next, I
> tried vinum
> > with the following config:
> >
> > drive drive0 device /dev/ad0e
> > drive drive1 device /dev/ad1e
> > drive drive2 device /dev/ad2e
> > drive drive3 device /dev/ad3e
> >
> > volume raid0
> > plex org striped 256k
> > sd length 512m drive drive0
> > sd length 512m drive drive2
> >
> > so I have RAID-0 with the masters from both controllers. bonnie -s 512
> > gives me:
> >
> > ---Sequential Output ---Sequential Input-- --Random--
> > -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
> >  MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
> > 512 13263 97.4 21340 43.7  8169 26.1  8572 98.0 25858 36.6 213.4  3.9
> >
> > only a little better, except the seeks.
>
> Of course.  The seeks are the only thing which relate to real-life
> performance.  Look at the sequential character output, for example.
> It's showing clearly that the bottleneck is the CPU, not the storage
> subsystem.  In block writes, the real-world performance of the first
> configuration is in fact worse than what you see there, but since
> bonnie is only writing one file at a time, you don't run into any
> contention problems.  You should be using rawio, which will show you
> what the storage system is doing.
>
> > Now next to my problem. When I use vinum with the following config:
> >
> > drive drive0 device /dev/ad0e
> > drive drive1 device /dev/ad1e
> > drive drive2 device /dev/ad2e
> > drive drive3 device /dev/ad3e
> >
> > volume raid5
> > plex org raid5 256k
> > sd length 512m drive drive0
> > sd length 512m drive drive1
> > sd length 512m drive drive2
> > sd length 512m drive drive3
> >
> >
> > so I have RAID-5 with all the drives from both controllers.
> bonnie -s 512
> > gives me:
> >
> >
> > ---Sequential Output ---Sequential Input-- --Random--
> > -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
> >  MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
> > 512  2368 17.7  2358  4.8  2016  6.6  8218 94.4 20068 29.1 232.5  4.3
> >
> > read performance and seeks seems OK, but block writes only about 1/9th !
> > As I read from www.vinumvm.org I should get something like 5MBps block
> > writes.
>
> I don't know how you'd find anything at vinumvm.org which tells you
> what to expect from bonnie.
>
> > Have I misunderstood something, configured someting improperly, it's
> > because of only two IDE-controllers or why I get so lousy write
> > performance ?
>
> Well, firstly I don't know what your write performance is.  It really
> depends on what you're trying to do.  But yes, having only two
> controllers will halve your RAID-5 write performance.  Note also that
> with a 256 kB stripe, you'll run into drive contention problems
> because all your superblocks will be on the same subdisk.  Take a size
> like 273 kB, for example.
>
> > I could live with 5MBps, if I only could get that ! :)
>
> I'd expect the performance to increase by about 50% or 60% if you use
> four controllers.
>
> On Friday,  8 September 2000 at 12:55:51 -0700, Clark Shishido wrote:
> >

Re: Vinum RAID-5 performance problem

2000-09-08 Thread Greg Lehey

On Friday,  8 September 2000 at 22:24:51 +0300, Esko Petteri Matinsola wrote:
> Thank you for your last reply about the Promise 100 controller, I got it
> working with that patch.
>
> But now, I have Asus P2L97 mobo with 64MB RAM, 266MHz P2 and 4 Maxtor
> 54098H8's, two per channel. OS is FreeBSD 4.1-STABLE.
>
> When I use vinum with the following config:
>
> drive drive0 device /dev/ad0e
> drive drive1 device /dev/ad1e
> drive drive2 device /dev/ad2e
> drive drive3 device /dev/ad3e
>
>
> volume raid0
> plex org striped 256k
> sd length 512m drive drive0
> sd length 512m drive drive1
>
>
> so I have RAID-0 with the master and slave drive from controller one.
> bonnie -s 512 on that gives me:
>
>
> ---Sequential Output ---Sequential Input-- --Random--
> -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
>  MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
> 512 13287 97.3 20237 41.0  8023 25.6  8572 97.8 21442 29.4 128.1  2.2

Please don't use bonnie.  It's not measuring what you think it is.

> not bad, even when two drives on the same controller. Next, I tried vinum
> with the following config:
>
> drive drive0 device /dev/ad0e
> drive drive1 device /dev/ad1e
> drive drive2 device /dev/ad2e
> drive drive3 device /dev/ad3e
>
> volume raid0
> plex org striped 256k
> sd length 512m drive drive0
> sd length 512m drive drive2
>
> so I have RAID-0 with the masters from both controllers. bonnie -s 512
> gives me:
>
> ---Sequential Output ---Sequential Input-- --Random--
> -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
>  MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
> 512 13263 97.4 21340 43.7  8169 26.1  8572 98.0 25858 36.6 213.4  3.9
>
> only a little better, except the seeks. 

Of course.  The seeks are the only thing which relate to real-life
performance.  Look at the sequential character output, for example.
It's showing clearly that the bottleneck is the CPU, not the storage
subsystem.  In block writes, the real-world performance of the first
configuration is in fact worse than what you see there, but since
bonnie is only writing one file at a time, you don't run into any
contention problems.  You should be using rawio, which will show you
what the storage system is doing.

> Now next to my problem. When I use vinum with the following config:
>
> drive drive0 device /dev/ad0e
> drive drive1 device /dev/ad1e
> drive drive2 device /dev/ad2e
> drive drive3 device /dev/ad3e
>
> volume raid5
> plex org raid5 256k
> sd length 512m drive drive0
> sd length 512m drive drive1
> sd length 512m drive drive2
> sd length 512m drive drive3
>
>
> so I have RAID-5 with all the drives from both controllers. bonnie -s 512
> gives me:
>
>
> ---Sequential Output ---Sequential Input-- --Random--
> -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
>  MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
> 512  2368 17.7  2358  4.8  2016  6.6  8218 94.4 20068 29.1 232.5  4.3
>
> read performance and seeks seems OK, but block writes only about 1/9th !
> As I read from www.vinumvm.org I should get something like 5MBps block
> writes.

I don't know how you'd find anything at vinumvm.org which tells you
what to expect from bonnie.

> Have I misunderstood something, configured someting improperly, it's
> because of only two IDE-controllers or why I get so lousy write
> performance ?

Well, firstly I don't know what your write performance is.  It really
depends on what you're trying to do.  But yes, having only two
controllers will halve your RAID-5 write performance.  Note also that
with a 256 kB stripe, you'll run into drive contention problems
because all your superblocks will be on the same subdisk.  Take a size
like 273 kB, for example.

> I could live with 5MBps, if I only could get that ! :)

I'd expect the performance to increase by about 50% or 60% if you use
four controllers.

On Friday,  8 September 2000 at 12:55:51 -0700, Clark Shishido wrote:
> At 22:24 +0300 2000.09.08, Esko Petteri Matinsola wrote:
>>
>> read performance and seeks seems OK, but block writes only about 1/9th !
>> As I read from www.vinumvm.org I should get something like 5MBps block
>> writes.
>>
>> Have I misunderstood something, configured someting improperly, it's
>> because of only two IDE-controllers or why I get so lousy write
>> performance ?
>
> Your configuration looks fine.

Well, using master and slave together isn't fine in my book.

> I just recently tried a similar setup using Promise Ultra66 controllers
> with some Quantum and IBM drives (tried both). I got lousy performance
> doing sustained writes to a RAID5 volume, using 4 UDMA66 drives each a
> master on a controller. just doing a cat /dev/zero > blah
>
> I just decided 

Re: makecontext & friends ?

2000-09-08 Thread Ralf S. Engelschall


In article <[EMAIL PROTECTED]> you wrote:
> On Fri, 8 Sep 2000, Ralf S. Engelschall wrote:
>> 
>> In article <[EMAIL PROTECTED]> you wrote:
>> 
>> > are there any plans to implement makecontext() & friends
>> > functions in FreeBSD? 
>> 
>> I don't know of any plans myself, but I would appreciate that we support this
>> standardized ucontext(3) API in FreeBSD. The API is actually not the problem,
>> the question is on what should this API internally be based? On an own
>> mechanism or on an existing mechanism (jmp_buf, etc)?
> 
> My implementation of it was based on a trapframe, so it would be
> easy to pass a ucontext_t to the kernel and have it switch to
> the context at appropriate times (scheduler activations).  A
> trapframe is the same as a sigcontext_t (ucontext_t) for i386
> but not for the alpha.  I think I got around this by adding a
> type field to the ucontext (or mcontext) to indicate which
> format it was for alpha.

Sounds good -- where can I find a copy of your implementation?
I would like to look at it in more detail.

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Shared Memory Issues

2000-09-08 Thread void

On Fri, Sep 08, 2000 at 02:56:10PM +0100, John Toon wrote:
> 
> However, it seems strange that you're getting non-attached memory
> segments. Surely it is the job of the kernel to clean up after processes
> (if they're badly programmed and don't do it themselves)? Perhaps one
> program is leaking? 

SysV shared memory segments are defined to stick around until some
appropriately-privileged user process deletes them.

I was thinking recently that it might be nice to extend that API so a
process creating such a segment could ask the kernel to reference-count
it and delete it if the refcount goes to zero, but any app that wants
that behavior can just use mmap() anyway, which has the advantage of
being portable.
 
-- 
 Ben

220 go.ahead.make.my.day ESMTP Postfix


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Vinum RAID-5 performance problem

2000-09-08 Thread Clark Shishido

At 22:24 +0300 2000.09.08, Esko Petteri Matinsola wrote:
>
>read performance and seeks seems OK, but block writes only about 1/9th !
>As I read from www.vinumvm.org I should get something like 5MBps block
>writes.
>
>Have I misunderstood something, configured someting improperly, it's
>because of only two IDE-controllers or why I get so lousy write
>performance ?

Your configuration looks fine.

I just recently tried a similar setup using Promise Ultra66 controllers
with some Quantum and IBM drives (tried both). I got lousy performance
doing sustained writes to a RAID5 volume, using 4 UDMA66 drives each a
master on a controller. just doing a cat /dev/zero > blah

I just decided to stick with striping and make regular backups.
I may try vinum with RAID5 on a SCSI array later. 

FWIW,
FreeBSD 4.1-STABLE
Abit BP6 dual 466 Celerons 
  (not using the HPT controller)
Promise Ultra66
Quantum KA 13.6 gig and IBM Deskstar 30 gig drives

--clark



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Creating a list of newbus devices.

2000-09-08 Thread Mike Smith


> Is it possible from kernel mode to create a list of newbus devices ? And
> how do I'll get a pointer to the new-bus root (or whatever it's tecnical
> name is :)


extern devclass_t nexus_devclass;

nexus = devclass_get_device(nexus_devclass, 0);

static void
device_enumerate_children(device_t dev)
{
device_t*devp;
int ndevs, i;

if (device_get_children(dev, &devp, &ndevs) || (ndevs == 0))
return;
for (i = 0; i < ndevs; i++, devp++)
device_enumerate_children(*devp);
}

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: md5 in boot loader

2000-09-08 Thread Mike Smith

> Hello,
>   What about md5 in the boot loader.  I've included a patch to
> src/sys/boot/ficl/words.c  No doubt with lots of little errors.  I
> added this after concerns while working on PXE booting.
>   I'm looking for a sense of direction...  Is using MD5 better
> than just a clear text password or am I wasting my time adding a
> roll-bar to a little red wagon?

It's not enough.  If you're concerned about diskless booting (a good 
thing to worry about), you want to look at BIS (bootstrap integrity 
services) which interacts with PXE and should address most of your 
concerns.  (Making it work will involve some code, mostly on the server 
side.  If you're interested in getting involved in the PXE deal in 
general, there are several openings for some useful work to be done...

>   --Mat
> 
> bash-2.03# ./testmain
> ficl Version 2.03
> Sep  7 2000
> 32 allocate drop dup s" asd" rot md5 32 cr type cr
> 
> 7815696ecbf1c96e6894b779456d330e
> ok> 
> bash-2.03# md5 -s "asd"
> MD5 ("asd") = 7815696ecbf1c96e6894b779456d330e
> bash-2.03#
> 
> 
> --- words.c   Mon Jun 12 12:46:28 2000
> +++ words-md5.c   Thu Sep  7 23:01:35 2000
> @@ -17,6 +17,7 @@
>  #else
>  #include 
>  #endif
> +#include 
>  #include 
>  #include "ficl.h"
>  #include "math64.h"
> @@ -1207,7 +1208,33 @@
>  return;
>  }
>  
> -
> +/*  
> +** md5 ( s-addr slen d-addr -- )
> +** calculate md5 hash of s-addr, stores in d-addr which must be at least 
> +** 32 bytes longs. 
> +*/
> +static void md5(FICL_VM *pVM)
> +{
> + STRINGINFO si2;
> + STRINGINFO si1;
> + MD5_CTX ctx;
> + static const char hex[]="0123456789abcdef";
> + unsigned char final[16]; 
> + int i;
> +
> + SI_SETPTR(si1, stackPopPtr(pVM->pStack));
> + SI_SETLEN(si2, stackPopUNS(pVM->pStack));
> + SI_SETPTR(si2, stackPopPtr(pVM->pStack));
> + MD5Init(&ctx);
> + MD5Update(&ctx, si2.cp, si2.count);
> + MD5Final(final,&ctx);
> + for(i=0; i<16; i++) {
> +  si1.cp[i+i] = hex[final[i] >> 4];
> +   si1.cp[i+i+1] = hex[final[i] & 0x0f];
> +   final[i]=0; 
> + }
> +return;
> +}
>  /**
>  i n t e r p r e t 
>  ** This is the "user interface" of a Forth. It does the following:
> @@ -4979,6 +5006,7 @@
>  dictAppendWord(dp, "forget-wid",forgetWid,  FW_DEFAULT);
>   dictAppendWord(dp, "hash",  hash,   FW_DEFAULT);
>   dictAppendWord(dp, "number?",   ficlIsNum,  FW_DEFAULT);
> + dictAppendWord(dp, "md5",   md5,FW_DEFAULT);
>  dictAppendWord(dp, "parse-word",parseNoCopy,FW_DEFAULT);
>  dictAppendWord(dp, "sliteral",  sLiteralCoIm,   FW_COMPIMMED); /* STRING */
>  dictAppendWord(dp, "wid-set-super", 
>   
> 
> -- 
> Mathew Kanner <[EMAIL PROTECTED]>,  SOCS McGill University
>Obtuse quote: He [not me] understands: "This field of perception
>is void of perception of man." -- The Quintessence of Buddhism 
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: How to stop problems from printf

2000-09-08 Thread Mike Smith

> In message <[EMAIL PROTECTED]> "John Doh!" writes:
> : Issue is must be getting format string from "untrusted" place, but want to 
> : limit substitution of %... to the substitution of say in example the 
> : argv[0], but to not do others so that say given "usage: %s filename %p" %p 
> : not interpret but to be print instead as literally so we get output of 
> : (saying to be argv[0] as test just for example) usage: test filename %p
> : 
> : any hints you have I am very greatful for.
> 
> Fix gettext to only allow N arguments in the same order that the
> original message had.

Typically you want to use positional arguments with printf so that your 
gettext responses can reorder things to get better results, but the same 
basically applies.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: How to stop problems from printf

2000-09-08 Thread Mike Smith

> Hello to you am I C coder who to wish write programs we cannot exploit via 
> code such as below.
> 
> >
> >   main(int argc, char **argv)
> >   {
> > if(argc > 1) {
> >   printf(gettext("usage: %s filename\n"),argv[0]);
> >   exit(0);
> >}
> >printf("normal execution proceeds...\n");
> >   }
> 
> Issue is must be getting format string from "untrusted" place, but want to 
> limit substitution of %... to the substitution of say in example the 
> argv[0], but to not do others so that say given "usage: %s filename %p" %p 
> not interpret but to be print instead as literally so we get output of 
> (saying to be argv[0] as test just for example) usage: test filename %p

If you don't trust gettext, you need to write a validation wrapper for it 
that compares the format specifiers in the source and destination strings.
There's no way to "fix" printf to do this.  Personally, I'd fix the 
security on your gettext database and deal with it at that level.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Vinum RAID-5 performance problem

2000-09-08 Thread Esko Petteri Matinsola

Thank you for your last reply about the Promise 100 controller, I got it
working with that patch.

But now, I have Asus P2L97 mobo with 64MB RAM, 266MHz P2 and 4 Maxtor
54098H8's, two per channel. OS is FreeBSD 4.1-STABLE.

When I use vinum with the following config:


drive drive0 device /dev/ad0e
drive drive1 device /dev/ad1e
drive drive2 device /dev/ad2e
drive drive3 device /dev/ad3e


volume raid0
plex org striped 256k
sd length 512m drive drive0
sd length 512m drive drive1


so I have RAID-0 with the master and slave drive from controller one.
bonnie -s 512 on that gives me:


---Sequential Output ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
 MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
512 13287 97.3 20237 41.0  8023 25.6  8572 97.8 21442 29.4 128.1  2.2


not bad, even when two drives on the same controller. Next, I tried vinum
with the following config:


drive drive0 device /dev/ad0e
drive drive1 device /dev/ad1e
drive drive2 device /dev/ad2e
drive drive3 device /dev/ad3e

volume raid0
plex org striped 256k
sd length 512m drive drive0
sd length 512m drive drive2


so I have RAID-0 with the masters from both controllers. bonnie -s 512
gives me:

---Sequential Output ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
 MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
512 13263 97.4 21340 43.7  8169 26.1  8572 98.0 25858 36.6 213.4  3.9


only a little better, except the seeks. Now next to my problem. When I use
vinum with the following config:


drive drive0 device /dev/ad0e
drive drive1 device /dev/ad1e
drive drive2 device /dev/ad2e
drive drive3 device /dev/ad3e

volume raid5
plex org raid5 256k
sd length 512m drive drive0
sd length 512m drive drive1
sd length 512m drive drive2
sd length 512m drive drive3


so I have RAID-5 with all the drives from both controllers. bonnie -s 512
gives me:


---Sequential Output ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
 MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
512  2368 17.7  2358  4.8  2016  6.6  8218 94.4 20068 29.1 232.5  4.3


read performance and seeks seems OK, but block writes only about 1/9th !
As I read from www.vinumvm.org I should get something like 5MBps block
writes.

Have I misunderstood something, configured someting improperly, it's
because of only two IDE-controllers or why I get so lousy write
performance ?

I could live with 5MBps, if I only could get that ! :)

Thanks for any suggestions and sorry for too long email.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New ATA tagged queuing patch available

2000-09-08 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Matthew 
Jacob writes:
>> 
>> Yeah :)
>> 
>> > Any chance an older IBM drive might be supported ?
>> > 
>> 
>> Well, the DTTA's say they support tagged queuing, but since the
>> newer DJNA has firmware problems the DTTA probably has that
>> too. To be fair I havn't tried it yet, so if you feel adventurous
>> you can try to add it to the ad_tagsupported function in ata-disk.c
>> and see what happens
>
>Gee. You can upgrade F/W in SCSI drives. How about ATA drives?

Same thing, the trick is to get the update microcode out of IBM.


--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New ATA tagged queuing patch available

2000-09-08 Thread Matthew Jacob

> 
> Yeah :)
> 
> > Any chance an older IBM drive might be supported ?
> > 
> 
> Well, the DTTA's say they support tagged queuing, but since the
> newer DJNA has firmware problems the DTTA probably has that
> too. To be fair I havn't tried it yet, so if you feel adventurous
> you can try to add it to the ad_tagsupported function in ata-disk.c
> and see what happens

Gee. You can upgrade F/W in SCSI drives. How about ATA drives?




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New ATA tagged queuing patch available

2000-09-08 Thread Soren Schmidt

It seems Thierry Herbelot wrote:
> Soren Schmidt wrote:
> > 
> > >From the README:
> > 
> > ATA-tagged-queueing-diff-0908:
> >   Add support for ATA channels with both a master and a slave, even
> >   combos where only on of them supports tagged queuing should work now.
> >   Also only switch on tagged queuing on IBM DPTA & DTLA series
> >   drives, the older DJNA has firmware problems. I am working on
> >   a SW solution to that, but for now only enable tagged queuing
> >   on drives that is known to work.
> > 
> > Get it from http://freebsd.dk, and let me know your results
> > 
> > If I dont get any serious problem reports I'll commit this
> > shortly, making FreeBSD the first OS that has tagged Queuing
> > support for ATA drives :)
> > 
> > -Søren
> 
> Nice try !

Yeah :)

> Any chance an older IBM drive might be supported ?
> 

Well, the DTTA's say they support tagged queuing, but since the
newer DJNA has firmware problems the DTTA probably has that
too. To be fair I havn't tried it yet, so if you feel adventurous
you can try to add it to the ad_tagsupported function in ata-disk.c
and see what happens

-Søren


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: New ATA tagged queuing patch available

2000-09-08 Thread Thierry Herbelot

Soren Schmidt wrote:
> 
> >From the README:
> 
> ATA-tagged-queueing-diff-0908:
>   Add support for ATA channels with both a master and a slave, even
>   combos where only on of them supports tagged queuing should work now.
>   Also only switch on tagged queuing on IBM DPTA & DTLA series
>   drives, the older DJNA has firmware problems. I am working on
>   a SW solution to that, but for now only enable tagged queuing
>   on drives that is known to work.
> 
> Get it from http://freebsd.dk, and let me know your results
> 
> If I dont get any serious problem reports I'll commit this
> shortly, making FreeBSD the first OS that has tagged Queuing
> support for ATA drives :)
> 
> -Søren

Nice try !

Any chance an older IBM drive might be supported ?


TfH

-- 
Thierry Herbelot


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: makecontext & friends ?

2000-09-08 Thread Daniel Eischen

On Fri, 8 Sep 2000, Ralf S. Engelschall wrote:
> 
> In article <[EMAIL PROTECTED]> you wrote:
> 
> > are there any plans to implement makecontext() & friends
> > functions in FreeBSD? 
> 
> I don't know of any plans myself, but I would appreciate that we support this
> standardized ucontext(3) API in FreeBSD. The API is actually not the problem,
> the question is on what should this API internally be based? On an own
> mechanism or on an existing mechanism (jmp_buf, etc)?

My implementation of it was based on a trapframe, so it would be
easy to pass a ucontext_t to the kernel and have it switch to
the context at appropriate times (scheduler activations).  A
trapframe is the same as a sigcontext_t (ucontext_t) for i386
but not for the alpha.  I think I got around this by adding a
type field to the ucontext (or mcontext) to indicate which
format it was for alpha.

-- 
Dan Eischen



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: How to stop problems from printf

2000-09-08 Thread Garance A Drosihn

At 6:27 PM -0400 9/7/00, John Doh! wrote:
>Hello to you am I C coder who to wish write programs we cannot 
>exploit via code such as below.
>
>>
>> main(int argc, char **argv)
>> {
>>   if(argc > 1) {
>> printf(gettext("usage: %s filename\n"),argv[0]);
>> exit(0);
>>  }
>>  printf("normal execution proceeds...\n");
>> }
>
>Issue is must be getting format string from "untrusted" place, but want
>to limit substitution of %... to the substitution of say in example the
>argv[0], but to not do others so that say given "usage: %s filename %p"
>%p not interpret but to be print instead as literally so we get output
>of (saying to be argv[0] as test just for example)
>usage: test filename %p

Since gettext is getting a string from an untrusted place, you should
treat it as you would treat a string being typed in from a user.

For the example you give, you know that you are expecting ONE %s
argument, and that ONE %s is the only substitution you will allow.

So, have gettext return it's value into some string.  Then, YOU search
that string for '%s'.  then you do a printf of:
printf("%s%s%s", textBefore%s, argv[0], textAfter%s);

For the given example, this is pretty trivial.  If you have several
different values you will substitute in the string returned by
gettext, then it gets a bit more cumbersome.  My suggestion is a
fine solution for your example (IMO :-), but if you did have more
substitutions then I might try some alternate strategy.

One has to be careful about buffer overflows in that temp string,
of course.


---
Garance Alistair Drosehn   =   [EMAIL PROTECTED]
Senior Systems Programmer  or  [EMAIL PROTECTED]
Rensselaer Polytechnic Institute


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: makecontext() & friends ?

2000-09-08 Thread Daniel Eischen

On Fri, 8 Sep 2000, Mitja Horvat wrote:

> Hi,
> 
> are there any plans to implement makecontext() & friends
> functions in FreeBSD? 
> 
> Is there any other way to implement user-level threads?
> (I know it can be done in assembler, but this is not 
> portable)
> 
> Using pthreads is not an option for me, although pthreads
> are implemented as userlevel threads in FreeBSD, but not
> on most other Unixes.

I have implemented {make,get,set,swap}context as library routines
for FreeBSD.  They're gathering dust somewhere and need a bit of
polishing.  If you give me some time I can dust them off and
send them to you.

-- 
Dan Eischen



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Creating a list of newbus devices.

2000-09-08 Thread Warner Losh

In message <[EMAIL PROTECTED]> Nicolai Petri writes:
: Is it possible from kernel mode to create a list of newbus devices ?
: And how do I'll get a pointer to the new-bus root (or whatever it's
: tecnical name is :)

Yes.  You keep asking for parents until you get none.  The one that
has a null parent is the nexus.  You can then walk the tree from
there.  See kern/subr_bus.c for the routines to do this, and read the
assocaited man pages.

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



How many -k's does a build need?

2000-09-08 Thread Jaye Mathisen



Just noticed this little oddity while building XFree86-4, from ports
supped today:

make -k -f xmakefile all
root   17383  0.0  0.2   628  244  p6  I+6:30AM   0:00.00  (sh)
root   36617  0.0  0.5  1076  680  p6  I+6:51AM   0:00.05 make -k -k
CDEBUGFLAGS= all
root   36618  0.0  0.2   628  244  p6  I+6:51AM   0:00.05  (sh)
root   39601  0.0  0.6  1164  768  p6  I+6:57AM   0:00.10 make -k -k
-k -k CDEBUGFLAGS= all
root   45736  0.0  0.2   628  244  p6  I+7:12AM   0:00.00 /bin/sh -ec
cd hw/xfree86 ; echo "making all in programs/Xserver/hw/x
root   45737  0.0  0.6  1128  756  p6  I+7:12AM   0:00.07 make -k -k
-k -k -k -k -k -k CDEBUGFLAGS= LDSTRIPFLAGS=-x all
root   45766  0.0  0.2   628  244  p6  I+7:12AM   0:00.01  (sh)
root   47311  0.0  0.6  1116  716  p6  I+7:14AM   0:00.05 make -k -k
-k -k -k -k -k -k -k -k -k -k -k -k -k -k CDEBUGFLAGS= LDS
root   47312  0.0  0.2   628  244  p6  S+7:14AM   0:00.00  (sh)
root   47648  0.4  0.7  1256  880  p6  S+7:16AM   0:00.13 make -k -k
-k -k -k -k -k



Maybe more make it go faster...



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: makecontext & friends ?

2000-09-08 Thread Ralf S. Engelschall


In article <[EMAIL PROTECTED]> you wrote:

> are there any plans to implement makecontext() & friends
> functions in FreeBSD? 

I don't know of any plans myself, but I would appreciate that we support this
standardized ucontext(3) API in FreeBSD. The API is actually not the problem,
the question is on what should this API internally be based? On an own
mechanism or on an existing mechanism (jmp_buf, etc)?

> Is there any other way to implement user-level threads?
> (I know it can be done in assembler, but this is not 
> portable)

Sure, it can. See my GNU Portable Threads under
http://www.gnu.org/software/pth/. We have a port under devel/pth,
too. It bases its user-land threads on ucontext(3) if available or on
setjmp(3)'s jmp_buf, etc. All without any assembler things. For details
read my USENIX paper under http://www.gnu.org/software/pth/rse-pmt.ps.

> Using pthreads is not an option for me, although pthreads
> are implemented as userlevel threads in FreeBSD, but not
> on most other Unixes.

If you need maximum portability, then GNU Pth certainly is an option for
you.
   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Shared Memory Issues

2000-09-08 Thread John Toon

Lance Rocker wrote:
 
> Hello,
> 
> I too had problems with running out of shared mem segments, so I wrote
> my first ever perl script that does something useful for me. I've
> attached it to this email and I'll paste it in below too, for
> convenience.
> 
> I noticed that many (most?) of the shared mem segments in use, when I
> was running out of them, didn't actually have any processes attached to
> them. This perl script just goes through, finds those non-attached
> shared mem segments, and deletes them. I've found running it
> periodically works great for me, you may even want to put it in your
> crontab and let it run once a day, just as a little proactive
> housekeeping.

Hey, nice script. Is there anything Perl can't do these days? ;^)

I'm currently just enjoying the power of awk. I hope it doesn't get
forgotten in the shadow of Perl.

However, it seems strange that you're getting non-attached memory
segments. Surely it is the job of the kernel to clean up after processes
(if they're badly programmed and don't do it themselves)? Perhaps one
program is leaking? 

My system has been up for two days now since last reboot, I just ran
your program, and I had 55 shared memory segments, 0 non-attached...

> For the record, here are the kernel options I use with this kernel:
> 
> options SYSVSHM #SYSV-style shared memory
> options SYSVMSG #SYSV-style message queues
> options SYSVSEM #SYSV-style semaphores
> options SHMALL=16384
> options SHMMAX="(SHMMAXPGS*PAGE_SIZE+1)"
> options SHMMAXPGS=8192
> options SHMMIN=128
> options SHMMNI=128
> options SHMSEG=96
> 
> I think that last one makes the biggest difference, and is the one you
> may want to make as large as possible, though 96 works fine for my 64MB
> of ram. This is a 4.0-release kernel, and I use XFree86 4.0 with
> Enlightenment as my window manager.

It definitely does! The default setting, as someone correctly pointed
out, in LINT, is SHMSEG=9. As you can see above, my system is currently
using 55, more than 5X that limit! I've sent in a brief e-mail to
freebsd-stable, suggesting that the GENERIC kernel default is altered to
something a little higher. The SHMSEG setting is under the
"undocumented" options in LINT, which is not helpful or conducive to
people fixing this problem. It's a good job freebsd-hackers exists...
;^)

The SHMSEG=1024 setting I've got is probably excessive, but I would
guess the performance degradation is negligible to non-existent in
having more than you need, especially due to FreeBSD's unmatched memory
management, as I've noticed no difference in performance. 

> yes, ipcs and ipcrm are the ones my perl script uses. Check out the
> manpage for each of them. . .  I like to run "ipcs -mbop" to get a lot
> of info about used shared mem segments.
> 
> -Lance

Yes, they both have more settings than I was aware of. Oh, the joy of
manpages...

-- 
"I'm entirely unaccountable for any moments of sanity contained herein."
:s/Windows/UNIX
John Toon |  [EMAIL PROTECTED]  | "Sonnilon"




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



makecontext & friends ?

2000-09-08 Thread Mitja Horvat

Hi,

are there any plans to implement makecontext() & friends
functions in FreeBSD? 

Is there any other way to implement user-level threads?
(I know it can be done in assembler, but this is not 
portable)

Using pthreads is not an option for me, although pthreads
are implemented as userlevel threads in FreeBSD, but not
on most other Unixes.

Thanx for your answers,
Mitja


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



makecontext() & friends ?

2000-09-08 Thread Mitja Horvat

Hi,

are there any plans to implement makecontext() & friends
functions in FreeBSD? 

Is there any other way to implement user-level threads?
(I know it can be done in assembler, but this is not 
portable)

Using pthreads is not an option for me, although pthreads
are implemented as userlevel threads in FreeBSD, but not
on most other Unixes.

Thanx for your answers,
Mitja


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Creating a list of newbus devices.

2000-09-08 Thread Nick Hibma


The answers are 'no' and 'root_bus'.

The 'no' could be revised into something more useful if you are able to
tell us what you are trying to do.

Nick

On Fri, 8 Sep 2000, Nicolai Petri wrote:

> Is it possible from kernel mode to create a list of newbus devices ?
> And how do I'll get a pointer to the new-bus root (or whatever it's
> tecnical name is :)
> 
> ---
> Nicolai Petri
> 
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 

--
Qube Software, Ltd. Private:
[EMAIL PROTECTED]  [EMAIL PROTECTED]
 [EMAIL PROTECTED]
http://www.qubesoft.com/   http://www.etla.net/~n_hibma/




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



New ATA tagged queuing patch available

2000-09-08 Thread Soren Schmidt


>From the README:

ATA-tagged-queueing-diff-0908:  
  Add support for ATA channels with both a master and a slave, even
  combos where only on of them supports tagged queuing should work now.
  Also only switch on tagged queuing on IBM DPTA & DTLA series
  drives, the older DJNA has firmware problems. I am working on
  a SW solution to that, but for now only enable tagged queuing
  on drives that is known to work.

Get it from http://freebsd.dk, and let me know your results

If I dont get any serious problem reports I'll commit this
shortly, making FreeBSD the first OS that has tagged Queuing
support for ATA drives :)

-Søren


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Creating a list of newbus devices.

2000-09-08 Thread Nicolai Petri

Is it possible from kernel mode to create a list of newbus devices ? And how do I'll 
get a pointer to the new-bus root (or whatever it's tecnical name is :)

---
Nicolai Petri



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: FYI: RSA Donated to the public domain

2000-09-08 Thread Mike Silbersack


On Thu, 7 Sep 2000, Peter Wemm wrote:

> Mike Silbersack wrote:
> > Ok, now I have a question.  Using STARTTLS with sendmail is obviously OK
> > for us, since sendmail got the export liscense.  However, AFAIK, qmail and
> > postfix have obtained no such permission.
> 
> Postfix has done the BXA hoop thing too.  It is fully exportable (and
> reexportable) and has a TLS etc implementation.
> 
> Cheers,
> -Peter

Excellent, glad that 2/3 MTAs are done.

Now, on to qmail.  I'm assuming that Bernstein won't go through the hassle
of getting approval, especially since I don't know where the snuffle trial
is currently at in appeals.

However, the TLS patch for qmail at
http://www.esat.kuleuven.ac.be/~vermeule/qmail/tls.patch patches cleanly,
and works great.  Like OpenSSH / etc, it uses OpenSSL for all crypto work.

Which of the following options would be legal:

1.  Have the port fetch the patch from the .be site, patch qmail, and
finish building it.

2.  Include a (possibly modified) version of the patch in the ports tree,
which would be applied when building qmail.

(The port makefile would also wish to call the patched qmail makefile to
create a CA during the build process as well.  I'm not sure if that has
additional implications.)

I'm assuming #1's good, since that's how the OpenSSH port worked.  Would
#2 be any different?

Mike "Silby" Silbersack



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message