Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread Grant Taylor

On 02/09/2018 03:30 AM, gevisz wrote:
May be, it is not a good idea to put /mnt on tmpfs at the time of Spector 
and Meltdown?


I wouldn't put /mnt on tmpfs as I routinely create mount points there 
in.  As such they would be lost on reboot.


What difference does Spector or Meltdown (or the next big security 
thing) have on using tmpfs for /mnt or not?




--
Grant. . . .
unix || die



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread Gerrit Kühn
On Fri, 9 Feb 2018 12:30:21 +0200 gevisz  wrote about
Re: [gentoo-user] /var/tmp on tmpfs:

> > Why mess around with another tmpfs? Just set PORTAGE_TMPDIR="/tmp" in
> > make.conf. Job done!
> 
> It is an interesting idea. But why it is not done by default then?
> 
> Can somebody think of a situation when it should not be done?

/var/tmp/portage may take up quite some space, and not everybody will want
to have that on a RAM-based fs.


cu
  Gerrit



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread Neil Bothwick
On Fri, 09 Feb 2018 10:12:01 +, Peter Humphrey wrote:

> > Why mess around with another tmpfs? Just set PORTAGE_TMPDIR="/tmp" in
> > make.conf. Job done!  
> 
> Acting on the advice of various Gentoo guides, I have this:
> 
> # grep tmp /etc/fstab
> tmpfs   /var/tmp/portagetmpfs
> noatime,uid=portage,gid=portage,mode=0775  0 0
> tmpfs   /tmptmpfs
> noatime,nosuid,nodev,noexec,mode=1777   0 0
> 
> Are you saying I don't gain anything from it?

I can't see any benefit from the added complexity. If you want portage to
use a tmpfs for its temporary directory, why not use one that is already
there?


-- 
Neil Bothwick

Fragile. Do not turn umop ap1sdn!


pgpS5xWLB7e3x.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread Neil Bothwick
On Fri, 9 Feb 2018 12:30:21 +0200, gevisz wrote:

> > Why mess around with another tmpfs? Just set PORTAGE_TMPDIR="/tmp" in
> > make.conf. Job done!  
> 
> It is an interesting idea. But why it is not done by default then?
> 
Because when the defaults were picked neither /tmp nor /var/tmp used
tmpfs but /tmp was cleared at boot. Some of the default for portage are
curious, to say the least, like using /usr for dynamic data.


-- 
Neil Bothwick

667 - The FAX number of the beast


pgpguP3vBXdwN.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread gevisz
2018-02-09 3:24 GMT+02:00 Dale :
>
> In my experience, once swap starts getting used, it gets slow, sometimes
> to the point that a response may take several seconds or more.  When I
> compile without tmpfs at all, which means everything is on disk, it's
> rare that I can even tell it is using that IO for the drive.

Thank you for the information. It is always good to know the downside
of your decision. In this case, of using the swap.

So far, I never saw my swap busy, even when running VirtualBox with
half of my RAM assigned to it.

> The catch is, take advice from different folks and weigh all the
> options, then test things to see what works best.  It may be that one
> part of your post helps, another part from mine, another part from
> someone else and in the end, it leaves settings that work.  Well, on
> that system and for that person at least.  ;-)

Yes. I am greatfull to all who wrote to this thread. :)



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread gevisz
2018-02-09 10:11 GMT+02:00 Neil Bothwick :
> On Thu, 8 Feb 2018 23:18:19 +, Wol's lists wrote:
>
>> > More specifically, /var/tmp is traditionally supposed to be
>> > non-volatile (across reboots).
>> >
>> > Comparatively the contents of /tmp can be volatile (across reboots).
>> >
>> > I would advise against mounting /var/tmp on tmpfs.
>> >
>> EMPHATICALLY YES.
>>
>> /tmp is defined as being volatile - stuff can disappear at any time.
>>
>> /var/tmp is defined as the place where programs store stuff like crash
>> recovery files. Mounting it tmpfs is going to screw up any programs
>> that reply on that *defined* behaviour to recover after a crash.
>>
>> Mounting /var/tmp/portage as tmpfs is perfectly fine as far as I know -
>> I do it myself.
>
> Why mess around with another tmpfs? Just set PORTAGE_TMPDIR="/tmp" in
> make.conf. Job done!

It is an interesting idea. But why it is not done by default then?

Can somebody think of a situation when it should not be done?

My /tmp is not on tmpfs currently. Only /run

May be, it is not a good idea to put /mnt on tmpfs at the time of
Spector and Meltdown?



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread Peter Humphrey
On Friday, 9 February 2018 08:11:29 GMT Neil Bothwick wrote:
> On Thu, 8 Feb 2018 23:18:19 +, Wol's lists wrote:
> > > More specifically, /var/tmp is traditionally supposed to be
> > > non-volatile (across reboots).
> > > 
> > > Comparatively the contents of /tmp can be volatile (across reboots).
> > > 
> > > I would advise against mounting /var/tmp on tmpfs.
> > 
> > EMPHATICALLY YES.
> > 
> > /tmp is defined as being volatile - stuff can disappear at any time.
> > 
> > /var/tmp is defined as the place where programs store stuff like crash
> > recovery files. Mounting it tmpfs is going to screw up any programs
> > that reply on that *defined* behaviour to recover after a crash.
> > 
> > Mounting /var/tmp/portage as tmpfs is perfectly fine as far as I know -
> > I do it myself.
> 
> Why mess around with another tmpfs? Just set PORTAGE_TMPDIR="/tmp" in
> make.conf. Job done!

Acting on the advice of various Gentoo guides, I have this:

# grep tmp /etc/fstab
tmpfs   /var/tmp/portagetmpfs   
noatime,uid=portage,gid=portage,mode=0775  0 0
tmpfs   /tmptmpfs   
noatime,nosuid,nodev,noexec,mode=1777   0 0

Are you saying I don't gain anything from it?

-- 
Regards,
Peter.



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-09 Thread Neil Bothwick
On Thu, 8 Feb 2018 23:18:19 +, Wol's lists wrote:

> > More specifically, /var/tmp is traditionally supposed to be
> > non-volatile (across reboots).
> > 
> > Comparatively the contents of /tmp can be volatile (across reboots).
> > 
> > I would advise against mounting /var/tmp on tmpfs.
> >   
> EMPHATICALLY YES.
> 
> /tmp is defined as being volatile - stuff can disappear at any time.
> 
> /var/tmp is defined as the place where programs store stuff like crash 
> recovery files. Mounting it tmpfs is going to screw up any programs
> that reply on that *defined* behaviour to recover after a crash.
> 
> Mounting /var/tmp/portage as tmpfs is perfectly fine as far as I know - 
> I do it myself.

Why mess around with another tmpfs? Just set PORTAGE_TMPDIR="/tmp" in
make.conf. Job done!


-- 
Neil Bothwick

Why do Kennedy's cry after sex? . Mace!


pgpHiNxNbQjnk.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Dale
gevisz wrote:
> 2018-02-08 21:17 GMT+02:00 Dale :
>> gevisz wrote:
>>> I never used tmpfs for portage TMPDIR before and now decided to give it a 
>>> try.
>>>
>>> I have 8GB of RAM and 12GB of swap on a separate partition.
>>>
>>> Do I correctly understood 
>>> https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs
>>> that I can safely set in the fstab the size of my tmpfs to 12GB so
>>> that the chromium
>>> could be emerged in tmpfs (using the swap) without the need to set 
>>> notmpfs.conf
>>> for chromium and the likes.
>>>
>>> And I am going to set the whole /var/tmp/ on tpmfs instead of just
>>> /var/tmp/portage
>>> Is it ok?
>> I have 16GBs of memory here and have /var/tmp/portage/ on tmpfs, no
>> ccache.  With the growing size of packages, I've had to put several on
>> regular spinning rust to make sure enough space is available.  This is
>> my list, so far.
>>
>> www-client/firefox
>> www-client/seamonkey
>> app-office/libreoffice
>> sys-devel/gcc
>> dev-qt/qtwebengine
>> dev-qt/qtwebkit
> Thank you for your reply and the notmpfs exception list.
> I think it would be helpfull not only for me.
>
>> Those are the ones that tend to run into space problems.  Keep in mind,
>> I have twice the memory you have.  As someone else pointed out, if you
>> start using swap, that generally defeats the purpose of tmpfs.
>>
>> While I'm sure plenty of packages will make good use of portage being on
>> tmpfs, there will be quite a few that will have space problems.  You
>> will need to be ready to make exceptions for those as they show up but
>> those in my list are certainly ones that you may want to add before
>> trying.  There could be exceptions to this based on your habits and
>> memory requirements for other things but that is my experience so far.
>>
>> Hope that helps.
>>
>> Dale
>>
>> :-)  :-)
>>

