linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Josef Bacik <jbacik@fb.com>, Nikolay Borisov <nborisov@suse.com>,
	David Sterba <dsterba@suse.com>, Sasha Levin <sashal@kernel.org>,
	linux-btrfs@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 031/127] btrfs: only track ref_heads in delayed_ref_updates
Date: Fri, 22 Nov 2019 00:54:09 -0500	[thread overview]
Message-ID: <20191122055544.3299-30-sashal@kernel.org> (raw)
In-Reply-To: <20191122055544.3299-1-sashal@kernel.org>

From: Josef Bacik <jbacik@fb.com>

[ Upstream commit 158ffa364bf723fa1ef128060646d23dc3942994 ]

We use this number to figure out how many delayed refs to run, but
__btrfs_run_delayed_refs really only checks every time we need a new
delayed ref head, so we always run at least one ref head completely no
matter what the number of items on it.  Fix the accounting to only be
adjusted when we add/remove a ref head.

In addition to using this number to limit the number of delayed refs
run, a future patch is also going to use it to calculate the amount of
space required for delayed refs space reservation.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/delayed-ref.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 93ffa898df6d8..d56bd36254681 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -195,8 +195,6 @@ static inline void drop_delayed_ref(struct btrfs_trans_handle *trans,
 	ref->in_tree = 0;
 	btrfs_put_delayed_ref(ref);
 	atomic_dec(&delayed_refs->num_entries);
-	if (trans->delayed_ref_updates)
-		trans->delayed_ref_updates--;
 }
 
 static bool merge_ref(struct btrfs_trans_handle *trans,
@@ -458,7 +456,6 @@ add_delayed_ref_tail_merge(struct btrfs_trans_handle *trans,
 	if (ref->action == BTRFS_ADD_DELAYED_REF)
 		list_add_tail(&ref->add_list, &href->ref_add_list);
 	atomic_inc(&root->num_entries);
-	trans->delayed_ref_updates++;
 	spin_unlock(&href->lock);
 	return ret;
 }
-- 
2.20.1


  parent reply	other threads:[~2019-11-22  5:56 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  5:53 [PATCH AUTOSEL 4.14 001/127] scsi: lpfc: Fix kernel Oops due to null pring pointers Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 002/127] scsi: lpfc: Fix dif and first burst use in write commands Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 003/127] ARM: dts: Fix up SQ201 flash access Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 005/127] ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 006/127] parisc: Fix serio address output Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 007/127] parisc: Fix HP SDC hpa " Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 008/127] arm64: mm: Prevent mismatched 52-bit VA support Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 009/127] arm64: smp: Handle errors reported by the firmware Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 010/127] ARM: OMAP1: fix USB configuration for device-only setups Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 011/127] RDMA/vmw_pvrdma: Use atomic memory allocation in create AH Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 012/127] PM / AVS: SmartReflex: NULL check before some freeing functions is not needed Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 013/127] ARM: ks8695: fix section mismatch warning Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 014/127] ACPI / LPSS: Ignore acpi_device_fix_up_power() return value Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 015/127] scsi: lpfc: Enable Management features for IF_TYPE=6 Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 016/127] crypto: user - support incremental algorithm dumps Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 017/127] mwifiex: fix potential NULL dereference and use after free Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 018/127] mwifiex: debugfs: correct histogram spacing, formatting Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 019/127] rtl818x: fix potential use after free Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 020/127] xfs: require both realtime inodes to mount Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 021/127] ubi: Put MTD device after it is not used Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 022/127] ubi: Do not drop UBI device reference before using Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 023/127] microblaze: adjust the help to the real behavior Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 024/127] microblaze: move "... is ready" messages to arch/microblaze/Makefile Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 025/127] iwlwifi: move iwl_nvm_check_version() into dvm Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 026/127] gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 027/127] kvm: vmx: Set IA32_TSC_AUX for legacy mode guests Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 028/127] VSOCK: bind to random port for VMADDR_PORT_ANY Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 029/127] mmc: meson-gx: make sure the descriptor is stopped on errors Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 030/127] mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET Sasha Levin
2019-11-22  5:54 ` Sasha Levin [this message]
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 032/127] HID: intel-ish-hid: fixes incorrect error handling Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 033/127] serial: 8250: Rate limit serial port rx interrupts during input overruns Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 034/127] kprobes/x86/xen: blacklist non-attachable xen interrupt functions Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 035/127] xen/pciback: Check dev_data before using it Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 036/127] vfio-mdev/samples: Use u8 instead of char for handle functions Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 037/127] pinctrl: xway: fix gpio-hog related boot issues Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 038/127] net/mlx5: Continue driver initialization despite debugfs failure Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 039/127] exofs_mount(): fix leaks on failure exits Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 040/127] bnxt_en: Return linux standard errors in bnxt_ethtool.c Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 041/127] bnxt_en: query force speeds before disabling autoneg mode Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 042/127] KVM: s390: unregister debug feature on failing arch init Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 043/127] pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 044/127] pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10 Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 045/127] HID: doc: fix wrong data structure reference for UHID_OUTPUT Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 046/127] dm flakey: Properly corrupt multi-page bios Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 047/127] gfs2: take jdata unstuff into account in do_grow Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 048/127] xfs: Align compat attrlist_by_handle with native implementation Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 049/127] xfs: Fix bulkstat compat ioctls on x32 userspace Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 050/127] IB/qib: Fix an error code in qib_sdma_verbs_send() Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 051/127] clocksource/drivers/fttmr010: Fix invalid interrupt register access Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 052/127] vxlan: Fix error path in __vxlan_dev_create() Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 053/127] powerpc/book3s/32: fix number of bats in p/v_block_mapped() Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 054/127] powerpc/xmon: fix dump_segments() Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 055/127] drivers/regulator: fix a missing check of return value Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 056/127] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 057/127] serial: max310x: Fix tx_empty() callback Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 058/127] openrisc: Fix broken paths to arch/or32 Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 059/127] RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 060/127] scsi: qla2xxx: deadlock by configfs_depend_item Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 061/127] scsi: csiostor: fix incorrect dma device in case of vport Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 062/127] ath6kl: Only use match sets when firmware supports it Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 063/127] ath6kl: Fix off by one error in scan completion Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 064/127] powerpc/perf: Fix unit_sel/cache_sel checks Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 065/127] powerpc/prom: fix early DEBUG messages Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 066/127] powerpc/mm: Make NULL pointer deferences explicit on bad page faults Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 067/127] powerpc/44x/bamboo: Fix PCI range Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 068/127] vfio/spapr_tce: Get rid of possible infinite loop Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 069/127] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 070/127] drbd: ignore "all zero" peer volume sizes in handshake Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 071/127] drbd: reject attach of unsuitable uuids even if connected Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 072/127] drbd: do not block when adjusting "disk-options" while IO is frozen Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 073/127] drbd: fix print_st_err()'s prototype to match the definition Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 074/127] IB/rxe: Make counters thread safe Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 075/127] regulator: tps65910: fix a missing check of return value Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 076/127] powerpc/83xx: handle machine check caused by watchdog timer Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 077/127] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 078/127] crypto: mxc-scc - fix build warnings on ARM64 Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 079/127] MIPS: BCM63XX: fix switch core reset on BCM6368 Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 080/127] pwm: clps711x: Fix period calculation Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 081/127] net/netlink_compat: Fix a missing check of nla_parse_nested Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 082/127] net/net_namespace: Check the return value of register_pernet_subsys() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 083/127] f2fs: fix to dirty inode synchronously Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 084/127] um: Make GCOV depend on !KCOV Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 085/127] net: (cpts) fix a missing check of clk_prepare Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 086/127] net: stmicro: " Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 087/127] net: dsa: bcm_sf2: Propagate error value from mdio_write Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 088/127] atl1e: checking the status of atl1e_write_phy_reg Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 089/127] tipc: fix a missing check of genlmsg_put Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 090/127] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 091/127] ocfs2: clear journal dirty flag after shutdown journal Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 092/127] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 093/127] lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 094/127] lib/genalloc.c: use vzalloc_node() to allocate the bitmap Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 095/127] fork: fix some -Wmissing-prototypes warnings Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 096/127] drivers/base/platform.c: kmemleak ignore a known leak Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 097/127] lib/genalloc.c: include vmalloc.h Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 098/127] mtd: Check add_mtd_device() ret code Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 099/127] tipc: fix memory leak in tipc_nl_compat_publ_dump Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 100/127] net/core/neighbour: tell kmemleak about hash tables Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 101/127] PCI/MSI: Return -ENOSPC from pci_alloc_irq_vectors_affinity() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 102/127] net/core/neighbour: fix kmemleak minimal reference count for hash tables Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 103/127] serial: 8250: Fix serial8250 initialization crash Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 104/127] gpu: ipu-v3: pre: don't trigger update if buffer address doesn't change Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 105/127] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 106/127] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 107/127] decnet: fix DN_IFREQ_SIZE Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 108/127] net/smc: prevent races between smc_lgr_terminate() and smc_conn_free() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 109/127] blktrace: Show requests without sector Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 110/127] tipc: fix skb may be leaky in tipc_link_input Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 111/127] sfc: initialise found bitmap in efx_ef10_mtd_probe Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 112/127] net: fix possible overflow in __sk_mem_raise_allocated() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 113/127] sctp: don't compare hb_timer expire date before starting it Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 114/127] bpf: decrease usercnt if bpf_map_new_fd() fails in bpf_map_get_fd_by_id() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 115/127] net: dev: Use unsigned integer as an argument to left-shift Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 117/127] bpf: drop refcount if bpf_map_new_fd() fails in map_create() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 118/127] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 119/127] iommu/amd: Fix NULL dereference bug in match_hid_uid Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 120/127] apparmor: delete the dentry in aafs_remove() to avoid a leak Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 121/127] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 122/127] ACPI / APEI: Don't wait to serialise with oops messages when panic()ing Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 123/127] ACPI / APEI: Switch estatus pool to use vmalloc memory Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 124/127] scsi: libsas: Check SMP PHY control function result Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 125/127] f2fs: fix to data block override node segment by mistake Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 126/127] powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() Sasha Levin
2019-11-22  5:55 ` [PATCH AUTOSEL 4.14 127/127] mtd: Remove a debug trace in mtdpart.c Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122055544.3299-30-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).