If the size configured for tmpfs is bigger than the size of RAM, and there is a lot of stuff stored there in the tmpfs, how is the amount of RAM available to applications determined? If applications need more memory then, does system only have swap memory to offer, or can tmpfs free RAM for applications? I think it is more important to run applications in RAM than have a file system in RAM. Does setting of swappiness affect applications only or tmpfs, too?
The content of a tmpfs filesystem is split between RAM and swap, just like the memory of processes is split between RAM and swap. All data has to be in RAM when it's used. If there isn't enough room, the kernel moves data to swap. The basic idea is that the data that hasn't been used in the longest time gets moved to swap first, regardless of whether it's process memory or tmpfs content.