All of lore.kernel.org
 help / color / mirror / Atom feed
* The swap partition's size is too big for BSP?
@ 2011-07-04  5:35 Cui, Dexuan
  2011-07-04 11:39 ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Cui, Dexuan @ 2011-07-04  5:35 UTC (permalink / raw)
  To: 'Patches and discussions about the oe-core layer'; +Cc: Wold, Saul

In meta/recipes-core/initrdscripts/files/init-install.sh, we have 

# 5% for the swap
swap_ratio=5               # dexuan: this variable is not used at all!
...
swap_size=$((disk_size*5/100)) 

This algorithm seems too wasty -- e.g., for a CrownBay box with a 160GB disk, we would create a 8GB swap partition while the box has only 1GB memory.

What's the proper swap size?
This link http://www.cyberciti.biz/tips/linux-swap-space.html discussed this and I think the below algorithm seems suitable for us:

Systems with 2GB of ram or less require the same size of swap space
Systems with 2GB to 4GB of ram require a minimum of 2GB of swap space 
Systems with 4GB to 16GB of ram require a minimum of 4GB of swap space 
Systems with 16GB to 64GB of ram require a minimum of 8GB of swap space 
Systems with 64GB to 256GB of ram require a minimum of 16GB of swap space 

Any comment?

Thanks,
-- Dexuan
 



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

* Re: The swap partition's size is too big for BSP?
  2011-07-04  5:35 The swap partition's size is too big for BSP? Cui, Dexuan
@ 2011-07-04 11:39 ` Richard Purdie
  2011-07-04 12:02   ` Cui, Dexuan
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2011-07-04 11:39 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Wold, Saul

On Mon, 2011-07-04 at 13:35 +0800, Cui, Dexuan wrote:
> In meta/recipes-core/initrdscripts/files/init-install.sh, we have 
> 
> # 5% for the swap
> swap_ratio=5               # dexuan: this variable is not used at all!
> ...
> swap_size=$((disk_size*5/100)) 
> 
> This algorithm seems too wasty -- e.g., for a CrownBay box with a 160GB disk, we would create a 8GB swap partition while the box has only 1GB memory.
> 
> What's the proper swap size?
> This link http://www.cyberciti.biz/tips/linux-swap-space.html discussed this and I think the below algorithm seems suitable for us:
> 
> Systems with 2GB of ram or less require the same size of swap space
> Systems with 2GB to 4GB of ram require a minimum of 2GB of swap space 
> Systems with 4GB to 16GB of ram require a minimum of 4GB of swap space 
> Systems with 16GB to 64GB of ram require a minimum of 8GB of swap space 
> Systems with 64GB to 256GB of ram require a minimum of 16GB of swap space 
> 
> Any comment?

Looks like a much better idea to me, I'll take patches :)

For reference if you want to do suspend to disk (swap) you need a lot of
swap space btw. Still no where near that much though!

Cheers,

Richard




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

* Re: The swap partition's size is too big for BSP?
  2011-07-04 11:39 ` Richard Purdie
@ 2011-07-04 12:02   ` Cui, Dexuan
  2011-07-04 13:48     ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Cui, Dexuan @ 2011-07-04 12:02 UTC (permalink / raw)
  To: 'Patches and discussions about the oe-core layer'; +Cc: Wold, Saul

Richard Purdie wrote:
> On Mon, 2011-07-04 at 13:35 +0800, Cui, Dexuan wrote:
>> In meta/recipes-core/initrdscripts/files/init-install.sh, we have
>> 
>> # 5% for the swap
>> swap_ratio=5               # dexuan: this variable is not used at
>> all! ... 
>> swap_size=$((disk_size*5/100))
>> 
>> This algorithm seems too wasty -- e.g., for a CrownBay box with a
>> 160GB disk, we would create a 8GB swap partition while the box has
>> only 1GB memory.  
>> 
>> What's the proper swap size?
>> This link http://www.cyberciti.biz/tips/linux-swap-space.html
>> discussed this and I think the below algorithm seems suitable for
>> us:  
>> 
>> Systems with 2GB of ram or less require the same size of swap space
>> Systems with 2GB to 4GB of ram require a minimum of 2GB of swap space
>> Systems with 4GB to 16GB of ram require a minimum of 4GB of swap
>> space 
>> Systems with 16GB to 64GB of ram require a minimum of 8GB of swap
>> space 
>> Systems with 64GB to 256GB of ram require a minimum of 16GB of swap
>> space 
>> 
>> Any comment?
> 
> Looks like a much better idea to me, I'll take patches :)
Ok, I'll try to make a patch for this algorithm.

> For reference if you want to do suspend to disk (swap) you need a lot
> of swap space btw. Still no where near that much though!
Does (or should )Yocto Linux support suspend-to-disk? I'm not sure about this.
BTW: Linux can alse use a regular file as swap area.
So in case the swap size is not enough (e.g., for suspend-to-disk), I think a user could create a big enough file  to meet the need (I didn't test this with Linux yet).

Thanks,
-- Dexuan


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

* Re: The swap partition's size is too big for BSP?
  2011-07-04 12:02   ` Cui, Dexuan
@ 2011-07-04 13:48     ` Richard Purdie
  2011-07-04 13:58       ` Cui, Dexuan
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2011-07-04 13:48 UTC (permalink / raw)
  To: Cui, Dexuan
  Cc: Wold, Saul,
	'Patches and discussions about the oe-core layer'

On Mon, 2011-07-04 at 20:02 +0800, Cui, Dexuan wrote:
> Richard Purdie wrote:
> > For reference if you want to do suspend to disk (swap) you need a lot
> > of swap space btw. Still no where near that much though!
>
> Does (or should )Yocto Linux support suspend-to-disk? I'm not sure about this.
> BTW: Linux can alse use a regular file as swap area.
> So in case the swap size is not enough (e.g., for suspend-to-disk), I
> think a user could create a big enough file  to meet the need (I
> didn't test this with Linux yet).

I don't think we've supported it in the past, its just a datapoint to
keep in mind.

For reference, you can't use a file easily since the VM data needs to be
available as the kernel boots to be able to resume from it.

Cheers,

Richard





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

* Re: The swap partition's size is too big for BSP?
  2011-07-04 13:48     ` Richard Purdie
@ 2011-07-04 13:58       ` Cui, Dexuan
  0 siblings, 0 replies; 5+ messages in thread
From: Cui, Dexuan @ 2011-07-04 13:58 UTC (permalink / raw)
  To: 'Richard Purdie'
  Cc: Wold, Saul,
	'Patches and discussions about the oe-core layer'

Richard Purdie wrote:
> On Mon, 2011-07-04 at 20:02 +0800, Cui, Dexuan wrote:
>> Richard Purdie wrote:
>>> For reference if you want to do suspend to disk (swap) you need a
>>> lot of swap space btw. Still no where near that much though!
>> 
>> Does (or should )Yocto Linux support suspend-to-disk? I'm not sure
>> about this. BTW: Linux can alse use a regular file as swap area.
>> So in case the swap size is not enough (e.g., for suspend-to-disk), I
>> think a user could create a big enough file  to meet the need (I
>> didn't test this with Linux yet).
> 
> I don't think we've supported it in the past, its just a datapoint to
> keep in mind.
Ok, so I can put a comment when I make the patch, saying this new algorithm doesn't work with suspend-to-disk in future.

> For reference, you can't use a file easily since the VM data needs to
> be available as the kernel boots to be able to resume from it.
I admit I didn't try this on Linux.
Windows does use a regular file when doing suspend-to-disk, so I thought Linux could do it, too...  :-)

Thanks,
-- Dexuan


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

end of thread, other threads:[~2011-07-04 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-04  5:35 The swap partition's size is too big for BSP? Cui, Dexuan
2011-07-04 11:39 ` Richard Purdie
2011-07-04 12:02   ` Cui, Dexuan
2011-07-04 13:48     ` Richard Purdie
2011-07-04 13:58       ` Cui, Dexuan

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.