Wilders Security Forums  

Go Back   Wilders Security Forums > Software, Hardware and General Services > all things UNIX
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread
  #1  
Old May 26th, 2012, 11:26 PM
Gullible Jones
 
Posts: n/a
Default Linux configuration for an ancient Thinkpad

Let's say you wanted to to make a Thinkpad 600E - with an almighty Pentium II processor and 192 MB of RAM - useful for browsing and word processing. And you wanted it to run a secure and reasonably user-friendly modern OS. How would you configure it?

What I've managed to deal with so far:

- Swapping. Too much swapping can be mostly avoided by using zram, which sacrifices CPU power for effective memory.

- Slow GTK apps. Again, zram helps. So does using Fluxbox with outline move/resize, and disabling unnecessary eyecandy GTK themes.

What I haven't managed to deal with:

- Slow application start times. To some extent this is unavoidable what with the slow hard drive, but cross-platform applications are ~50% faster to start on Windows (2000 or XP) than on Linux. I suspect this is due to the proliferation of shared libraries; not sure what can be done about it (other than prelinking, which I've never found effective).

- Slow Qt applications. Using the raster graphics system helps, but not enough to make them in any way usable. Maybe they're a lot cause...

- CPU priority issues. Background tasks can hog too much CPU time, slowing everything down. Since multitasking is necessarily going to suck on a Pentium II, I figure it would be better to assign higher CPU priority to whatever is in the foreground... Yes, like on Windows. That way you could get one application at a time running with reasonable responsiveness. Unfortunately I have no idea how that could be done on Linux.

Ideas are welcome...

(And yes, my hobbies are strange. I know.)
  #2  
Old May 26th, 2012, 11:37 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Linux configuration for an ancient Thinkpad

192MB of RAM... yikes... and not even a P4

Honestly I'd turn it into a Firewall/IDS/IPS so check out pfsense.
__________________
  #3  
Old May 27th, 2012, 12:05 AM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

I had thought a 2.4 kernel might work, but Damn Small Linux was actually slower on it than any other distro. Best so far is Puppy Linux, but that has... issues. Also, Abiword is totally unusable on it due to the smooth scrolling bug.

... Then again, Abiword is unusable on every Linux system I've ever used because of that bug, so I'm not sure why I'm bothering. OS without word processor = completely useless.
  #4  
Old May 27th, 2012, 12:07 AM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Linux configuration for an ancient Thinkpad

Dive into Arch. Optimize...
__________________
  #5  
Old May 27th, 2012, 12:23 AM
mirimir mirimir is offline
Very Frequent Poster
 
Join Date: Oct 2011
Posts: 1,531
Default Re: Linux configuration for an ancient Thinkpad

Have you looked at Tiny Core Linux?
  #6  
Old May 27th, 2012, 12:30 AM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

Quote:
Originally Posted by Hungry Man
Dive into Arch. Optimize...

That's a thought. Unfortunately Arch is in the process of swapping in bloaty GTK3 applications for everything. (Welcome to the future. ) I might give it a go though.

BTW, have you ever found compile optimizations to be useful on old computers? The only one I've ever found effective is -fomit-frame-pointer (which frees up a register, but breaks debugging on x86-32). Other than that one I've never found any to make the slightest difference, and certainly not to make up for the time spent compiling.
  #7  
Old May 27th, 2012, 12:34 AM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Linux configuration for an ancient Thinkpad

Actually optimization probably won't do **** for you since a P2 isn't exactly built with modern instruction sets.

Instruction sets can make a massive difference or none at all. It's about the program, really.

PCSX2 and Dolphin are optimized and can be compiled for SSE2/3/4 and the difference can be massive. There are areas of games where you'll get 4x the framerate purely because instead of no instruction sets you've used SSE4.

edit: I compile my kernel with every instruction set available on my CPU. I haven't noticed anything different. Maybe I would if I were on an older P4 or if I were doing some crazy stuff on it but I'm not. If you were to use Gentoo and compile everything with instructions... yeah, maybe there'd be some big difference.
__________________

Last edited by Hungry Man : May 27th, 2012 at 12:43 AM.
  #8  
Old May 27th, 2012, 06:00 AM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Linux configuration for an ancient Thinkpad

well on this lubuntu or maybe xubuntu as well work as ram is very less you can check lxde base distro as puppy linux you can install office suite in it



https://en.wikipedia.org/wiki/Lightw...x_distribution

as security you can set firewall in it as well its more than enough for basic security

or

can try bodhi linux as well
__________________
Scientific Linux 6.2, xubuntu 11.10 *2x, Linux mint 10, Linux mint 12, opensuse 11.4, windows vista, ubuntu 10.04 and windows xp
  #9  
Old May 27th, 2012, 10:48 AM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

Xubuntu is probably too heavy. Lubuntu? Maybe. It wouldn't be snappy by any means, but it would probably work.

(If I used the alternate installer. Live installer would probably crash.)

I'm still trying to figure out how I could better optimize Linux for single tasks. Maybe I could increase some of the kernel.sched sysctl settings (e.g. sched_latency_ns) so that foreground applications don't get interrupted?
  #10  
Old May 27th, 2012, 03:11 PM
AlexC's Avatar
AlexC AlexC is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,111
Default Re: Linux configuration for an ancient Thinkpad

Maybe Bodhi Linux?

System requirements:
http://www.bodhilinux.com/system.php
__________________
Linux Mint 13 MATE x64
  #11  
Old May 27th, 2012, 03:47 PM
Beavenburt Beavenburt is offline
Frequent Poster
 
Join Date: Dec 2006
Posts: 566
Default Re: Linux configuration for an ancient Thinkpad

Slitaz is what you are after. www.slitaz.org

IMO it's the best tiny distro out there. It runs in about 50 megs of ram at idle. Give it a try.
  #12  
Old May 27th, 2012, 06:14 PM
zapjb's Avatar
zapjb zapjb is offline
Very Frequent Poster
 
Join Date: Nov 2005
Location: USA - Back in a real State in time for a real President.
Posts: 1,961
Default Re: Linux configuration for an ancient Thinkpad

Puppy Linux!!!!!!!!!!!!!!!!!!!!!!!!!!!!
__________________
PCLinuxOS - Radically simple, it just works. That's why PCLOS is "The Distro Hopper Stopper!"
http://www.pclinuxos.com/

If you don't use Linux. You're going to HELL!!!
  #13  
Old May 27th, 2012, 06:35 PM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

I've used Slitaz before. Might try it again for this machine. OTOH zram mostly handles the RAM issue; the main problems I'm focusing on are (apparently distro-independent) CPU scheduling issues. I'd like to tweak CFS to be more friendly to a "one application at a time" approach, giving most available CPU cycles to the piggiest application (because chances are that's the one you want to run fast). IOW the approach should (IMO) be completely different from the preemptive multitasking stuff on a modern desktop, because the Pentium II is more or less incapable of efficiently dividing its attention between two things.

And Puppy works (exceptionally well at that), but I have issues with its design. Running as root by default is bad, and lack of a sane update path for the full install is very bad.

(I know that Puppy enthusiasts love to say their distro isn't insecure. But the fact is, two of the biggest causes of malware proliferation on Windows have historically been a) use of administrator accounts by default, and b) inability of users who pirated it to easily update. Puppy has both disadvantages, and ignoring the whole obscurity thing is about as secure by default as a pirated copy of Windows XP Home.)
  #14  
Old May 27th, 2012, 06:43 PM
Hungry Man's Avatar
Hungry Man Hungry Man is offline
Incredibly Massive Poster
 
Join Date: May 2011
Posts: 8,486
Default Re: Linux configuration for an ancient Thinkpad

Instead of CFS you should try BFS. It's more tuned to single-task scheduling.
__________________
  #15  
Old May 27th, 2012, 07:12 PM
zapjb's Avatar
zapjb zapjb is offline
Very Frequent Poster
 
Join Date: Nov 2005
Location: USA - Back in a real State in time for a real President.
Posts: 1,961
Default Re: Linux configuration for an ancient Thinkpad

BFS LOL. Look up "BFS Scheduler". Gotta love Con Kolivas.
__________________
PCLinuxOS - Radically simple, it just works. That's why PCLOS is "The Distro Hopper Stopper!"
http://www.pclinuxos.com/

If you don't use Linux. You're going to HELL!!!
  #16  
Old May 27th, 2012, 07:35 PM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

Quote:
Originally Posted by Hungry Man
Instead of CFS you should try BFS. It's more tuned to single-task scheduling.

Hmm, PCLinuxOS uses BFS by default... Shame it doesn't have any installer other than the live one. I will probably give BFS a try at some point though.

As for CFS, there is this: https://www.kernel.org/doc/Documenta...design-CFS.txt

It looks like what I want is basically to assign the SCHED_BATCH policy to big applications like Firefox... Oh hey wait a minute!

Quote:

7. GROUP SCHEDULER EXTENSIONS TO CFS

Normally, the scheduler operates on individual tasks and strives to provide
fair CPU time to each task. Sometimes, it may be desirable to group tasks and
provide fair CPU time to each such task group. For example, it may be
desirable to first provide fair CPU time to each user on the system and then to
each task belonging to a user.

CONFIG_CGROUP_SCHED strives to achieve exactly that. It lets tasks to be
grouped and divides CPU time fairly among such groups.

CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and
SCHED_RR) tasks.

CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and
SCHED_BATCH) tasks.

These options need CONFIG_CGROUPS to be defined, and let the administrator
create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See
Documentation/cgroups/cgroups.txt for more information about this filesystem.

When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each
group created using the pseudo filesystem. See example steps below to create
task groups and modify their CPU share using the "cgroups" pseudo filesystem.

# mount -t tmpfs cgroup_root /sys/fs/cgroup
# mkdir /sys/fs/cgroup/cpu
# mount -t cgroup -ocpu none /sys/fs/cgroup/cpu
# cd /sys/fs/cgroup/cpu

# mkdir multimedia # create "multimedia" group of tasks
# mkdir browser # create "browser" group of tasks

# #Configure the multimedia group to receive twice the CPU bandwidth
# #that of browser group

# echo 2048 > multimedia/cpu.shares
# echo 1024 > browser/cpu.shares

# firefox & # Launch firefox and move it to "browser" group
# echo <firefox_pid> > browser/tasks

# #Launch gmplayer (or your favourite movie player)
# echo <movie_player_pid> > multimedia/tasks

That looks interesting, but is a rather involved way of assigning CPU time. Maybe it would be better to use something like e.g. verynice? Also I haven't yet tried upping sched_min_granularity_ns, for whatever that's worth.

Edit: Hmm. I tried setting sched_min_granularity_ns up to 1 second, that seemed to make a difference in terms of interactivity. There's still a delay when typing/backspacing in Midori and Abiword, but I think that may be more an application problem... Also OMG, scrolling in Abiword is actually usable now! Cool.

I'm guessing the downside of this, though, is that a runaway CPU hog would absolutely kill the system (because it treats CPU eaters preferentially). OTOH, CPU hogs killing the system is business as usual on Linux. Still, a renicing daemon like verynice would probably be a better long-term solution - just give "good" applications like Firefox high CPU priority, and make everything else sluggish.

Edit again: My hypothesis about shared library bloat has (I think) been confirmed - Opera, a large browser with few shared libraries, loads faster than Midori, a smaller browser that uses many libraries. (Specifically, 6 seconds vs. 20 seconds.) Lots of small highly dispersed files = bad news on slow hard drives. This was probably why ReiserFS outperformed everything else back when I was in high school.

(But I don't touch ReiserFS these days. Call it pragmatism or call it superstition, I won't use it.)

Last edited by Gullible Jones : May 27th, 2012 at 08:10 PM.
  #17  
Old June 13th, 2012, 04:33 PM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

Still looking into this... More so, now that the keyboard on my flimsy EeePC has broken. One thing I'll say about these old machines, they made them *sturdy*.

Anyway, I think what's most needed on the Thinkpad is some way of reducing disk activity. Linux's habit of scattering thousands of tiny libraries all over the hard drive is killer when the drive is an ATA66 model. Probably what's needed is some way of caching stuff in one place. Either that or an OS along the lines of Puppy or Porteus, that stores the userland in a compressed image.
  #18  
Old June 28th, 2012, 03:58 AM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

Update: got it working (and currently posting from it).

I tried a different tack... Instead of using a stripped down Fluxbox desktop, I decided on a full Xfce desktop launched by GDM. And, surprise, it works quite well.

The OS: SalixOS 13.37, based on Slackware 13.37. "Pure" Slack would probably be faster for various reasons, but I couldn't be bothered (and this machine can't boot from DVDs anyway).

The partition scheme: 4 GB swap, 8 GB ext4 root, 28 GB ext4 home, in that order. I know, 4 GB is a lot of swap - I'm counting on the kernel paging out as much unneeded stuff as possible.

The settings:

- Xfwm4 is set to use outlines for both move and resize. Yes, this freezes the rest of the screen; I don't care. If anything that helps, because the screen doesn't have to update *at all* when moving windows around. Anyway this is probably the most important modification I made to the default settings, since the Thinkpad's Neomagic video card is horribly weak.

- All partitions are mounted with noatime. Probably not necessary now that relatime is the default, but I don't need atime anyway so what the heck.

- I'm using the non-SMP kernel, because there's no benefit to using the SMP one, and the extra stuff in it would waste more memory and probably create more overhead.

- /tmp is on a tmpfs ramdisk. I'm not sure if this helps at all; my hypothesis is that putting the XOrg and Xfce temporary files in RAM will reduce needless disk activity (since those files get accessed a lot according to lsof), and allow more resources to be dedicated to important stuff... like, umm, swapping. Yeah. As I said, I'm not sure this helps.

- I disabled the XOrg composite extension. It is not useful and not necessary on ancient machines, and nothing should be allowed to use it what with the limited resources.

- I was careful to make sure all icon caches were built, not just hicolor. (Salix doesn't do this for you automatically.) This makes GTK2 applications quite a bit snappier in my experience. Note that some distros will do this for you, so you don't have to do anything.

And that's it. Things I did not do include tweaking swappiness, messing with hdparm, and modifying any sysctl variables at all. So far this setup is actually faster than the last one with Fluxbox was, and while not exactly snappy, is quite usable for one task at a time; and can even tolerate having the package manager install stuff in the background, without choking up.

Not bad for a full, multi-user Linux distro!
  #19  
Old June 28th, 2012, 08:07 AM
Mrkvonic Mrkvonic is offline
Linux Systems Expert
 
Join Date: May 2005
Posts: 7,435
Default Re: Linux configuration for an ancient Thinkpad

Very nice work ... in fact, if you want, I could write an article on this - you as a guest author, if you care to phrase this a little more around and provide some nice screenshots.
Mrk
__________________
http://www.dedoimedo.com

All your base are belong to us

Linux Systems Expert / Systems Programmer, Linux System Administrator, LPIC-1, LPIC-2 (WIP), GSEC, CCHD, CCHA
  #20  
Old June 28th, 2012, 12:36 PM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

Umm. Thanks! I'll have to think about that, but it sounds like a cool idea.

Screenshots might be a problem though. Not so much because the Thinkpad takes 30-40 seconds per PNG screenshot, as because I get artifacts in them, at least when I use Imagemagick.
  #21  
Old June 30th, 2012, 02:05 PM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,483
Default Re: Linux configuration for an ancient Thinkpad

yes it would be usefull for everyone of us also when again you needed you need to surf just wilderssecurity post
__________________
Scientific Linux 6.2, xubuntu 11.10 *2x, Linux mint 10, Linux mint 12, opensuse 11.4, windows vista, ubuntu 10.04 and windows xp
  #22  
Old July 1st, 2012, 01:17 PM
Gullible Jones
 
Posts: n/a
Default Re: Linux configuration for an ancient Thinkpad

When I have some more spare time, I'll see what else can be done...

- 4 GB swap is a bit extreme, I expect 2 GB would suffice. I think my problem earlier was using swap proportionate to avalable RAM, i.e. more like 512 MB.

- Reducing swappiness probably would help, but I don't think it's that big a deal. The computer is going to swap no matter what.

- I'm wondering if there are ways of increasing disk throughput that would work on such an old machine. Or, at least, increasing throughput on swap partitions so as to reduce the impact of swapping a bit. Putting a swap partition on a USB stick is a non-option unfortunately, because it's limited to USB 1.1 speeds (and the Thinkpad has only one USB port anyway).
 

Wilders Security Forums > Software, Hardware and General Services > all things UNIX « Previous Thread | Next Thread »

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Settings
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 06:03 PM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2013, Wilders Security Forums