public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Mark Harmstone <maharmstone@meta.com>
Cc: Boris Burkov <boris@bur.io>, Daniel Vacek <neelx@suse.com>,
	Filipe Manana <fdmanana@kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: use atomic64_t for free_objectid
Date: Thu, 13 Feb 2025 20:38:40 +0100	[thread overview]
Message-ID: <20250213193840.GC5777@suse.cz> (raw)
In-Reply-To: <62d31fb6-27c7-48ba-9e0e-c9155ff5fe6f@meta.com>

On Thu, Feb 13, 2025 at 05:47:00PM +0000, Mark Harmstone wrote:
> On 10/2/25 22:34, David Sterba wrote:
> > > 
> > On Wed, Feb 05, 2025 at 03:08:59PM +0000, Mark Harmstone wrote:
> >> On 31/1/25 19:38, Boris Burkov wrote:
> >>> My understanding is that the motivation is to enable non-blocking mode
> >>> for io_uring operations, but I'll let Mark reply in detail.
> >>
> >> That's right. io_uring operates in two passes: the first in non-blocking
> >> mode, then if it receives EAGAIN again in a work thread in blocking mode.
> >>
> >> As part of my work to get btrfs receive to use io_uring, I want to add
> >> an io_uring interface for subvol creation. There's two things preventing
> >> a non-blocking version: this, and the fact we need a
> >> btrfs_try_start_transaction() (which should be relatively straightforward).
> > 
> >>>>>>> Even if we were to grab a new integer a billion
> >>>>>>> times a second, it would take 584 years to wrap around.
> >>>>>>
> >>>>>> Good to know, but I would not use that as an argument.  This may hold if
> >>>>>> you predict based on contemporary hardware. New technologies can bring
> >>>>>> an order of magnitude improvement, eg. like NVMe brought compared to SSD
> >>>>>> technology.
> >>>>>
> >>>>> I eagerly look forward to my 40GHz processor :)
> >>>>
> >>>> You never know about unexpected break-throughs. So fingers crossed.
> >>>> Though I'd be surprised.
> >>
> >> More like 40THz, and somebody finding a way to increase the speed of
> >> light... There's four or five orders of magnitude to go before 64-bit
> >> wraparound would become a problem here.
> > 
> > Thinking about the margins again, there is probably enough that we don't
> > have to care. I'd still keep the upper limit check as for any random
> > event like fuzzing, bitflips and such.
> > 
> > The use case for nonblocking io_uring makes sense and justifies the
> > optimization. As mentioned, there are other factors slowing down the
> > inode creation and number allocation so it's "fingers crossed* safe.
> 
> Thanks David. Am I okay to push this patch to for-next then?

Yes, but please send an updated version first, we need the reasoning for
the choice and that it's still safe regarding amount of time to reach
the maximum. Basically the objections and answers from this thread
summarized.

  reply	other threads:[~2025-02-13 19:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22 12:21 [PATCH] btrfs: use atomic64_t for free_objectid Mark Harmstone
2025-01-22 12:39 ` Filipe Manana
2025-01-22 12:59   ` Mark Harmstone
2025-01-22 13:04     ` Filipe Manana
2025-01-22 13:51   ` Daniel Vacek
2025-01-23 21:59     ` David Sterba
2025-01-24  8:21       ` Daniel Vacek
2025-01-24 12:25         ` Filipe Manana
2025-01-24 15:13           ` Daniel Vacek
2025-01-27 17:42           ` Mark Harmstone
2025-01-27 17:53             ` Filipe Manana
2025-01-27 20:17             ` David Sterba
2025-01-29 22:58               ` Boris Burkov
2025-01-30 11:34                 ` Daniel Vacek
2025-01-31 19:38                   ` Boris Burkov
2025-02-05 15:08                     ` Mark Harmstone
2025-02-10 13:32                       ` Daniel Vacek
2025-02-10 22:34                       ` David Sterba
2025-02-13 17:47                         ` Mark Harmstone
2025-02-13 19:38                           ` David Sterba [this message]
2025-01-23 22:11   ` David Sterba
2025-01-24 15:10     ` Daniel Vacek
2025-01-22 15:07 ` David Sterba
2025-01-22 18:19   ` Mark Harmstone
2025-03-03  9:14 ` David Sterba
2025-03-03 18:24   ` Mark Harmstone

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=20250213193840.GC5777@suse.cz \
    --to=dsterba@suse.cz \
    --cc=boris@bur.io \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=maharmstone@meta.com \
    --cc=neelx@suse.com \
    /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