Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-27 Thread Chris Murphy
On Thu, Mar 24, 2022 at 6:36 AM Brad Bell  wrote:
>
> I am doing algorithmic differentiation with very large tapes and my jobs 
> sometimes run out of memory.

So the workload is producing a substantial amount of anonymous pages.
It's kinda hard to tell what to do to optimize without a decent amount
of knowledge about the workload's behavior. So you'd have to just
change some things and see if the performance improves. I tentatively
expect that you'd be better off disabling zram-generator, setting up a
swap partition or file, and optionally enabling zswap (which is a
different thing than zram). On the plus side, this frees up quite a
lot of memory (roughly half), but on the negative side it might
increase swap thrashing - it really depends on the workload. But zswap
has the benefit of using Least Recently Used (LRU) to evict pages from
the in-memory compressed cache pool to the conventional swap file.
That way it's the stale pages going to disk and the active ones being
compressed in memory.

Also, for what it's worth, on Btrfs I use /var/swap/swapfile1
/var/swap/swapfile2 ... and so on. Where "varswap" is a subvolume
located on the top-level of the file system (next to install time
default subvolumes "root" and "home") and has chattr +C set on it.
That way should I take snapshots of root (or even var in some custom
configurations) I'm not snapshotting the swapfiles. Snapshotting the
swap files ends up making them subject to COW again, and that's
incompatible with using them as swapfiles. The entry in fstab looks
like this:

UUID=$uuid /var/swap   btrfs   noatime,subvol=varswap 0 0

man 5 btrfs has a SWAPFILE SUPPORT section that's fairly detailed steps.

--
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-24 Thread George N. White III
On Thu, 24 Mar 2022 at 09:36, Brad Bell  wrote:

> I am doing algorithmic differentiation with very large tapes and my jobs
> sometimes run out of memory.
>

Sometimes software developed for small problems can benefit from
adjustments to better
manage memory for larger problems.   Swapping is a very crude process while
working at the
algorithm level you often have better control over how memory is used.

-- 
George N. White III
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-24 Thread Richard Shaw
On Thu, Mar 24, 2022 at 7:36 AM Brad Bell  wrote:

> I am doing algorithmic differentiation with very large tapes and my jobs
> sometimes run out of memory.
>

Another helpful datapoint would be how much physical memory do you have?

This use case certainly isn't a typical desktop user one and memory isn't
that expensive. I would think using physical swap would slow the process
down quite a bit.

In either case, it looks like you have your initial problem solved.

Thanks,
Richard
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-24 Thread Brad Bell

I am doing algorithmic differentiation with very large tapes and my jobs 
sometimes run out of memory.

On 3/23/22 12:51, Richard Shaw wrote:

On Wed, Mar 23, 2022 at 2:04 PM Brad Bell  wrote:

The instructions below worked for me and the created extra swap space (not 
as much as desired
but I
can fix that)

~>swapon -s
Filename                Type        Size        Used Priority
/dev/zram0              partition   8388604     390584100
/swapfile               file        65532       0       -2


What do you mean by this may not be necessary. Is there a better way to 
increase the swap space ?


To rephrase the question, how do you know you need additional swap? Are you having processes 
killed by OOM?


Thanks,
Richard

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-23 Thread Richard Shaw
On Wed, Mar 23, 2022 at 2:04 PM Brad Bell  wrote:

> The instructions below worked for me and the created extra swap space (not
> as much as desired but I
> can fix that)
>
> ~>swapon -s
> FilenameTypeSizeUsedPriority
> /dev/zram0  partition   8388604 390584100
> /swapfile   file65532   0   -2
>
>
> What do you mean by this may not be necessary. Is there a better way to
> increase the swap space ?
>

To rephrase the question, how do you know you need additional swap? Are you
having processes killed by OOM?

Thanks,
Richard
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-23 Thread Brad Bell
The instructions below worked for me and the created extra swap space (not as much as desired but I 
can fix that)


~>swapon -s
FilenameTypeSizeUsedPriority
/dev/zram0  partition   8388604 390584100
/swapfile   file65532   0   -2


What do you mean by this may not be necessary. Is there a better way to 
increase the swap space ?

On 3/23/22 04:55, Matti Pulkkinen wrote:

One reason this could happen is if you're trying to create the swapfile
on a btrfs filesystem. In that case you'll need to disable copy-on-
write on that file first:

1. truncate -s 0 /swapfile
2. chattr +C /swapfile
3. dd if=/dev/zero of=/swapfile bs=1024 count=65536
4. chmod 600 /swapfile
5. mkswap /swapfile
6. swapon /swapfile


However, all of this this may not be necessary, since recent releases
of Fedora have zram swap enabled by default anyway.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-23 Thread Matti Pulkkinen
ke, 2022-03-23 kello 11:40 +, bradb...@seanet.com kirjoitti:
> I am trying to create a swapfile on my fedora 35 system and do not
> know what I am doing wrong:
> trash>uname -a
> Linux fedora 5.16.15-201.fc35.x86_64 #1 SMP PREEMPT Thu Mar 17
> 05:45:13 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
> 
> If I follow the swapfile instructions on
> https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-creating-file.html
> I get the following result:
> 
> step 1:
> trash>sudo dd if=/dev/zero of=/swapfile bs=1024 count=65536
> 65536+0 records in
> 65536+0 records out
> 67108864 bytes (67 MB, 64 MiB) copied, 0.147119 s, 456 MB/s
> 
> step 2:
> trash>sudo mkswap /swapfile
> mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600
> /swapfile
> Setting up swapspace version 1, size = 64 MiB (67104768 bytes)
> no label, UUID=f1402a6a-c64c-4f84-9d47-4f8822d2f1d2
> 
> step 3:
> sudo  chmod 0600 /swapfile
> 
> step 4:
> trash>sudo swapon /swapfile
> swapon: /swapfile: swapon failed: Invalid argument
> 

One reason this could happen is if you're trying to create the swapfile
on a btrfs filesystem. In that case you'll need to disable copy-on-
write on that file first:

1. truncate -s 0 /swapfile
2. chattr +C /swapfile
3. dd if=/dev/zero of=/swapfile bs=1024 count=65536
4. chmod 600 /swapfile
5. mkswap /swapfile
6. swapon /swapfile


However, all of this this may not be necessary, since recent releases
of Fedora have zram swap enabled by default anyway.

-- 
Terveisin / Regards,
Matti Pulkkinen

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-23 Thread George N. White III
On Wed, 23 Mar 2022 at 08:41,  wrote:

> I am trying to create a swapfile on my fedora 35 system and do not know
> what I am doing wrong:
> trash>uname -a
> Linux fedora 5.16.15-201.fc35.x86_64 #1 SMP PREEMPT Thu Mar 17 05:45:13
> UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
>
> Why do you need to create a swapfile?  Such details are normally handled
by the installer in a way that works for
the majority of users.   Is your F35 a fresh install or upgrade?


> If I follow the swapfile instructions on
>
> https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-creating-file.html


It is unwise to apply Fedora 14 documentation on Fedora 35 -- a lot has
changed.  Are you using the default brtfs
filesystem?   On my F35 system with btrfs (and 16GB RAM):

 % swapon -s
FilenameTypeSize
UsedPriority
/dev/zram0  partition   8388604
 30208   100

Linux Performance: Almost Always Add Swap. Part 2: ZRAM (haydenjames.io)



> I get the following result:
>
> step 1:
> trash>sudo dd if=/dev/zero of=/swapfile bs=1024 count=65536
> 65536+0 records in
> 65536+0 records out
> 67108864 bytes (67 MB, 64 MiB) copied, 0.147119 s, 456 MB/s
>
> step 2:
> trash>sudo mkswap /swapfile
> mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600
> /swapfile
> Setting up swapspace version 1, size = 64 MiB (67104768 bytes)
> no label, UUID=f1402a6a-c64c-4f84-9d47-4f8822d2f1d2
>
> step 3:
> sudo  chmod 0600 /swapfile
>
> step 4:
> trash>sudo swapon /swapfile
> swapon: /swapfile: swapon failed: Invalid argument
>


-- 
George N. White III
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Fedora 35 swapon: /swapfile: swapon failed: Invalid argument

2022-03-23 Thread bradbell
I am trying to create a swapfile on my fedora 35 system and do not know what I 
am doing wrong:
trash>uname -a
Linux fedora 5.16.15-201.fc35.x86_64 #1 SMP PREEMPT Thu Mar 17 05:45:13 UTC 
2022 x86_64 x86_64 x86_64 GNU/Linux

If I follow the swapfile instructions on
https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s2-swap-creating-file.html
I get the following result:

step 1:
trash>sudo dd if=/dev/zero of=/swapfile bs=1024 count=65536
65536+0 records in
65536+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.147119 s, 456 MB/s

step 2:
trash>sudo mkswap /swapfile
mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600 /swapfile
Setting up swapspace version 1, size = 64 MiB (67104768 bytes)
no label, UUID=f1402a6a-c64c-4f84-9d47-4f8822d2f1d2

step 3:
sudo  chmod 0600 /swapfile

step 4:
trash>sudo swapon /swapfile
swapon: /swapfile: swapon failed: Invalid argument
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure