Linux bcache driver list
 help / color / mirror / Atom feed
From: Robert Pang <robertpang@google.com>
To: colyli@fygo.io
Cc: linux-bcache@vger.kernel.org, mingzhe.zou@easystack.cn,
	 robertpang@google.com
Subject: Re: [PATCH 5/9] bcache: reduce gc latency by processing less nodes and sleep less time
Date: Thu, 16 Jul 2026 17:50:39 -0700	[thread overview]
Message-ID: <20260717005039.1953649-1-robertpang@google.com> (raw)
In-Reply-To: <20251113053630.54218-6-colyli@fnnas.com>

Hi Coly,

I was reviewing this patch again and noticed that btree_gc_min_nodes() reads the
atomic counter 'search_inflight'. This counter is incremented and decremented by
clients issuing front-side I/O. In this scenario, should we add a memory barrier
(such as `smp_mb__before_atomic`) prior to `atomic_read()`? 

My concern is that if btree_gc_min_nodes() is inlined in the caller
btree_gc_recurse(), the compiler might hoist the `atomic_read()` outside of the
while loop where btree_gc_min_nodes() is inlined, preventing us from fetching the
latest counter value. Adding the barrier would guarantee we read the updated
value.

What are your thoughts on this?

Best regards,
Robert Pang

  reply	other threads:[~2026-07-17  0:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  5:36 [PATCH 0/9] bcache patches for Linux 6.19 colyli
2025-11-13  5:36 ` [PATCH 1/9] bcache: get rid of discard code from journal colyli
2025-11-13  5:36 ` [PATCH 2/9] bcache: remove discard code from alloc.c colyli
2025-11-13  5:36 ` [PATCH 3/9] bcache: drop discard sysfs interface colyli
2025-11-13  5:36 ` [PATCH 4/9] bcache: remove discard sysfs interface document colyli
2025-11-13  5:36 ` [PATCH 5/9] bcache: reduce gc latency by processing less nodes and sleep less time colyli
2026-07-17  0:50   ` Robert Pang [this message]
2026-07-18  4:20     ` Coly Li
2026-07-21 18:55       ` Robert Pang
2026-08-06  8:36         ` Coly Li
2026-08-10 21:38           ` Robert Pang
2025-11-13  5:36 ` [PATCH 6/9] bcache: remove redundant __GFP_NOWARN colyli
2025-11-13  5:36 ` [PATCH 7/9] bcache: replace use of system_wq with system_percpu_wq colyli
2025-11-13  5:36 ` [PATCH 8/9] bcache: WQ_PERCPU added to alloc_workqueue users colyli
2025-11-13  5:36 ` [PATCH 9/9] bcache: Avoid -Wflex-array-member-not-at-end warning colyli
2025-11-13 16:26 ` [PATCH 0/9] bcache patches for Linux 6.19 Jens Axboe

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=20260717005039.1953649-1-robertpang@google.com \
    --to=robertpang@google.com \
    --cc=colyli@fygo.io \
    --cc=linux-bcache@vger.kernel.org \
    --cc=mingzhe.zou@easystack.cn \
    /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