You will likely find that you will get some interesting ideas from
several posts and then have to bring them together to work for you. 
Sometimes, you have to mix and match to find what works for you.  If
nothing else, sometimes I post something just in case it may give a
person a light bulb moment with a idea that no one even thought to post,
including me. 

Sometimes just having a start point helps.  Heck, we all started from
nothing when it comes to Gentoo.  Some of us have been around long
enough to learn a lot but forget what we learned.  ROFL 

Dale

:-)  :-) 



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Dale
Rich Freeman wrote:
> On Thu, Feb 8, 2018 at 2:17 PM, Dale  wrote:
>> As someone else pointed out, if you
>> start using swap, that generally defeats the purpose of tmpfs.
>>
> I'll just add one thing to this, which I've probably already said ages ago:
>
> In an ideal world swap would STILL be better than building on disk,
> because it gives the kernel fewer constraints around what gets written
> to disk.
>
> Anything written to disk MUST end up on the disk within the dirty
> writeback time limit.  Anything written to tmpfs doesn't ever have to
> end up on disk, and if it is swapped the kernel need not do it in any
> particular timeframe.  Also, the swapfile doesn't need the same kinds
> of integrity features as a filesystem, which probably lowers the cost
> of writes somewhat (if nothing else after a reboot there is no need to
> run tmpreaper on it).
>
> So, swapping SHOULD still be better than building on disk, because any
> object file that doesn't end up being swapped is a saved disk IO, and
> the stuff that does get swapped will hopefully get written at a more
> opportune time vs forcing the kernel to stop what is doing after 30s
> (by default) to make sure that something gets written no matter what
> (if it wasn't deleted before then).
>
> That's all in an ideal world.  In practice I've never found the kernel
> swapping algorithms to be the best in the world, and I've seen a lot
> of situations where it hurts.  I run without a swapfile for this
> reason.  It pains me to do it because I can think of a bunch of
> reasons why this shouldn't help, and yet for whatever reason it does.
>


In my experience, once swap starts getting used, it gets slow, sometimes
to the point that a response may take several seconds or more.  When I
compile without tmpfs at all, which means everything is on disk, it's
rare that I can even tell it is using that IO for the drive.  Every once
in a while I may see a slight delay but not by much.  The worst offender
when I do see it, libreoffice.  As we all know, that is one beast of a
package.  I don't recall having problems with web browsers, yet.  Give
it time tho.  ;-) 

While you may have a point in some situations, here, it just doesn't
work that way.  As we all know tho, even if we all had the same
settings, different systems are going to work differently because of
some difference we may not be aware of.  The mileage will vary for sure. 

I might add, over the years I've changed settings to adapt my system to
give me the best response.  However, if a person built a system with
very little differences hardware and maybe even software wise, they
could still run into something different and want different settings. 
The catch is, take advice from different folks and weigh all the
options, then test things to see what works best.  It may be that one
part of your post helps, another part from mine, another part from
someone else and in the end, it leaves settings that work.  Well, on
that system and for that person at least.  ;-)

Dale

:-)  :-) 



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Wol's lists

On 09/02/18 00:02, Rich Freeman wrote:

On Thu, Feb 8, 2018 at 6:18 PM, Wol's lists  wrote:

/var/tmp is defined as the place where programs store stuff like crash
recovery files. Mounting it tmpfs is going to screw up any programs that
reply on that*defined*  behaviour to recover after a crash.


Care to cite an example of such a program in the Gentoo repo?  I
certainly can't think of any, and I've been running with /var/tmp on
tmpfs for over a decade.


I don't know of any. I was involved with the LSB ages ago, and they were 
involved with the FHS, and that was just one of the things I picked up - 
the FHS specifically says /var/tmp is for files that are temporary but 
not volatile - files that programs are supposed to clean up behind them 
but are saved if the program is prevented from deleting them.


Cheers,
Wol



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Rich Freeman
On Thu, Feb 8, 2018 at 6:18 PM, Wol's lists  wrote:
>
> /var/tmp is defined as the place where programs store stuff like crash
> recovery files. Mounting it tmpfs is going to screw up any programs that
> reply on that *defined* behaviour to recover after a crash.
>

Care to cite an example of such a program in the Gentoo repo?  I
certainly can't think of any, and I've been running with /var/tmp on
tmpfs for over a decade.

/var/cache strikes me as a much better place for some kind of recovery
file.  While /var/tmp is typically less volatile than /tmp, it isn't
really something that software should just rely on.

Perhaps FHS says otherwise, but anybody relying on FHS is going to get
burned because lots of distros purge /var/tmp.  The problem with FHS
is that nobody really bothers to try to update it any longer.
Certainly people think twice before deviating it, but they still do
from time to time, usually in the same ways that other distros
deviate.

-- 
Rich



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Grant Taylor

On 02/08/2018 04:18 PM, Wol's lists wrote:

EMPHATICALLY YES.


;-)


/tmp is defined as being volatile - stuff can disappear at any time.


I don't know that I've ever had things in /tmp disappear "at any time" 
as in randomly and without external influence.  Usually it's a reboot or 
nightly maintenance scripts cleaning up old (regular) files (as opposed 
to sockets).


/var/tmp is defined as the place where programs store stuff like crash 
recovery files. Mounting it tmpfs is going to screw up any programs that 
reply on that *defined* behaviour to recover after a crash.


Yup.

Mounting /var/tmp/portage as tmpfs is perfectly fine as far as I know - 
I do it myself.


I expect that portage, and many other programs, will recover from their 
contents under /var/tmp disappearing in between invocations.  But this 
is something that people need to be aware of.




--
Grant. . . .
unix || die



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Wol's lists

On 08/02/18 20:56, Grant Taylor wrote:

On 02/08/2018 10:11 AM, gevisz wrote:
And I am going to set the whole /var/tmp on tpmfs instead of just 
/var/tmp/portage


Is it ok?


I don't know about the context of emerging, but I do know about the 
context of /var/tmp being volatile.


More specifically, /var/tmp is traditionally supposed to be non-volatile 
(across reboots).


Comparatively the contents of /tmp can be volatile (across reboots).

I would advise against mounting /var/tmp on tmpfs.


EMPHATICALLY YES.

/tmp is defined as being volatile - stuff can disappear at any time.

/var/tmp is defined as the place where programs store stuff like crash 
recovery files. Mounting it tmpfs is going to screw up any programs that 
reply on that *defined* behaviour to recover after a crash.


Mounting /var/tmp/portage as tmpfs is perfectly fine as far as I know - 
I do it myself.


Cheers,
Wol



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread gevisz
2018-02-08 21:17 GMT+02:00 Dale :
> gevisz wrote:
>> I never used tmpfs for portage TMPDIR before and now decided to give it a 
>> try.
>>
>> I have 8GB of RAM and 12GB of swap on a separate partition.
>>
>> Do I correctly understood 
>> https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs
>> that I can safely set in the fstab the size of my tmpfs to 12GB so
>> that the chromium
>> could be emerged in tmpfs (using the swap) without the need to set 
>> notmpfs.conf
>> for chromium and the likes.
>>
>> And I am going to set the whole /var/tmp/ on tpmfs instead of just
>> /var/tmp/portage
>> Is it ok?
>
> I have 16GBs of memory here and have /var/tmp/portage/ on tmpfs, no
> ccache.  With the growing size of packages, I've had to put several on
> regular spinning rust to make sure enough space is available.  This is
> my list, so far.
>
> www-client/firefox
> www-client/seamonkey
> app-office/libreoffice
> sys-devel/gcc
> dev-qt/qtwebengine
> dev-qt/qtwebkit

Thank you for your reply and the notmpfs exception list.
I think it would be helpfull not only for me.

> Those are the ones that tend to run into space problems.  Keep in mind,
> I have twice the memory you have.  As someone else pointed out, if you
> start using swap, that generally defeats the purpose of tmpfs.
>
> While I'm sure plenty of packages will make good use of portage being on
> tmpfs, there will be quite a few that will have space problems.  You
> will need to be ready to make exceptions for those as they show up but
> those in my list are certainly ones that you may want to add before
> trying.  There could be exceptions to this based on your habits and
> memory requirements for other things but that is my experience so far.
>
> Hope that helps.
>
> Dale
>
> :-)  :-)
>



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Grant Taylor

