9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] termrc changes
@ 2006-11-28 17:35 Joel Salomon
  2006-11-28 19:37 ` geoff
  0 siblings, 1 reply; 25+ messages in thread
From: Joel Salomon @ 2006-11-28 17:35 UTC (permalink / raw)
  To: 9fans

What is the effective change made in termrc between the old version:
	disk=''
	if(test -f /dev/sd*/swap)
		disk=`{ls /dev/sd*/swap >[2]/dev/null | sed 1q | sed 's!swap$!!'}
	if(! ~ $disk '') {
		swap $disk^swap >/dev/null >[2=1]
		dossrv
		c:
	}
and the new one:
	# start up local swapping, mount dos fat fs
	disk=`{ls /dev/sd*/swap >[2]/dev/null}
	if (! ~ $#disk 0) {
		swap $disk(1) >/dev/null >[2=1]
		dossrv
		c:
	}
	rm /env/disk
is it just an elimination of ‘test’s or something more substantial?

--Joel



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-28 17:35 [9fans] termrc changes Joel Salomon
@ 2006-11-28 19:37 ` geoff
  2006-11-28 20:11   ` Richard Miller
  2006-11-29  4:43   ` Lucio De Re
  0 siblings, 2 replies; 25+ messages in thread
From: geoff @ 2006-11-28 19:37 UTC (permalink / raw)
  To: 9fans

The new termrc avoids using test when looking for swap partitions.
The old termrc sometimes invoked test as

	test -f file1 file2

which is incorrect, though tolerated by the new test command because
of the need to tolerate unprocessed arguments in the presence of
short-circuit -a and -o evaluation.  If test were modified to process
all its arguments at the start (presumably building an expression
tree), it could then complain about excess arguments again.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-28 19:37 ` geoff
@ 2006-11-28 20:11   ` Richard Miller
  2006-11-29  4:43   ` Lucio De Re
  1 sibling, 0 replies; 25+ messages in thread
From: Richard Miller @ 2006-11-28 20:11 UTC (permalink / raw)
  To: 9fans

>  If test were modified to process
> all its arguments at the start (presumably building an expression
> tree), it could then complain about excess arguments again.

I have a modified version of test which uses a parameter for e(),
e1(), etc to determine whether sub-expressions should be evaluated
or just parsed.  This allows the whole test command to be checked
for syntax, while preserving the lazy semantics ("short circuit")
of -a and -o.

I haven't submitted it because it seems somehow clunky.

A much simpler change would be just to have -a and -o behave like &
and | instead of like && and ||; in other words, to perform both tests
(and therefore syntax check the whole command) before combining the
boolean results.  I've looked at the posix description of test and it
doesn't actually say that -a and -o have to be lazy.  Would this cause
any problems in practice?

-- Richard



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-28 19:37 ` geoff
  2006-11-28 20:11   ` Richard Miller
@ 2006-11-29  4:43   ` Lucio De Re
  2006-11-29 14:54     ` ron minnich
  2006-11-29 20:40     ` Georg Lehner
  1 sibling, 2 replies; 25+ messages in thread
From: Lucio De Re @ 2006-11-29  4:43 UTC (permalink / raw)
  To: 9fans

> The new termrc avoids using test when looking for swap partitions.

I tend to like to slip a "sort -nr" into the fry, it allows me to pick
the largest swap partition when I have multiple disks.  Not
necessarily what everyone may want, of course:

swp=`{ls -s /dev/sd*/swap | sort -nr | sed 1q | awk '{print $2}'}

++L



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29  4:43   ` Lucio De Re
@ 2006-11-29 14:54     ` ron minnich
  2006-11-29 16:39       ` Lucio De Re
                         ` (2 more replies)
  2006-11-29 20:40     ` Georg Lehner
  1 sibling, 3 replies; 25+ messages in thread
From: ron minnich @ 2006-11-29 14:54 UTC (permalink / raw)
  To: Lucio De Re, Fans of the OS Plan 9 from Bell Labs

On 11/28/06, Lucio De Re <lucio@proxima.alt.za> wrote:
> > The new termrc avoids using test when looking for swap partitions.
>
> I tend to like to slip a "sort -nr" into the fry, it allows me to pick
> the largest swap partition when I have multiple disks.  Not
> necessarily what everyone may want, of course:

The more of this type of thing you add the harder it is on those of us
with tiny flash boot setups.

sort, sed, awk?

ack!

ron


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 14:54     ` ron minnich
@ 2006-11-29 16:39       ` Lucio De Re
  2006-11-29 16:40       ` Russ Cox
  2006-11-30  0:29       ` erik quanstrom
  2 siblings, 0 replies; 25+ messages in thread
From: Lucio De Re @ 2006-11-29 16:39 UTC (permalink / raw)
  To: 9fans

> The more of this type of thing you add the harder it is on those of us
> with tiny flash boot setups.

Surely you don't have swap on those?  Can you make it conditional?

if (! ~ /dev/sd*/swap /dev/sd*/swap) {
	blah, blah...
}

I think will work:

			The patterns are not subjected to file
			name matching before the ~ command is executed, so they
			need not be enclosed in quotation marks.

I'll hold thumbs :-)

++L



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 14:54     ` ron minnich
  2006-11-29 16:39       ` Lucio De Re
@ 2006-11-29 16:40       ` Russ Cox
  2006-11-29 16:50         ` ron minnich
  2006-11-30  0:29       ` erik quanstrom
  2 siblings, 1 reply; 25+ messages in thread
From: Russ Cox @ 2006-11-29 16:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> The more of this type of thing you add the harder it is on those of us
> with tiny flash boot setups.
>
> sort, sed, awk?
>
> ack!

Surely if you have a tiny flash boot setup
you would just write your own stripped down termrc.

Russ


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 16:40       ` Russ Cox
@ 2006-11-29 16:50         ` ron minnich
  2006-11-30  0:37           ` erik quanstrom
  0 siblings, 1 reply; 25+ messages in thread
From: ron minnich @ 2006-11-29 16:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 11/29/06, Russ Cox <rsc@swtch.com> wrote:

> Surely if you have a tiny flash boot setup
> you would just write your own stripped down termrc.


I did :-)

but at the same time, I still get worried when I see all that stuff in
termrc. What's next: /etc/init.d?

ron


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29  4:43   ` Lucio De Re
  2006-11-29 14:54     ` ron minnich
@ 2006-11-29 20:40     ` Georg Lehner
  2006-11-30  4:34       ` Lucio De Re
  1 sibling, 1 reply; 25+ messages in thread
From: Georg Lehner @ 2006-11-29 20:40 UTC (permalink / raw)
  To: 9fans

Lucio De Re <lucio@proxima.alt.za> writes:

>> The new termrc avoids using test when looking for swap partitions.
>
> I tend to like to slip a "sort -nr" into the fry, it allows me to pick
> the largest swap partition when I have multiple disks.  Not
> necessarily what everyone may want, of course:
>
> swp=`{ls -s /dev/sd*/swap | sort -nr | sed 1q | awk '{print $2}'}
>
> ++L
>

If you have several swap partitions, wouldn't you set them up all at
once? 

mhm.. I think I do not understand how swapping works under Plan9 at
all.  Any pointer to the most helpful documentation?

Regards


    Jorge-León


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 14:54     ` ron minnich
  2006-11-29 16:39       ` Lucio De Re
  2006-11-29 16:40       ` Russ Cox
@ 2006-11-30  0:29       ` erik quanstrom
  2006-11-30  0:34         ` ron minnich
  2 siblings, 1 reply; 25+ messages in thread
From: erik quanstrom @ 2006-11-30  0:29 UTC (permalink / raw)
  To: 9fans

i just bought a 1Gbyte CF at fry's (not the cheepest place)
for 19.99.  get a bigger flash. ;-)

- erik

On Wed Nov 29 09:57:48 EST 2006, rminnich@gmail.com wrote:
> On 11/28/06, Lucio De Re <lucio@proxima.alt.za> wrote:
> > > The new termrc avoids using test when looking for swap partitions.
> >
> > I tend to like to slip a "sort -nr" into the fry, it allows me to pick
> > the largest swap partition when I have multiple disks.  Not
> > necessarily what everyone may want, of course:
>
> The more of this type of thing you add the harder it is on those of us
> with tiny flash boot setups.
>
> sort, sed, awk?
>
> ack!
>
> ron


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-30  0:29       ` erik quanstrom
@ 2006-11-30  0:34         ` ron minnich
  0 siblings, 0 replies; 25+ messages in thread
From: ron minnich @ 2006-11-30  0:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 11/29/06, erik quanstrom <quanstro@coraid.com> wrote:
> i just bought a 1Gbyte CF at fry's (not the cheepest place)
> for 19.99.  get a bigger flash. ;-)

Good point, but the parts I deal with are a bit smaller than that,
around either 2MB or 8 MB.

ron


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 16:50         ` ron minnich
@ 2006-11-30  0:37           ` erik quanstrom
  2006-11-30  1:15             ` Martin Neubauer
  0 siblings, 1 reply; 25+ messages in thread
From: erik quanstrom @ 2006-11-30  0:37 UTC (permalink / raw)
  To: 9fans

from my gentoo system

	# wc -l /etc/init.d/* | grep total
	  10203 total

(never mind the scripts and executables that support
/etc/init.d).

and from plan 9

	cpu% wc -l (/ /n/sources/plan9/)^rc/bin/termrc
	    107 /rc/bin/termrc
 	    107 /n/sources/plan9/rc/bin/termrc
	    214 total

only two orders' magnitude difference.  we've got to work
on that.  should be three.

- erik

On Wed Nov 29 11:52:43 EST 2006, rminnich@gmail.com wrote:
> On 11/29/06, Russ Cox <rsc@swtch.com> wrote:
>
> > Surely if you have a tiny flash boot setup
> > you would just write your own stripped down termrc.
>
>
> I did :-)
>
> but at the same time, I still get worried when I see all that stuff in
> termrc. What's next: /etc/init.d?
>
> ron


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-30  0:37           ` erik quanstrom
@ 2006-11-30  1:15             ` Martin Neubauer
  0 siblings, 0 replies; 25+ messages in thread
From: Martin Neubauer @ 2006-11-30  1:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

* erik quanstrom (quanstro@coraid.com) wrote:
> only two orders' magnitude difference.  we've got to work
> on that.  should be three.
>
> - erik

I'm not sure we have to. It will be anyway before too long...

	Martin


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 20:40     ` Georg Lehner
@ 2006-11-30  4:34       ` Lucio De Re
  2006-11-30  4:35         ` geoff
  0 siblings, 1 reply; 25+ messages in thread
From: Lucio De Re @ 2006-11-30  4:34 UTC (permalink / raw)
  To: 9fans

> If you have several swap partitions, wouldn't you set them up all at
> once?
>
I wish...

> mhm.. I think I do not understand how swapping works under Plan9 at
> all.  Any pointer to the most helpful documentation?

Well, it does not allow swapping to more than one partition, that much
I understand.  If discussion is anything to go by, however, I think
"understanding" Plan 9 swap isn't on the cards.  I think it needs
careful analysis and possibly another iteration (to use a common Plan
9 idiom).

++L



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-30  4:34       ` Lucio De Re
@ 2006-11-30  4:35         ` geoff
  2006-11-30  4:58           ` Lucio De Re
  0 siblings, 1 reply; 25+ messages in thread
From: geoff @ 2006-11-30  4:35 UTC (permalink / raw)
  To: lucio, 9fans

You could use fs(3) to concatentate or interleave swap partitions.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-30  4:35         ` geoff
@ 2006-11-30  4:58           ` Lucio De Re
  0 siblings, 0 replies; 25+ messages in thread
From: Lucio De Re @ 2006-11-30  4:58 UTC (permalink / raw)
  To: 9fans

> You could use fs(3) to concatentate or interleave swap partitions.

I didn't think of that.  Now there's a project Russ may not have added
to the wish list: consolidating fs(3) into the Plan 9 disk
infrastructure.  I forget the exact details he briefly outlined, but
it sounded like an excellent idea.

Summer of Code stuff?

++L



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-12-01  3:11         ` John Floren
@ 2006-12-01  3:15           ` Bruce Ellis
  0 siblings, 0 replies; 25+ messages in thread
From: Bruce Ellis @ 2006-12-01  3:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I wasn't using a mouse on the console but certainly the
drawterm wouldn't do anything sensible.

brucee

On 12/1/06, John Floren <slawmaster@gmail.com> wrote:
> On 11/30/06, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> > i have seen the same on a machine with not much memory
> > (actually not much recognized memory, now fixed).
> > certainly not thrashing as there was no disk activity.
> >
> > i'm now in Madrid and have had my jet-lag busting sleep.
> >
> > brucee
> >
> > On 12/1/06, geoff@plan9.bell-labs.com <geoff@plan9.bell-labs.com> wrote:
> > > This just sounds like thrashing.  Was the disk active when the machine
> > > was `frozen'?
> >
>
> Yes, Bruce seems to have had the same problem as I did. I can't
> recall--does this make the mouse stop or not.
>
>
> John
> --
> Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
>


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-12-01  2:09       ` Bruce Ellis
@ 2006-12-01  3:11         ` John Floren
  2006-12-01  3:15           ` Bruce Ellis
  0 siblings, 1 reply; 25+ messages in thread
From: John Floren @ 2006-12-01  3:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 11/30/06, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> i have seen the same on a machine with not much memory
> (actually not much recognized memory, now fixed).
> certainly not thrashing as there was no disk activity.
>
> i'm now in Madrid and have had my jet-lag busting sleep.
>
> brucee
>
> On 12/1/06, geoff@plan9.bell-labs.com <geoff@plan9.bell-labs.com> wrote:
> > This just sounds like thrashing.  Was the disk active when the machine
> > was `frozen'?
>

Yes, Bruce seems to have had the same problem as I did. I can't
recall--does this make the mouse stop or not.


John
--
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-12-01  1:38     ` geoff
@ 2006-12-01  2:09       ` Bruce Ellis
  2006-12-01  3:11         ` John Floren
  0 siblings, 1 reply; 25+ messages in thread
From: Bruce Ellis @ 2006-12-01  2:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

i have seen the same on a machine with not much memory
(actually not much recognized memory, now fixed).
certainly not thrashing as there was no disk activity.

i'm now in Madrid and have had my jet-lag busting sleep.

brucee

On 12/1/06, geoff@plan9.bell-labs.com <geoff@plan9.bell-labs.com> wrote:
> This just sounds like thrashing.  Was the disk active when the machine
> was `frozen'?


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-12-01  1:19   ` John Floren
@ 2006-12-01  1:38     ` geoff
  2006-12-01  2:09       ` Bruce Ellis
  0 siblings, 1 reply; 25+ messages in thread
From: geoff @ 2006-12-01  1:38 UTC (permalink / raw)
  To: 9fans

This just sounds like thrashing.  Was the disk active when the machine
was `frozen'?



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 18:47 ` geoff
  2006-11-29 18:59   ` Francisco J Ballesteros
@ 2006-12-01  1:19   ` John Floren
  2006-12-01  1:38     ` geoff
  1 sibling, 1 reply; 25+ messages in thread
From: John Floren @ 2006-12-01  1:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 11/29/06, geoff@plan9.bell-labs.com <geoff@plan9.bell-labs.com> wrote:
> I have not seen any of the alleged problems with swapping.  I
> certainly haven't seen freezing or crashing due to swapping.  I have
> seen one problem on one machine that may be attributable to a bug in
> the VM code (or may reflect marginal hardware).  Let's get together at
> IWP9 and figure out if the alleged swap bugs are real or urban myth.
>
>

I have experienced freezing due to what I assume is swap on two
machines. Both had low memory, and would lock up completely when I was
compiling a kernel and reached a certain swap usage (perhaps 30%). I
didn't test the problem with anything else, so it could possibly be a
problem in the kernel compilation procedure (I personally doubt it),
but one machine had 32 MB of RAM and the other had 64, and both would
only lock up once they had hit a certain swap usage.


John
--
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 18:59   ` Francisco J Ballesteros
@ 2006-11-29 20:08     ` Charles Forsyth
  0 siblings, 0 replies; 25+ messages in thread
From: Charles Forsyth @ 2006-11-29 20:08 UTC (permalink / raw)
  To: 9fans

>>I can easily reproduce that, by increasing the fossil cache to consume
>>most of our file server. However, after reading what Rob said regardind swap,
>>I thought it twice and now I agree that once you start paging, you have lost.

trying to page on the file server to a file served by the same file server is
probably a bad idea.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29 18:47 ` geoff
@ 2006-11-29 18:59   ` Francisco J Ballesteros
  2006-11-29 20:08     ` Charles Forsyth
  2006-12-01  1:19   ` John Floren
  1 sibling, 1 reply; 25+ messages in thread
From: Francisco J Ballesteros @ 2006-11-29 18:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I can easily reproduce that, by increasing the fossil cache to consume
most of our file server. However, after reading what Rob said regardind swap,
I thought it twice and now I agree that once you start paging, you have lost.

But yes, I´d love to discuss all this in iwp9.

BTW, if any of you are comming, drop me a private mail and I´ll let you know
my mobile phone number, in case there´s any problem and I might help.



On 11/29/06, geoff@plan9.bell-labs.com <geoff@plan9.bell-labs.com> wrote:
> I have not seen any of the alleged problems with swapping.  I
> certainly haven't seen freezing or crashing due to swapping.  I have
> seen one problem on one machine that may be attributable to a bug in
> the VM code (or may reflect marginal hardware).  Let's get together at
> IWP9 and figure out if the alleged swap bugs are real or urban myth.
>
>
>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
  2006-11-29  9:19 Fco. J. Ballesteros
@ 2006-11-29 18:47 ` geoff
  2006-11-29 18:59   ` Francisco J Ballesteros
  2006-12-01  1:19   ` John Floren
  0 siblings, 2 replies; 25+ messages in thread
From: geoff @ 2006-11-29 18:47 UTC (permalink / raw)
  To: 9fans

I have not seen any of the alleged problems with swapping.  I
certainly haven't seen freezing or crashing due to swapping.  I have
seen one problem on one machine that may be attributable to a bug in
the VM code (or may reflect marginal hardware).  Let's get together at
IWP9 and figure out if the alleged swap bugs are real or urban myth.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [9fans] termrc changes
@ 2006-11-29  9:19 Fco. J. Ballesteros
  2006-11-29 18:47 ` geoff
  0 siblings, 1 reply; 25+ messages in thread
From: Fco. J. Ballesteros @ 2006-11-29  9:19 UTC (permalink / raw)
  To: 9fans

In any case, the machine can freeze once you
start using the swap area. So, I wouldn't say it is important
to choose a big or a small swap partition.


:  From: lucio@proxima.alt.za
:  Date: Wed, 29 Nov 2006 06:43:41 +0200
:  To: 9fans@cse.psu.edu
:  Reply-To: lucio@proxima.alt.za 9fans@cse.psu.edu
:  Subject: Re: [9fans] termrc changes
:
:  > The new termrc avoids using test when looking for swap partitions.
:
:  I tend to like to slip a "sort -nr" into the fry, it allows me to pick
:  the largest swap partition when I have multiple disks.  Not
:  necessarily what everyone may want, of course:
:
:  swp=`{ls -s /dev/sd*/swap | sort -nr | sed 1q | awk '{print $2}'}
:
:  ++L


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2006-12-01  3:15 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-28 17:35 [9fans] termrc changes Joel Salomon
2006-11-28 19:37 ` geoff
2006-11-28 20:11   ` Richard Miller
2006-11-29  4:43   ` Lucio De Re
2006-11-29 14:54     ` ron minnich
2006-11-29 16:39       ` Lucio De Re
2006-11-29 16:40       ` Russ Cox
2006-11-29 16:50         ` ron minnich
2006-11-30  0:37           ` erik quanstrom
2006-11-30  1:15             ` Martin Neubauer
2006-11-30  0:29       ` erik quanstrom
2006-11-30  0:34         ` ron minnich
2006-11-29 20:40     ` Georg Lehner
2006-11-30  4:34       ` Lucio De Re
2006-11-30  4:35         ` geoff
2006-11-30  4:58           ` Lucio De Re
2006-11-29  9:19 Fco. J. Ballesteros
2006-11-29 18:47 ` geoff
2006-11-29 18:59   ` Francisco J Ballesteros
2006-11-29 20:08     ` Charles Forsyth
2006-12-01  1:19   ` John Floren
2006-12-01  1:38     ` geoff
2006-12-01  2:09       ` Bruce Ellis
2006-12-01  3:11         ` John Floren
2006-12-01  3:15           ` Bruce Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).