Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question regarding MAKEOPTS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Dippmopser
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2013
Posts: 92

PostPosted: Wed Aug 14, 2013 4:19 pm    Post subject: Question regarding MAKEOPTS Reply with quote

Hi,

the wiki entry for MAKEOPTS states:

"The recommended value is the number of your processors (or cores) plus 1"

I am running a CoreI7 3930K that has 6 physical cores but is capable of hyperthreading.

Are the "cores" provided by hyperthreading counted when making the MAKEOPTS entry?

So should my MAKEOPTS be at 7 or at 13?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Aug 14, 2013 4:38 pm    Post subject: Reply with quote

If you've got the RAM, then the rule of thumb answer would be 13—if hyperthreading is enabled.

However, the goal is to launch enough compiles to keep all the processors busy. If you see a lot of idle processors, then you might want to consider increasing the number. If you don't, you might want to consider decreasing it. :wink:

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Dippmopser
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2013
Posts: 92

PostPosted: Wed Aug 14, 2013 4:42 pm    Post subject: Reply with quote

Thanks for the answer,

is there a rule of thumb "how much RAM per -j" is required ?

I got 64GB DDR3 1600 installed, is it save to run -j13 than?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Aug 14, 2013 4:56 pm    Post subject: Reply with quote

No rule of thumb exists for memory usage. It depends entirely on the source being compiled, so it varies by package. 64GiB should be safe for MAKEOPTS="-j64", though. :P

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Wed Aug 14, 2013 5:05 pm    Post subject: Reply with quote

Dippmopser wrote:

is there a rule of thumb "how much RAM per -j" is required ?
I got 64GB DDR3 1600 installed, is it save to run -j13 than?


64GB is more than sufficient.
I have a 4 GB RAM and compiling a system in chroot with "-j5" option (and I have full-featured KDE running in backgroud with firefox, amarok and KPatience started :D ). Without swap.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54098
Location: 56N 3W

PostPosted: Wed Aug 14, 2013 9:27 pm    Post subject: Reply with quote

creaker,

You always have swap. The swap space is used only for dynamically allocated RAM.
The kernel will discard and reload anything that has a permanent home on disk as it needs to to provide free RAM.

Turning off swap only forces the kernel to keep all dynamically allocated RAM in memory.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Aug 15, 2013 12:12 am    Post subject: Reply with quote

NeddySeagoon, when you said "swap" did you mean "formatted as Linux/Solaris swap (id=82) hard drive space" or something else?
I have no neither swap partition nor swap file.

Quote:
The kernel will discard and reload anything that has a permanent home on disk as it needs to to provide free RAM.

Hmm, all the things that running inside the box has their permanent home on disk (except some temporary stuffs). Does this mean that the swap is not needed at all because the most things that sits in RAM can be unloaded/loaded as needed?
If I have running app (e.g. Firefox) and at some moment free RAM will be exhausted, will Firefox be unloaded or what will occurs?
Can you explain this?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54098
Location: 56N 3W

PostPosted: Thu Aug 15, 2013 6:44 pm    Post subject: Reply with quote

creaker,

"You always have swap" means that the kernel has several options when more RAM is required than is available.
Dirty buffers can be flushed to disk and the space freed
Clean buffers can be discarded (no write to disk required)
Code and data that has a permanent home on disk can be discarded and
reloaded later
The swap file/partition can be used to house dynamically allocated RAM.

By not having a swap file/partition, the last option is not available to
the kernel.

The kernel memory manager does not load a program into memory when you try to execute it, it allocates it some virtual memory without caring how the virtual memory space is mapped into physical RAM.
When the kernel tries to pass control to this virtual memory, it is not actually mapped to phyisical RAM, so a page fault occurs, the program loses the CPU while it is fetched from disk.
Next time it gets the CPU, its in RAM and execution starts. This mechanism allows for the execution of of individual programs that are
bigger then physical RAM since nothing stops several addresses in virtual memory space being allocated to the same physical RAM. That
happens - the trick is that only one of these virtual memory allocations can occupy the physical RAM at a time. When the wrong one is loaded,
you get a page fault, some other thread gets the CPU and the kernel loads the missing page.
This also means that virtual address space need not always be mapped to the same physical RAM.
None of this implies the use of swap. So far, we are considering code
and data loaded from disk.

The granularity of memory allocation can be 4kB or 2MB (from memory) depending on the page size selected in the kernel and supported in
hardware, so all this virtual address space to phyisical address mapping either happens in 4kB or 2MB chunks. Yes, its slow and painful when it
has to be repeated because physical RAM is not adequate.

When you allocate a swap partition, dynamically allocated RAM has a home on disk too, so its no longer locked into RAM. The memory manager can
then choose to add that to its swapping options.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum