Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Although the moon is smaller than the earth, it is farther away.


computers / comp.os.vms / New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

SubjectAuthor
* New free Load Average driver (LAXDRIVER) to replace LAVDRIVERJake Hamby
`* Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVERSimon Clubley
 `* Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVERArne Vajhøj
  `* Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVERJake Hamby
   `- Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVERChris Scheers

1
New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

<d092473b-89a0-43f9-8dbe-fb73b35d396fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=23177&group=comp.os.vms#23177

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6000:2a4:b0:218:77ba:988e with SMTP id l4-20020a05600002a400b0021877ba988emr11148750wry.459.1655505573502;
Fri, 17 Jun 2022 15:39:33 -0700 (PDT)
X-Received: by 2002:a05:620a:f14:b0:6ab:986a:6b04 with SMTP id
v20-20020a05620a0f1400b006ab986a6b04mr2441372qkl.77.1655505573008; Fri, 17
Jun 2022 15:39:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Fri, 17 Jun 2022 15:39:32 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:f304:49ce:bef3:e349;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:f304:49ce:bef3:e349
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d092473b-89a0-43f9-8dbe-fb73b35d396fn@googlegroups.com>
Subject: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER
From: jake.hamby@gmail.com (Jake Hamby)
Injection-Date: Fri, 17 Jun 2022 22:39:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jake Hamby - Fri, 17 Jun 2022 22:39 UTC

I'm not quite ready to announce a V1.0 release, but I'm pleased to share my first VMS device driver, not for a physical hardware device, but a replacement for the old LAVDRIVER load average driver written in MACRO. With the recent thread bemoaning the lack of good examples of how to write a device driver in C, I'm happy to add to the collection of open source examples.

I'm in the process of upgrading the GNV packages with various bug fixes, although my branch is definitely not as stable as the release packages. However, there's a bug in coreutils in "uptime", "w", and other programs that show the load average.

The getloadavg.c code in the original coreutils source actually has VMS support (and Eunice too, if you can believe that), but it's buggy: it thinks the values it's reading are doubles and not floats. But there's an even bigger issue: GNU coreutils is compiled with IEEE floating point (as it should be), while the LAVDRIVER returns VAX 32-bit floats.

Long story short, I realized that the LAVDRIVER.EXE that MultiNet provides was likely going to be inefficient if it's still written in VAX assembly, and I can hardly believe they would be using floating-point at all in the kernel. The more I looked at the problem, I realized it wouldn't be advisable, and perhaps not even safe at all, to touch the FP registers. Much better to use and return fixed-point integers, so that's what I did. I rewrote my own LAXDRIVER in C and it seems to work fairly well, at least on Alpha and Itanium (after many crashes and false starts on the Alpha, which is easy to get crash info from).

https://github.com/jhamby/vms-laxdriver

I've put it under an MIT license: it's all my original work, except for the skeleton and some of the function comments that came from the sample LRDRIVER.C in sys$examples that I used as a template (I'm sure VSI won't mind since they put the code there as an example). There's a test app you can compile as test-lav-driver.exe to read from the original VAX FP LAVDRIVER, or with /float=ieee to build as test-lax-driver.exe and read fixed-point with 14-bit scaling factor from my new driver.

I do have one apparent bug in the load average that I'm calculating, and without access to any internals docs newer than for V7.0, perhaps some changes have been made to the scheduler that I don't understand, so I'd be grateful for any insight into what's happening:

When I have 2 process each using 100% CPU on a two-CPU Itanium, the load average settles in at around 3.5 to 4.0, or rather fluctuates between those two. It should be much closer to 2.0, with two runnable processes and two cores (it's a bug in the original LAVDRIVER to divide the load average by the number of CPUs; no other OS I know of does that).

Relatedly, in MONITOR, I can also see 2 CUR and 2 COM at the same time. I don't understand how I could be seeing processes marked as CURrent in the per-CPU table and yet also counting the same process as COMputable. Is that a bug or do I need to do something more than hold the SCHED lock?

Regards,
Jake Hamby

Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

<t8pqum$jlq$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=23195&group=comp.os.vms#23195

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER
Date: Mon, 20 Jun 2022 12:59:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <t8pqum$jlq$1@dont-email.me>
References: <d092473b-89a0-43f9-8dbe-fb73b35d396fn@googlegroups.com>
Injection-Date: Mon, 20 Jun 2022 12:59:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="27faa71fd0ced53aac07e50c3cb0b47b";
logging-data="20154"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jHdnJbg6zGrSrcefc+RjB7/OPErG0OsM="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:4MuLgL3b7OicTVEt9bPPBJqT3jE=
 by: Simon Clubley - Mon, 20 Jun 2022 12:59 UTC

On 2022-06-17, Jake Hamby <jake.hamby@gmail.com> wrote:
> I'm not quite ready to announce a V1.0 release, but I'm pleased to share my first VMS device driver, not for a physical hardware device, but a replacement for the old LAVDRIVER load average driver written in MACRO. With the recent thread bemoaning the lack of good examples of how to write a device driver in C, I'm happy to add to the collection of open source examples.
>
> I'm in the process of upgrading the GNV packages with various bug fixes, although my branch is definitely not as stable as the release packages. However, there's a bug in coreutils in "uptime", "w", and other programs that show the load average.
>
> The getloadavg.c code in the original coreutils source actually has VMS support (and Eunice too, if you can believe that), but it's buggy: it thinks the values it's reading are doubles and not floats. But there's an even bigger issue: GNU coreutils is compiled with IEEE floating point (as it should be), while the LAVDRIVER returns VAX 32-bit floats.
>
> Long story short, I realized that the LAVDRIVER.EXE that MultiNet provides was likely going to be inefficient if it's still written in VAX assembly, and I can hardly believe they would be using floating-point at all in the kernel. The more I looked at the problem, I realized it wouldn't be advisable, and perhaps not even safe at all, to touch the FP registers. Much better to use and return fixed-point integers, so that's what I did. I rewrote my own LAXDRIVER in C and it seems to work fairly well, at least on Alpha and Itanium (after many crashes and false starts on the Alpha, which is easy to get crash info from).
>
> https://github.com/jhamby/vms-laxdriver
>

First off, thanks for posting this.

> I've put it under an MIT license: it's all my original work, except for the skeleton and some of the function comments that came from the sample LRDRIVER.C in sys$examples that I used as a template (I'm sure VSI won't mind since they put the code there as an example). There's a test app you can compile as test-lav-driver.exe to read from the original VAX FP LAVDRIVER, or with /float=ieee to build as test-lax-driver.exe and read fixed-point with 14-bit scaling factor from my new driver.
>

It may not be that simple. VSI are constrained by what the HPE contract says
and the copyrights on the original source code.

For example, just because the EVE source code is in sys$examples, it doesn't
mean that VSI or a VMS user can just post it on GitHub (for example).

That said, I do hope that you are right.

> I do have one apparent bug in the load average that I'm calculating, and
> without access to any internals docs newer than for V7.0, perhaps some
> changes have been made to the scheduler that I don't understand, so I'd be
> grateful for any insight into what's happening:
>

Have you considered asking Brian to look at your code ? He might have some
insights for you.

$ set response/mode=good_natured

Of course, if Brian says to rewrite it in Macro-32, then feel free to ignore
him. :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

<62b0ba5b$0$701$14726298@news.sunsite.dk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=23202&group=comp.os.vms#23202

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Mon, 20 Jun 2022 14:20:11 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Subject: Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER
Content-Language: en-US
Newsgroups: comp.os.vms
References: <d092473b-89a0-43f9-8dbe-fb73b35d396fn@googlegroups.com>
<t8pqum$jlq$1@dont-email.me>
From: arne@vajhoej.dk (Arne Vajhøj)
In-Reply-To: <t8pqum$jlq$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 39
Message-ID: <62b0ba5b$0$701$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: a02d8804.news.sunsite.dk
X-Trace: 1655749212 news.sunsite.dk 701 arne@vajhoej.dk/68.9.63.232:52912
X-Complaints-To: staff@sunsite.dk
 by: Arne Vajhøj - Mon, 20 Jun 2022 18:20 UTC

On 6/20/2022 8:59 AM, Simon Clubley wrote:
> On 2022-06-17, Jake Hamby <jake.hamby@gmail.com> wrote:
>> I've put it under an MIT license: it's all my original work, except
>> for the skeleton and some of the function comments that came from
>> the sample LRDRIVER.C in sys$examples that I used as a template
>> (I'm sure VSI won't mind since they put the code there as an
>> example). There's a test app you can compile as test-lav-driver.exe
>> to read from the original VAX FP LAVDRIVER, or with /float=ieee to
>> build as test-lax-driver.exe and read fixed-point with 14-bit
>> scaling factor from my new driver. >
> It may not be that simple. VSI are constrained by what the HPE contract says
> and the copyrights on the original source code.
>
> For example, just because the EVE source code is in sys$examples, it doesn't
> mean that VSI or a VMS user can just post it on GitHub (for example).
>
> That said, I do hope that you are right.

Copyright rules are pretty strict. Stuff in SYS$EXAMPLES
are copyrighted and one need permission to use
copyrighted material.

But I think in this case one could try argue:
- the stuff in SYS$EXAMPLES are obviously intended
to be used so it must be OK to use it at
least locally
- everybody using this code will obviously have
a VMS system and a SYS$EXAMPLES with the same
stuff already, so it is distributing code to people
that already have a legal copy of that code

The argument also points to a workaround: distribute
only ones own code and a script that merge it with
SYS$EXAMPLES stuff.

Arne

Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

<86dadd8e-3b7b-4ad7-aaaf-97fc56ccc2cen@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=23314&group=comp.os.vms#23314

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a1c:770b:0:b0:3a0:42d9:6f4e with SMTP id t11-20020a1c770b000000b003a042d96f4emr11707303wmi.164.1656613762465;
Thu, 30 Jun 2022 11:29:22 -0700 (PDT)
X-Received: by 2002:a25:1183:0:b0:66d:4690:418e with SMTP id
125-20020a251183000000b0066d4690418emr10787523ybr.268.1656613761835; Thu, 30
Jun 2022 11:29:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 30 Jun 2022 11:29:21 -0700 (PDT)
In-Reply-To: <62b0ba5b$0$701$14726298@news.sunsite.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:3825:6784:d683:8045;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:3825:6784:d683:8045
References: <d092473b-89a0-43f9-8dbe-fb73b35d396fn@googlegroups.com>
<t8pqum$jlq$1@dont-email.me> <62b0ba5b$0$701$14726298@news.sunsite.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86dadd8e-3b7b-4ad7-aaaf-97fc56ccc2cen@googlegroups.com>
Subject: Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER
From: jake.hamby@gmail.com (Jake Hamby)
Injection-Date: Thu, 30 Jun 2022 18:29:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jake Hamby - Thu, 30 Jun 2022 18:29 UTC

On Monday, June 20, 2022 at 11:20:15 AM UTC-7, Arne Vajhøj wrote:
> > That said, I do hope that you are right.
> Copyright rules are pretty strict. Stuff in SYS$EXAMPLES
> are copyrighted and one need permission to use
> copyrighted material.
>
> But I think in this case one could try argue:
> - the stuff in SYS$EXAMPLES are obviously intended
> to be used so it must be OK to use it at
> least locally
> - everybody using this code will obviously have
> a VMS system and a SYS$EXAMPLES with the same
> stuff already, so it is distributing code to people
> that already have a legal copy of that code
>
> The argument also points to a workaround: distribute
> only ones own code and a script that merge it with
> SYS$EXAMPLES stuff.

At some point I'll replace the comments with something shorter and written in my own style. I didn't want to do that originally mostly because I didn't want to claim authoritatively the system states that are described in the comments for the different callback functions that I filled in with my own code.

I'm still curious what's accounting for the load average being higher than I'd expect when there are 2 running/computable processes and 2 CPUs. I'd expect to see values closer to 2.0 than 3.5 to 4.0. At least it shows ~0.01 when idle. It looks to all appearances like a running process can show up as computable and also current on a CPU, including in the MONITOR system process counts. Not that this is the sort of thing that a hardware device driver would ever be concerned with, as opposed to a pseudo-device driver that's poking around in the system state.

Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

<62BE11B1.8030503@applied-synergy.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=23324&group=comp.os.vms#23324

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: chris@applied-synergy.com (Chris Scheers)
Newsgroups: comp.os.vms
Subject: Re: New free Load Average driver (LAXDRIVER) to replace LAVDRIVER
Date: Thu, 30 Jun 2022 16:12:17 -0500
Organization: Applied Synergy, Inc.
Lines: 37
Message-ID: <62BE11B1.8030503@applied-synergy.com>
References: <d092473b-89a0-43f9-8dbe-fb73b35d396fn@googlegroups.com> <t8pqum$jlq$1@dont-email.me> <62b0ba5b$0$701$14726298@news.sunsite.dk> <86dadd8e-3b7b-4ad7-aaaf-97fc56ccc2cen@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="4f6db7965037356dfb8a405149a6e0ac";
logging-data="2134476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HvTMvOeniY8zoEuSzURgMwUDY9SFWh3g="
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
Cancel-Lock: sha1:Cp2xiHlNVxZuqCJjuRgl54EPN50=
In-Reply-To: <86dadd8e-3b7b-4ad7-aaaf-97fc56ccc2cen@googlegroups.com>
 by: Chris Scheers - Thu, 30 Jun 2022 21:12 UTC

Jake Hamby wrote:
> On Monday, June 20, 2022 at 11:20:15 AM UTC-7, Arne Vajhøj wrote:
>>> That said, I do hope that you are right.
>> Copyright rules are pretty strict. Stuff in SYS$EXAMPLES
>> are copyrighted and one need permission to use
>> copyrighted material.
>>
>> But I think in this case one could try argue:
>> - the stuff in SYS$EXAMPLES are obviously intended
>> to be used so it must be OK to use it at
>> least locally
>> - everybody using this code will obviously have
>> a VMS system and a SYS$EXAMPLES with the same
>> stuff already, so it is distributing code to people
>> that already have a legal copy of that code
>>
>> The argument also points to a workaround: distribute
>> only ones own code and a script that merge it with
>> SYS$EXAMPLES stuff.
>
> At some point I'll replace the comments with something shorter and written in my own style. I didn't want to do that originally mostly because I didn't want to claim authoritatively the system states that are described in the comments for the different callback functions that I filled in with my own code.
>
> I'm still curious what's accounting for the load average being higher than I'd expect when there are 2 running/computable processes and 2 CPUs. I'd expect to see values closer to 2.0 than 3.5 to 4.0. At least it shows ~0.01 when idle. It looks to all appearances like a running process can show up as computable and also current on a CPU, including in the MONITOR system process counts. Not that this is the sort of thing that a hardware device driver would ever be concerned with, as opposed to a pseudo-device driver that's poking around in the system state.

I don't have the internals manual here just now, and things may have
changed in later versions of VMS anyways, but when a process is made
CUR, is it actually removed from the COM queue?

Also, depending on how you are scanning the queues, processes can move
between queues while you are scanning.

--
-----------------------------------------------------------------------
Chris Scheers, Applied Synergy, Inc.

Voice: 817-237-3360 Internet: chris@applied-synergy.com
Fax: 817-237-3074


computers / comp.os.vms / New free Load Average driver (LAXDRIVER) to replace LAVDRIVER

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor