All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Josef Bacik <josef@toxicpanda.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/3] Balance vs device add fixes
Date: Tue, 2 Nov 2021 19:39:37 +0200	[thread overview]
Message-ID: <541927b1-ff40-4d5a-6d99-709b10e4c141@suse.com> (raw)
In-Reply-To: <20211102172528.se6voh75geqjjltf@zuko>



On 2.11.21 г. 19:25, Goldwyn Rodrigues wrote:
> But do we really need to use *_ONCE, assuming btrfs_exclusive_operation
> fits in 8 bits?
> 


The way I understand it based on the LWN articles is that the effect of
_ONCE is twofold:

1. It prevents theoretical torn writes + forces the compiler to always
issue the access i.e prevent it being optimized out - this could be moot
in our case.

2. It serves a documentation purpose where it states "this variable is
accessed in multithreaded contexts, possibly without an explicit lock" -
and this IMO is quite helpful in this particular context.

      reply	other threads:[~2021-11-02 17:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 11:53 [PATCH 0/3] Balance vs device add fixes Nikolay Borisov
2021-11-01 11:53 ` [PATCH 1/3] btrfs: introduce BTRFS_EXCLOP_BALANCE_PAUSED exclusive state Nikolay Borisov
2021-11-01 11:53 ` [PATCH 2/3] btrfs: make device add compatible with paused balance in btrfs_exclop_start_try_lock Nikolay Borisov
2021-11-01 11:53 ` [PATCH 3/3] btrfs: allow device add if balance is paused Nikolay Borisov
2021-11-02  4:52 ` [PATCH 0/3] Balance vs device add fixes Anand Jain
2021-11-02 13:12   ` Josef Bacik
2021-11-02 14:30 ` Josef Bacik
2021-11-02 15:25   ` Nikolay Borisov
2021-11-02 16:10     ` Josef Bacik
2021-11-02 17:25     ` Goldwyn Rodrigues
2021-11-02 17:39       ` Nikolay Borisov [this message]

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=541927b1-ff40-4d5a-6d99-709b10e4c141@suse.com \
    --to=nborisov@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rgoldwyn@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.