-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I'm announcing the release of the 5.4.130 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
Thanks,
Sasha
- ------------
Makefile | 2 +-
drivers/gpio/Kconfig | 2 ++
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++--
drivers/infiniband/hw/mlx5/flow.c | 8 ++++++++
drivers/scsi/sr.c | 2 ++
security/integrity/platform_certs/load_uefi.c | 5 -----
6 files changed, 15 insertions(+), 8 deletions(-)
Christian König (1):
drm/nouveau: fix dma_address check for CPU/GPU sync
Johannes Berg (1):
gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP
ManYi Li (1):
scsi: sr: Return appropriate error code when disk is ejected
Mark Bloch (1):
RDMA/mlx5: Block FDB rules when not in switchdev mode
Sasha Levin (1):
Linux 5.4.130
YueHaibing (1):
x86/efi: remove unused variables
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAmDlopkACgkQ3qZv95d3
LNxXEg//cOzICk7j6/qzijKVxiuJC3YBJ99U05fap7EjShpomDrxs9q4yhbOeBAn
Q7GdF8XDa4si/32T0fAojLKLWMvGN6gwjIm1mKFPcSte2lLiO3KnlQubjdo2dwJi
VFtmkMd+Op+77WhzFBpEYRiFisnzg4376eQIp/rzxC64faVkbp8mobtq0KCTIvqv
OT05R1Z/DMR2pl5vI1ho592oVvl4FbWWZJRcTc05RAzdPpOsFqmJZkIua5Q0GQzo
iovxwsVz7cH7RMcXIQ65emuNFIFlB1qfKfA1VR/WPxuj/gmtOJth2mU0+BO5qSYK
9z1mbCUFjEDjgI2dBshNzlKIERoo6tExWiy6BOmuQyf5KTzJLpaLtLXvxygak6GB
FT3rGmcV85ec4wAgHeFgBeEJWyMgmgiNopx0intVkNwhx7Ulsg3aB8vrMwn+QJSN
2kPA/rip8VEignB2wzw0o/0yiAp2tjszcpwTFVIjo7JnfzjDyhzANdslEFu+yjUm
FomT+mXe/yGfoKHl8YqXYaVntu/YGbocd2pGg5337zwFimR88YfVpfAezTmnrg8L
8xI8q7v3b8vcXzxCbLE801tMuU1gKFj9m7/DAWp+F/ak9jV0M7lelnpGF3lr4DDP
3MU6J+Y4faiC2LT6KcRaBkoPXPXVdYjH9yYA+l8jwaAbDK3fFCE=
=60Aw
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I'm announcing the release of the 5.10.48 kernel.
All users of the 5.10 kernel series must upgrade.
The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
Thanks,
Sasha
- ------------
Makefile | 2 +-
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/mmu/mmu.c | 1 +
drivers/gpio/Kconfig | 2 ++
drivers/gpio/gpio-mxc.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++--
drivers/infiniband/hw/mlx5/fs.c | 7 +++++++
drivers/scsi/sr.c | 2 ++
8 files changed, 17 insertions(+), 4 deletions(-)
Christian König (1):
drm/nouveau: fix dma_address check for CPU/GPU sync
Johannes Berg (1):
gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP
Loic Poulain (1):
gpio: mxc: Fix disabled interrupt wake-up support
ManYi Li (1):
scsi: sr: Return appropriate error code when disk is ejected
Mark Bloch (1):
RDMA/mlx5: Block FDB rules when not in switchdev mode
Sasha Levin (1):
Linux 5.10.48
Sean Christopherson (1):
Revert "KVM: x86/mmu: Drop kvm_mmu_extended_role.cr4_la57 hack"
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAmDloocACgkQ3qZv95d3
LNxeRQ/9HzdDMiAxylshAGkKq+cx9Wxk3LdksMUWwfskZKnCs5rwCWT3zSafGDdX
bePEtdVsFGBEnKc0SZ2O/kR0plG967vGUSllB27QYa/e+QTCQt2JIn4X8J+s64hj
XS1Z39+sXYy6YNjam2DgPrG9nEDJLNkxO7E/4hhcPhToDXKtn2Zk+ZBpp3qVPOJa
cW/OXRSm0dlDWvDs8ELOzLoPpI67BMXUI+GhROZOgPP97aADbC2Tucy8QtAJilFa
jb5a8vZhvYIzmnKLcKNc+bACpbPtNyRq4glO/AeGlQHCIyZe06D5+fGQNU5r5oCy
DaViYl6sx/TpHHqSBcTnMmhCIbo5KPYvyMiYKlhEieAQDbuQX7VZSVRo2IANOqm3
yvX3A7vRRF5Pbvg2dGhubLlhB9tsP67/j9AZ14B5IIjapQAoLct19F1W5C7ochHr
CNyUAmusfneXyLb9ZOW1GRiP1oSiOB5NZMF380ObSqxQUP0YoH7A/H9YMGiiScyl
5jZzJ/bbQzQIjz72eyVca88wEWtpJynQDRTqRRbm3OPZ3C6OSXsOIB0X7RRfM/EF
PMMS7hH5INPvpsMvurgyHsUtlDm8JBe3nQUchf3bhqPHsRVJqwfO9IpCjwym1/o9
g7gVvaSl5airLyVJf8k4Q8WMNywkD92g8xE9Al51Rk3dn4uNYJk=
=4Xvv
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I'm announcing the release of the 5.12.15 kernel.
All users of the 5.12 kernel series must upgrade.
The updated 5.12.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.12.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
Thanks,
Sasha
- ------------
Makefile | 2 +-
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/mmu/mmu.c | 1 +
drivers/gpio/Kconfig | 2 ++
drivers/gpio/gpio-mxc.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++--
drivers/s390/crypto/vfio_ap_ops.c | 10 ----------
drivers/scsi/sr.c | 2 ++
8 files changed, 10 insertions(+), 14 deletions(-)
Christian König (1):
drm/nouveau: fix dma_address check for CPU/GPU sync
Johannes Berg (1):
gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP
Loic Poulain (1):
gpio: mxc: Fix disabled interrupt wake-up support
ManYi Li (1):
scsi: sr: Return appropriate error code when disk is ejected
Sasha Levin (1):
Linux 5.12.15
Sean Christopherson (1):
Revert "KVM: x86/mmu: Drop kvm_mmu_extended_role.cr4_la57 hack"
Tony Krowiak (1):
s390/vfio-ap: clean up mdev resources when remove callback invoked
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAmDlonYACgkQ3qZv95d3
LNxTRQ/+KvXQgHRTDTcMYUU3hj6OkXbR2t/oz2lsWKdXFPqirN9TF5D0S7El1Xh7
PKhQmvozwKiJhfwE3J0QYmIkce5rm/DL2tcvrBHo4O1L883/xv5rd4St2JBHJ4ns
B3BgJ7VwdsxtVU8d2Rgogpxawwh4Tf1peSL08UwXgh3rF4554O9N6OuuSydFX552
Bd01LBkdmEhj0Wm1ma1WF5u86Pk/W8BYhtrUlcmpydAMnz3s5X459e8wSbKbP7Mp
vtPOx9MltRaqKRcyVH1Yb5Ryy6Q/TBKWtFfB9hnlMcU7VYAVCRxKxEFuMhia7ZES
DcmF8XRQx9+mnbvOlRXv0BMVSHbfbg9OjfZklCKJ6kTcyTODvCMx395UBVxNbiMB
pvc3XNUxx8bmO/LwzfP+7Bw74AQumpVMnS4aJkffaOPRxvep32NJ2QZUgU/nIs2Y
9EaToL+srZljcnCfR/KmCvpBbAuJp6cEcrd3SxhuSj42/1O/xa8tM+DflyoDUNXu
/EUbSt2ncGdcGy0DmLyIkV31YcWosdS9LIrqAjozbJXjaEdvfk9l0XxOvgb0udJF
MIEjrSmz7voMkd+8D1RjejzztcbCXNx8OhJNreOvCWaRrVSGv8+qtFOcKDAEKc4Q
dML5t7hGeusLY+KQ592vdGG0RAUpka6q/q48Pp70/jF0PS4GyhU=
=gaYx
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I'm announcing the release of the 5.13.1 kernel.
All users of the 5.13 kernel series must upgrade.
The updated 5.13.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.13.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
Thanks,
Sasha
- ------------
Makefile | 2 +-
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/mmu/mmu.c | 1 +
mm/page_alloc.c | 2 +-
4 files changed, 4 insertions(+), 2 deletions(-)
Mel Gorman (1):
mm/page_alloc: correct return value of populated elements if bulk array is populated
Sasha Levin (1):
Linux 5.13.1
Sean Christopherson (1):
Revert "KVM: x86/mmu: Drop kvm_mmu_extended_role.cr4_la57 hack"
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAmDlolkACgkQ3qZv95d3
LNyHdw//Yv2YwPIPDRntmmSPZE2E0MwOZu+W2B+OoKJHJ8MJeYpMwoNwObwqoa7u
7oxHuiUgQ7iTBcvDdvwLCDAKZkIa6sm5WAb3x5qzmvQNYIAWsQrsHo42A1yhMLIT
YMuo7GQkn5E9WNs+aOGrI38Ea91Ckdd5GcwsKRcXuY30phvnzTEVoXKdLzFJFOWk
O/8nbDT1X+msLxndzwW/Vl4AAiaYbnQpzSyhFiswD4r0jYL5yg1jc2UaWUxSP+yj
mbgZ2QQAHh1dvE4rzPyl6tmFhVDg+yiT6UO1f7tont8FA4dUdJ4sJDW2QINKXRxf
RwEY6fsU9kcpH2IfZa25Fi2E+kesKEeT0a/uCGJOYmZZkXfPtnlNHE4FVlKdtlRh
q761ApqR5JGOXSE08iSxTMXJNsbyGxG4CYP8vbUhYm/wIJbOqBCF9DOkH7sr5MA4
TyWuG4uexfmE00dWfljuAma07Sd4F+mILsC/55O9lQt80aiSRUsuoFM6e7FQmBgj
g7uSEzm476z/4B+v1ewjPfT6gw4KGahV9a6EfSztm/JdvotFaImkjdYneGuSkmaF
56rt3ZF+7LD05mK9/nQd713F2hOD6yVzyIiWiSzO9250qRMb3SR0xjaUC9iKpuQb
/VkcKU+yMLbZnZwoBONedk/gfnKpvjzo/9EBBWOLyln0FWVuBdA=
=QsF8
-----END PGP SIGNATURE-----
This is the start of the stable review cycle for the 5.10.48 release.
There are 7 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed 07 Jul 2021 10:59:49 AM UTC.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
Thanks,
Sasha
-------------
Pseudo-Shortlog of commits:
Christian König (1):
drm/nouveau: fix dma_address check for CPU/GPU sync
Johannes Berg (1):
gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP
Loic Poulain (1):
gpio: mxc: Fix disabled interrupt wake-up support
ManYi Li (1):
scsi: sr: Return appropriate error code when disk is ejected
Mark Bloch (1):
RDMA/mlx5: Block FDB rules when not in switchdev mode
Sasha Levin (1):
Linux 5.10.48-rc1
Sean Christopherson (1):
Revert "KVM: x86/mmu: Drop kvm_mmu_extended_role.cr4_la57 hack"
Makefile | 4 ++--
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/mmu/mmu.c | 1 +
drivers/gpio/Kconfig | 2 ++
drivers/gpio/gpio-mxc.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++--
drivers/infiniband/hw/mlx5/fs.c | 7 +++++++
drivers/scsi/sr.c | 2 ++
8 files changed, 18 insertions(+), 5 deletions(-)
--
2.30.2
This is the start of the stable review cycle for the 5.12.15 release.
There are 7 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed 07 Jul 2021 10:59:20 AM UTC.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.12.y
and the diffstat can be found below.
Thanks,
Sasha
-------------
Pseudo-Shortlog of commits:
Christian König (1):
drm/nouveau: fix dma_address check for CPU/GPU sync
Johannes Berg (1):
gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP
Loic Poulain (1):
gpio: mxc: Fix disabled interrupt wake-up support
ManYi Li (1):
scsi: sr: Return appropriate error code when disk is ejected
Sasha Levin (1):
Linux 5.12.15-rc1
Sean Christopherson (1):
Revert "KVM: x86/mmu: Drop kvm_mmu_extended_role.cr4_la57 hack"
Tony Krowiak (1):
s390/vfio-ap: clean up mdev resources when remove callback invoked
Makefile | 4 ++--
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/mmu/mmu.c | 1 +
drivers/gpio/Kconfig | 2 ++
drivers/gpio/gpio-mxc.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++--
drivers/s390/crypto/vfio_ap_ops.c | 10 ----------
drivers/scsi/sr.c | 2 ++
8 files changed, 11 insertions(+), 15 deletions(-)
--
2.30.2
This is the start of the stable review cycle for the 5.13.1 release.
There are 2 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed 07 Jul 2021 10:49:46 AM UTC.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.13.y
and the diffstat can be found below.
Thanks,
Sasha
-------------
Pseudo-Shortlog of commits:
Sasha Levin (1):
Linux 5.13.1-rc1
Sean Christopherson (1):
Revert "KVM: x86/mmu: Drop kvm_mmu_extended_role.cr4_la57 hack"
Makefile | 4 ++--
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/mmu/mmu.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
--
2.30.2
We use the async_delalloc_pages mechanism to make sure that we've
completed our async work before trying to continue our delalloc
flushing. The reason for this is we need to see any ordered extents
that were created by our delalloc flushing. However we're waking up
before we do the submit work, which is before we create the ordered
extents. This is a pretty wide race window where we could potentially
think there are no ordered extents and thus exit shrink_delalloc
prematurely. Fix this by waking us up after we've done the work to
create ordered extents.
cc: stable(a)vger.kernel.org
Signed-off-by: Josef Bacik <josef(a)toxicpanda.com>
---
fs/btrfs/inode.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b1f02e3fea5d..e388153c4ae4 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1290,11 +1290,6 @@ static noinline void async_cow_submit(struct btrfs_work *work)
nr_pages = (async_chunk->end - async_chunk->start + PAGE_SIZE) >>
PAGE_SHIFT;
- /* atomic_sub_return implies a barrier */
- if (atomic_sub_return(nr_pages, &fs_info->async_delalloc_pages) <
- 5 * SZ_1M)
- cond_wake_up_nomb(&fs_info->async_submit_wait);
-
/*
* ->inode could be NULL if async_chunk_start has failed to compress,
* in which case we don't have anything to submit, yet we need to
@@ -1303,6 +1298,11 @@ static noinline void async_cow_submit(struct btrfs_work *work)
*/
if (async_chunk->inode)
submit_compressed_extents(async_chunk);
+
+ /* atomic_sub_return implies a barrier */
+ if (atomic_sub_return(nr_pages, &fs_info->async_delalloc_pages) <
+ 5 * SZ_1M)
+ cond_wake_up_nomb(&fs_info->async_submit_wait);
}
static noinline void async_cow_free(struct btrfs_work *work)
--
2.26.3
We have been hitting some early ENOSPC issues in production with more
recent kernels, and I tracked it down to us simply not flushing delalloc
as aggressively as we should be. With tracing I was seeing us failing
all tickets with all of the block rsvs at or around 0, with very little
pinned space, but still around 120MiB of outstanding bytes_may_used.
Upon further investigation I saw that we were flushing around 14 pages
per shrink call for delalloc, despite having around 2GiB of delalloc
outstanding.
Consider the example of a 8 way machine, all CPUs trying to create a
file in parallel, which at the time of this commit requires 5 items to
do. Assuming a 16k leaf size, we have 10MiB of total metadata reclaim
size waiting on reservations. Now assume we have 128MiB of delalloc
outstanding. With our current math we would set items to 20, and then
set to_reclaim to 20 * 256k, or 5MiB.
Assuming that we went through this loop all 3 times, for both
FLUSH_DELALLOC and FLUSH_DELALLOC_WAIT, and then did the full loop
twice, we'd only flush 60MiB of the 128MiB delalloc space. This could
leave a fair bit of delalloc reservations still hanging around by the
time we go to ENOSPC out all the remaining tickets.
Fix this two ways. First, change the calculations to be a fraction of
the total delalloc bytes on the system. Prior to this change we were
calculating based on dirty inodes so our math made more sense, now it's
just completely unrelated to what we're actually doing.
Second add a FLUSH_DELALLOC_FULL state, that we hold off until we've
gone through the flush states at least once. This will empty the system
of all delalloc so we're sure to be truly out of space when we start
failing tickets.
I'm tagging stable 5.10 and forward, because this is where we started
using the page stuff heavily again. This affects earlier kernel
versions as well, but would be a pain to backport to them as the
flushing mechanisms aren't the same.
CC: stable(a)vger.kernel.org # 5.10+
Signed-off-by: Josef Bacik <josef(a)toxicpanda.com>
---
fs/btrfs/ctree.h | 9 +++++----
fs/btrfs/space-info.c | 35 ++++++++++++++++++++++++++---------
include/trace/events/btrfs.h | 1 +
3 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index d7ef4d7d2c1a..232ff1a49ca6 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2783,10 +2783,11 @@ enum btrfs_flush_state {
FLUSH_DELAYED_REFS = 4,
FLUSH_DELALLOC = 5,
FLUSH_DELALLOC_WAIT = 6,
- ALLOC_CHUNK = 7,
- ALLOC_CHUNK_FORCE = 8,
- RUN_DELAYED_IPUTS = 9,
- COMMIT_TRANS = 10,
+ FLUSH_DELALLOC_FULL = 7,
+ ALLOC_CHUNK = 8,
+ ALLOC_CHUNK_FORCE = 9,
+ RUN_DELAYED_IPUTS = 10,
+ COMMIT_TRANS = 11,
};
int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index af161eb808a2..0c539a94c6d9 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -494,6 +494,9 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info,
long time_left;
int loops;
+ delalloc_bytes = percpu_counter_sum_positive(&fs_info->delalloc_bytes);
+ ordered_bytes = percpu_counter_sum_positive(&fs_info->ordered_bytes);
+
/* Calc the number of the pages we need flush for space reservation */
if (to_reclaim == U64_MAX) {
items = U64_MAX;
@@ -501,19 +504,21 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info,
/*
* to_reclaim is set to however much metadata we need to
* reclaim, but reclaiming that much data doesn't really track
- * exactly, so increase the amount to reclaim by 2x in order to
- * make sure we're flushing enough delalloc to hopefully reclaim
- * some metadata reservations.
+ * exactly. What we really want to do is reclaim full inode's
+ * worth of reservations, however that's not available to us
+ * here. We will take a fraction of the delalloc bytes for our
+ * flushing loops and hope for the best. Delalloc will expand
+ * the amount we write to cover an entire dirty extent, which
+ * will reclaim the metadata reservation for that range. If
+ * it's not enough subsequent flush stages will be more
+ * aggressive.
*/
+ to_reclaim = max(to_reclaim, delalloc_bytes >> 3);
items = calc_reclaim_items_nr(fs_info, to_reclaim) * 2;
- to_reclaim = items * EXTENT_SIZE_PER_ITEM;
}
trans = (struct btrfs_trans_handle *)current->journal_info;
- delalloc_bytes = percpu_counter_sum_positive(
- &fs_info->delalloc_bytes);
- ordered_bytes = percpu_counter_sum_positive(&fs_info->ordered_bytes);
if (delalloc_bytes == 0 && ordered_bytes == 0)
return;
@@ -596,8 +601,11 @@ static void flush_space(struct btrfs_fs_info *fs_info,
break;
case FLUSH_DELALLOC:
case FLUSH_DELALLOC_WAIT:
+ case FLUSH_DELALLOC_FULL:
+ if (state == FLUSH_DELALLOC_FULL)
+ num_bytes = U64_MAX;
shrink_delalloc(fs_info, space_info, num_bytes,
- state == FLUSH_DELALLOC_WAIT, for_preempt);
+ state != FLUSH_DELALLOC, for_preempt);
break;
case FLUSH_DELAYED_REFS_NR:
case FLUSH_DELAYED_REFS:
@@ -907,6 +915,14 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work)
commit_cycles--;
}
+ /*
+ * We do not want to empty the system of delalloc unless we're
+ * under heavy pressure, so allow one trip through the flushing
+ * logic before we start doing a FLUSH_DELALLOC_FULL.
+ */
+ if (flush_state == FLUSH_DELALLOC_FULL && !commit_cycles)
+ flush_state++;
+
/*
* We don't want to force a chunk allocation until we've tried
* pretty hard to reclaim space. Think of the case where we
@@ -1070,7 +1086,7 @@ static void btrfs_preempt_reclaim_metadata_space(struct work_struct *work)
* so if we now have space to allocate do the force chunk allocation.
*/
static const enum btrfs_flush_state data_flush_states[] = {
- FLUSH_DELALLOC_WAIT,
+ FLUSH_DELALLOC_FULL,
RUN_DELAYED_IPUTS,
COMMIT_TRANS,
ALLOC_CHUNK_FORCE,
@@ -1159,6 +1175,7 @@ static const enum btrfs_flush_state evict_flush_states[] = {
FLUSH_DELAYED_REFS,
FLUSH_DELALLOC,
FLUSH_DELALLOC_WAIT,
+ FLUSH_DELALLOC_FULL,
ALLOC_CHUNK,
COMMIT_TRANS,
};
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 3d81ba8c37b9..ddf5c250726c 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -94,6 +94,7 @@ struct btrfs_space_info;
EM( FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS") \
EM( FLUSH_DELALLOC, "FLUSH_DELALLOC") \
EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \
+ EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \
EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \
EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \
EM( ALLOC_CHUNK, "ALLOC_CHUNK") \
--
2.26.3