Re: [LSF/MM/BPF TOPIC] Large folios, swap and fscache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David,

On Fri, Feb 02, 2024 at 09:09:49AM +0000, David Howells wrote:
> Hi,
> 
> The topic came up in a recent discussion about how to deal with large folios
> when it comes to swap as a swap device is normally considered a simple array
> of PAGE_SIZE-sized elements that can be indexed by a single integer.
> 
> With the advent of large folios, however, we might need to change this in
> order to be better able to swap out a compound page efficiently.  Swap
> fragmentation raises its head, as does the need to potentially save multiple
> indices per folio.  Does swap need to grow more filesystem features?
> 
> Further to this, we have at least two ways to cache data on disk/flash/etc. -
> swap and fscache - and both want to set aside disk space for their operation.
> Might it be possible to combine the two?
> 
> One thing I want to look at for fscache is the possibility of switching from a
> file-per-object-based approach to a tagged cache more akin to the way OpenAFS
> does things.  In OpenAFS, you have a whole bunch of small files, each
> containing a single block (e.g. 256K) of data, and an index that maps a
> particular {volume,file,version,block} to one of these files in the cache.
> 
> Now, I could also consider holding all the data blocks in a single file (or
> blockdev) - and this might work for swap.  For fscache, I do, however, need to
> have some sort of integrity across reboots that swap does not require.

If my understanding is correct, I think the old swapfile approach just
works with pinned local fs extents, which means it looks up extents in
advance and it doesn't expect these extents will be moved so the real
swap data I/O paths always work without fses involved.  I don't look
into the new SWP_FS_OPS/.swap_rw way and it seems only some network
fses use it but IMHO it might have some deadlock risk if swapout
triggers local fs block allocation.  But overall I think it's a good
idea to combine the two.

Just slight off the topic: Recently I had another rough thought. As
you said, even a single fscache block or called a single fscache chunk is like
256K or whatever.

Is it possible to implement an _optional_ partial cached data uptodate
like fscache chunk vs fsblock?  For example a bitmap can be attached to
each 256K or 1M chunk. That would be much helpful.

Thanks,
Gao Xiang

> 
> David
> 




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux