Go to file
David Howells 5638b067d3 cachefiles: Calculate the blockshift in terms of bytes, not pages
Cachefiles keeps track of how much space is available on the backing
filesystem and refuses new writes permission to start if there isn't enough
(we especially don't want ENOSPC happening).  It also tracks the amount of
data pending in DIO writes (cache->b_writing) and reduces the amount of
free space available by this amount before deciding if it can set up a new
write.

However, the old fscache I/O API was very much page-granularity dependent
and, as such, cachefiles's cache->bshift was meant to be a multiplier to
get from PAGE_SIZE to block size (ie. a blocksize of 512 would give a shift
of 3 for a 4KiB page) - and this was incorrectly being used to turn the
number of bytes in a DIO write into a number of blocks, leading to a
massive over estimation of the amount of data in flight.

Fix this by changing cache->bshift to be a multiplier from bytes to
blocksize and deal with quantities of blocks, not quantities of pages.

Fix also the rounding in the calculation in cachefiles_write() which needs
a "- 1" inserting.

Fixes: 047487c947 ("cachefiles: Implement the I/O routines")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/164251398954.3435901.7138806620218474123.stgit@warthog.procyon.org.uk/ # v1
2022-01-21 21:36:28 +00:00
Documentation We have a couple patches in the framework core this time around but 2022-01-12 17:02:27 -08:00
LICENSES LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers 2021-12-16 14:33:10 +01:00
arch LED updates for 5.17. Nothing major is happening here. 2022-01-12 16:59:22 -08:00
block Convert xfs/iomap to use folios 2022-01-12 12:51:41 -08:00
certs certs: Add support for using elliptic curve keys for signing modules 2021-08-23 19:55:42 +03:00
crypto tpmdd updates for Linux v5.17 2022-01-11 12:58:41 -08:00
drivers We have a couple patches in the framework core this time around but 2022-01-12 17:02:27 -08:00
fs cachefiles: Calculate the blockshift in terms of bytes, not pages 2022-01-21 21:36:28 +00:00
include We have a couple patches in the framework core this time around but 2022-01-12 17:02:27 -08:00
init Peter Zijlstra says: 2022-01-12 16:26:58 -08:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-11-20 10:35:54 -08:00
kernel Peter Zijlstra says: 2022-01-12 16:26:58 -08:00
lib Convert much of the page cache to use folios 2022-01-12 12:37:02 -08:00
mm dax + libnvdimm for v5.17 2022-01-12 15:46:11 -08:00
net TTY/Serial driver updates for 5.17-rc1 2022-01-12 11:21:52 -08:00
samples - Get rid of all the .fixup sections because this generates 2022-01-12 16:31:19 -08:00
scripts - Get rid of all the .fixup sections because this generates 2022-01-12 16:31:19 -08:00
security fs.idmapped.v5.17 2022-01-11 14:26:55 -08:00
sound sound fixes for 5.16-rc7 2021-12-23 09:55:58 -08:00
tools - Get rid of all the .fixup sections because this generates 2022-01-12 16:31:19 -08:00
usr initramfs: Check timestamp to prevent broken cpio archive 2021-10-24 13:48:40 +09:00
virt Peter Zijlstra says: 2022-01-12 16:26:58 -08:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap media updates for v5.17-rc1 2022-01-10 18:55:43 -08:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS We have a couple patches in the framework core this time around but 2022-01-12 17:02:27 -08:00
Makefile - Get rid of all the .fixup sections because this generates 2022-01-12 16:31:19 -08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.