All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: sumitraartsy@gmail.com
Cc: drv@mailo.com, julia.lawall@inria.fr, outreachy@lists.linux.dev
Subject: Re: Help to setup enviornment
Date: Thu, 09 Mar 2023 14:14:43 +0100	[thread overview]
Message-ID: <2897558.2VHbPRQshP@suse> (raw)
In-Reply-To: <20230309071628.GA2115@ubuntu>

On giovedì 9 marzo 2023 08:16:28 CET Sumitra Sharma wrote:
> Hi Fabio, this is the below output:
> ##
> sumitra@ubuntu:~$ df -h
> ##
> Filesystem      Size  Used Avail Use% Mounted on
> udev            2.2G     0  2.2G   0% /dev
> tmpfs           449M  1.8M  447M   1% /run
> /dev/sda5        39G   26G   12G  70% /
> tmpfs           2.2G     0  2.2G   0% /dev/shm
> tmpfs           5.0M  4.0K  5.0M   1% /run/lock
> tmpfs           2.2G     0  2.2G   0% /sys/fs/cgroup
> /dev/loop0      128K  128K     0 100% /snap/bare/5
> /dev/loop1      249M  249M     0 100% /snap/gnome-3-38-2004/99
> /dev/loop2       66M   66M     0 100% /snap/gtk-common-themes/1519
> /dev/loop3       64M   64M     0 100% /snap/core20/1828
> /dev/loop4       62M   62M     0 100% /snap/core20/1328
> /dev/loop5      347M  347M     0 100% /snap/gnome-3-38-2004/119
> /dev/loop6       92M   92M     0 100% /snap/gtk-common-themes/1535
> /dev/loop7       55M   55M     0 100% /snap/snap-store/558
> /dev/loop8       46M   46M     0 100% /snap/snap-store/638
> /dev/loop9       50M   50M     0 100% /snap/snapd/18357
> /dev/sda1       511M  4.0K  511M   1% /boot/efi
> tmpfs           449M   28K  449M   1% /run/user/1000
> ##
> 
> ##
> sumitra@ubuntu:~$ cat /proc/meminfo
> ##
> MemTotal:        4593512 kB
> MemFree:          128644 kB
> MemAvailable:    2020080 kB
> Buffers:           75072 kB
> Cached:          1914592 kB
> SwapCached:        55292 kB
> Active:           352904 kB
> Inactive:        3504468 kB
> Active(anon):      14532 kB
> Inactive(anon):  1853924 kB
> Active(file):     338372 kB
> Inactive(file):  1650544 kB
> Unevictable:           0 kB
> Mlocked:               0 kB
> SwapTotal:       1918356 kB
> SwapFree:        1594028 kB
> Dirty:            198312 kB
> Writeback:          2700 kB
> AnonPages:       1845196 kB
> Mapped:           112436 kB
> Shmem:               604 kB
> KReclaimable:     193728 kB
> Slab:             276024 kB
> SReclaimable:     193728 kB
> SUnreclaim:        82296 kB
> KernelStack:       10080 kB
> PageTables:        15768 kB
> NFS_Unstable:          0 kB
> Bounce:                0 kB
> WritebackTmp:          0 kB
> CommitLimit:     4215112 kB
> Committed_AS:    4901348 kB
> VmallocTotal:   34359738367 kB
> VmallocUsed:       58952 kB
> VmallocChunk:          0 kB
> Percpu:            94720 kB
> HardwareCorrupted:     0 kB
> AnonHugePages:         0 kB
> ShmemHugePages:        0 kB
> ShmemPmdMapped:        0 kB
> FileHugePages:         0 kB
> FilePmdMapped:         0 kB
> HugePages_Total:       0
> HugePages_Free:        0
> HugePages_Rsvd:        0
> HugePages_Surp:        0
> Hugepagesize:       2048 kB
> Hugetlb:               0 kB
> DirectMap4k:      229184 kB
> DirectMap2M:     3543040 kB
> DirectMap1G:     1048576 kB
> ##
> 
> Apart from this, I was talking about the RAM and I have provided the hard 
disk
> space of 40GB to my VM machine. And I see a lack of RAM in the VM machine.

Sorry, I couldn't answer before...

Anyway in the meantime I've read that you finally managed to build your own 
custom kernel increasing the reserved RAM from about 4GB to 6GB.

FYI, it looks like you have _not_ any shortage of RAM in the VM, if we look at 
/proc/meminfo at rest (I mean when you're not building the kernel). I assume 
you think you have no memory available due to the ratio of the following two 
lines:

> MemTotal:        4593512 kB
> MemFree:          128644 kB

Look at the third line:

> MemAvailable:    2020080 kB

Linux keeps all it can keep in RAM for future fast re-use, so it can avoid 
many unnecessary page-faults when processes try to access again many of the 
same memory addresses which were in use in the past and may be re-used later 
(locality principle).

This is the output in my system:

suse:~ # cat /proc/meminfo
MemTotal:       32768064 kB
MemFree:          535508 kB
MemAvailable:   22111212 kB

I have about 22GB of immediately re-usable RAM while, at the moment, about the 
95% of my 32 GB are in use. I can count on a good amount of RAM, despite we 
see that "MemFree: 535508 kB"(I'm also running a QEMU/KVM VM on top of my host 
with 6 GB of reserved RAM).

From your output, the other lines provide very helpful insights about how 
exactly your memory is used (I won't go into these details).

I'm pretty sure that 4.5GB are enough to run a system for the kind of 
development you are going to do in this phase of the project. I think that 
perhaps you are running too many processes/threads at the same time of the 
builds.

Are you sure you configured your system not to run unnecessary services? What 
processes are eating the most RAM in your VM? Can they be disabled? Do you run 
any other interactive processes while building? If so, can you avoid to run 
them at the same time?

Use the "ps" command with the proper options to figure out how your system is 
using memory space for each process/thread. I think that the 2GB you left to 
the host (Windows 10? Windows 11?) will make you in trouble sooner or later.

Last thing... I think you should also listen to Julia and disable those kernel 
options which build unnecessary features and drivers. Take a look at your 
.config file with `make menuconfig` (or similar commands: type `make help` for 
a summary) and disable those  unnecessary options that your distro enables by 
default if you don't need them (as a bonus you will compile and link much 
faster). 

Use the options help pages (when you run "make menuconfig" and are at an 
option you want to know more just select "help" or press 'h') if you are not 
sure about what you are disabling and be very careful to leave the options you 
are not sure about as they currently are.

Fabio



  parent reply	other threads:[~2023-03-09 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 17:15 Help to setup enviornment Sumitra Sharma
2023-03-08 17:27 ` Julia Lawall
2023-03-08 18:22   ` Deepak R Varma
2023-03-08 19:00   ` Fabio M. De Francesco
2023-03-09  7:16     ` Sumitra Sharma
2023-03-09  7:58       ` Julia Lawall
2023-03-09 13:14       ` Fabio M. De Francesco [this message]
2023-03-09 10:27   ` Sumitra Sharma
2023-03-09 10:32     ` Julia Lawall
2023-03-09 10:33     ` Julia Lawall
2023-03-09 10:46       ` Sumitra Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2897558.2VHbPRQshP@suse \
    --to=fmdefrancesco@gmail.com \
    --cc=drv@mailo.com \
    --cc=julia.lawall@inria.fr \
    --cc=outreachy@lists.linux.dev \
    --cc=sumitraartsy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.