On 02/08/2018 10:11 AM, gevisz wrote:
And I am going to set the whole /var/tmp on tpmfs instead of just 
/var/tmp/portage


Is it ok?


I don't know about the context of emerging, but I do know about the 
context of /var/tmp being volatile.


More specifically, /var/tmp is traditionally supposed to be non-volatile 
(across reboots).


Comparatively the contents of /tmp can be volatile (across reboots).

I would advise against mounting /var/tmp on tmpfs.



--
Grant. . . .
unix || die



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Rich Freeman
On Thu, Feb 8, 2018 at 2:17 PM, Dale  wrote:
> As someone else pointed out, if you
> start using swap, that generally defeats the purpose of tmpfs.
>

I'll just add one thing to this, which I've probably already said ages ago:

In an ideal world swap would STILL be better than building on disk,
because it gives the kernel fewer constraints around what gets written
to disk.

Anything written to disk MUST end up on the disk within the dirty
writeback time limit.  Anything written to tmpfs doesn't ever have to
end up on disk, and if it is swapped the kernel need not do it in any
particular timeframe.  Also, the swapfile doesn't need the same kinds
of integrity features as a filesystem, which probably lowers the cost
of writes somewhat (if nothing else after a reboot there is no need to
run tmpreaper on it).

So, swapping SHOULD still be better than building on disk, because any
object file that doesn't end up being swapped is a saved disk IO, and
the stuff that does get swapped will hopefully get written at a more
opportune time vs forcing the kernel to stop what is doing after 30s
(by default) to make sure that something gets written no matter what
(if it wasn't deleted before then).

That's all in an ideal world.  In practice I've never found the kernel
swapping algorithms to be the best in the world, and I've seen a lot
of situations where it hurts.  I run without a swapfile for this
reason.  It pains me to do it because I can think of a bunch of
reasons why this shouldn't help, and yet for whatever reason it does.

-- 
Rich



Re: [gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread Dale
gevisz wrote:
> I never used tmpfs for portage TMPDIR before and now decided to give it a try.
>
> I have 8GB of RAM and 12GB of swap on a separate partition.
>
> Do I correctly understood https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs
> that I can safely set in the fstab the size of my tmpfs to 12GB so
> that the chromium
> could be emerged in tmpfs (using the swap) without the need to set 
> notmpfs.conf
> for chromium and the likes.
>
> And I am going to set the whole /var/tmp/ on tpmfs instead of just
> /var/tmp/portage
> Is it ok?
>
>


I have 16GBs of memory here and have /var/tmp/portage/ on tmpfs, no
ccache.  With the growing size of packages, I've had to put several on
regular spinning rust to make sure enough space is available.  This is
my list, so far.

www-client/firefox
www-client/seamonkey
app-office/libreoffice
sys-devel/gcc
dev-qt/qtwebengine
dev-qt/qtwebkit 

Those are the ones that tend to run into space problems.  Keep in mind,
I have twice the memory you have.  As someone else pointed out, if you
start using swap, that generally defeats the purpose of tmpfs. 

While I'm sure plenty of packages will make good use of portage being on
tmpfs, there will be quite a few that will have space problems.  You
will need to be ready to make exceptions for those as they show up but
those in my list are certainly ones that you may want to add before
trying.  There could be exceptions to this based on your habits and
memory requirements for other things but that is my experience so far. 

Hope that helps.

Dale

:-)  :-) 



[gentoo-user] /var/tmp on tmpfs

2018-02-08 Thread gevisz
I never used tmpfs for portage TMPDIR before and now decided to give it a try.

I have 8GB of RAM and 12GB of swap on a separate partition.

Do I correctly understood https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs
that I can safely set in the fstab the size of my tmpfs to 12GB so
that the chromium
could be emerged in tmpfs (using the swap) without the need to set notmpfs.conf
for chromium and the likes.

And I am going to set the whole /var/tmp/ on tpmfs instead of just
/var/tmp/portage
Is it ok?