LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Slackware (http://www.linuxquestions.org/questions/forumdisplay.php?f=14)
-   -   mkinitrd: initrd got 2GB of my 4GB RAM (slackware 14.0) (http://www.linuxquestions.org/questions/showthread.php?t=4175445294)

stf92 01-12-2013 01:16 PM

mkinitrd: initrd got 2GB of my 4GB RAM (slackware 14.0)
 
Hi: by advice of volkerdi (CHANGES_AND_HINTS.TXT) I change the huge kernel used to install to the generic one, and as a result I had to make an initrd, where I followed the instructions in /boot/README.initrd. I've just made a df, and see that the RAM disk takes 1.9G. But I was happy because my machine has 4GB RAM! This is more of a complain than a question, for the question would be how to make it smaller, but if it is too complicated then I'll switch back to the huge.

TobiSGD 01-12-2013 01:31 PM

The initrd should never be that large, mine is 4.4MB, which command did you use exactly to create it?

stf92 01-12-2013 02:04 PM

Hum... I believe I am wrong then. I did
Code:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        21G  12G  8.1G  59% /
/dev/sda1        20G  5.0G  15G  26% /xp
tmpfs          1.9G    0  1.9G  0% /dev/shm
semoi@darkstar:/etc$

and thought tmpfs is the RAM disk. But if tmpfs is on the hard disk, then I am wrong, am I?

Alien Bob 01-12-2013 02:11 PM

Quote:

Originally Posted by stf92 (Post 4868531)
Hum... I believe I am wrong then. I did
Code:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        21G  12G  8.1G  59% /
/dev/sda1        20G  5.0G  15G  26% /xp
tmpfs          1.9G    0  1.9G  0% /dev/shm
semoi@darkstar:/etc$

and thought tmpfs is the RAM disk. But if tmpfs is on the hard disk, then I am wrong, am I?

The tmpfs which is mounted on /dev/shm takes up exactly 50% of your available physical RAM - that is 1.9 GB in your case. However, that 1.9 GB is not actually used until some program starts writing files into the tmpfs filesystem.
See "man mount":
Code:

Mount options for tmpfs
      size=nbytes
              Override  default  maximum  size of the filesystem.  The size is
              given in bytes, and rounded up to entire pages.  The default  is
              half  of  the memory. The size parameter also accepts a suffix %
              to limit this tmpfs instance to that percentage of your physical
              RAM:  the default, when neither size nor nr_blocks is specified,
              is size=50%

It has nothing at all to do with your initrd.

Eric

Woodsman 01-12-2013 02:18 PM

For Slackware 14.0, the generic kernel is about 3 MB in size. On my system, the initrd is about 4.4 MB. I use the following command to create the initrd:

mkinitrd -c -k 3.2.29 -m ext3:ext4 -f ext4 -r /dev/sda10 -o /boot/initrd-3.2.29.gz

With that said, your reference to df and "RAM disk" implies that perhaps you are referring to tmpfs. If you are using shared RAM for your video, then the amount of RAM available to the system is a tad less then 4 GB. For example, alloting 256 MB of RAM to the on-board video leaves about 3.75 GB.

By default, the amount of RAM allocated to tmpfs is 1/2 the available RAM in the system. In that case, the 1.9 GB amount you report sounds reasonable. The amount allocated to tmpfs can be controlled by using parameters in fstab.

The amount of RAM allocated to tmpfs does not mean the RAM is not usable or that the amount is "set aside." The amount allocated only means how much tmpfs could use. For example, after your computer has been powered on for many hours, you might notice with the free command the system is using all 4 GB of RAM. Most often that usage is from disk caching. The Linux kernel routinely releases memory used by the caching process whenever needed by apps and other processes.

Edit: Looks like others already posted a similar response. Never check another web page while editing a response. :)

stf92 01-12-2013 02:35 PM

I see. Now, initrd is a RAM disk not anymore used after finishing booting, am I right? Only curious. MOre interesting to me is, how do I know if the video card has its own RAM on the chip or it is sharing it with the system? The motherboard manual does not say.

TobiSGD 01-12-2013 02:51 PM

Which motherboard to you have (I assume that you don't have a dedicated videocard).

stf92 01-12-2013 02:54 PM

H61m-s1. It an platform controller hub, a motherboard in a chip.

wigry 01-12-2013 02:55 PM

Yes, the initrd is just a small RAM disk image that is used by the kernel to access the harddrive and to continue booting process from there. Just a temporary place to keep the drivers.

About video card RAM. If you are using onboard video card then 95% probability, you have a shared VRAM using system memory. That is not a problem however because first you have plenty of RAM to give a little for the video vcard and second, your video card is slow enough that the slow system RAM does not make a difference. Thats why low-end video cards use system memory in a first place. Putting on dedicated memory would only increase the price without a single bit of performance benefit. You are not going to run demanding graphics programs on it anyway like gaming or such like.

For video performance you want to have separate dedicated video card preferrably from NVidia as their linux drivers are simply better. As Linux graphics is all about OpenGL and I've been dealing about 5 years with X-Plane - the most complicated and demanding OpenGL program out there, the best OpenGL performance is delivered by NVidia.

stf92 01-12-2013 03:01 PM

Only a youtube concert once in a while (more than once, to be honest). In fact my video card is onboard, part of it in the PCH (my machine has one) and part in some other chip I think. The chipset is H61M-S1.

EDIT: The motherboard manual says: Onboard graphics: integrated graphics processor - 1 x D-sub port. I has to be within the H61.

TobiSGD 01-12-2013 03:01 PM

H61 chipset with Intel CPU (the videochip is integrated into the CPU). These don't have separate RAM, they use the system RAM.

stf92 01-12-2013 03:53 PM

Quote:

Originally Posted by TobiSGD (Post 4868562)
H61 chipset with Intel CPU (the videochip is integrated into the CPU).

I now remember the GPU is a subset of the CPU! What a joke, the CPU assuming such humble tasks. Thanks for the information.

wigry 01-12-2013 04:26 PM

The main purpose Intel had when putting CPU and GPU together was technology called Quick Sync Video.
http://en.wikipedia.org/wiki/Intel_Quick_Sync_Video

Pretty amazing but not available on Linux unfortunately.

stf92 01-12-2013 05:49 PM

Thanks for the information, though I already knew that, but do tell me, what does your assertion about Linux mean? Could you expand, wigry?


All times are GMT -5. The time now is 02:09 AM.