All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Wheeler <bcache@lists.ewheeler.net>
To: colyli <colyli@suse.de>
Cc: Adriano Silva <adriano_da_silva@yahoo.com.br>,
	Bcache Linux <linux-bcache@vger.kernel.org>,
	Matthias Ferdinand <bcache@mfedv.net>
Subject: Re: Bcache in writes direct with fsync. Are IOPS limited?
Date: Fri, 27 May 2022 17:58:20 -0700 (PDT)	[thread overview]
Message-ID: <c542b8d-2bda-2075-ab51-6f37956ac48@ewheeler.net> (raw)
In-Reply-To: <56405053a802525729f4e9f08e7861e5@suse.de>

[-- Attachment #1: Type: text/plain, Size: 3375 bytes --]

On Sat, 28 May 2022, colyli wrote:
> 在 2022-05-27 03:15,Eric Wheeler 写道:
> > On Mon, 23 May 2022, Coly Li wrote:
> >> On 5/18/22 9:22 AM, Eric Wheeler wrote:
> >> > Some time ago you ordered an an SSD to test the 4k cache issue, has that
> >> > been fixed?  I've kept an eye out for the patch but not sure if it was
> >> > released.
> >> 
> >> Yes, I got the Intel P3700 PCIe SSD to fix the 4Kn unaligned I/O issue
> >> (borrowed from a hardware vendor). The new situation is, current kernel
> >> does
> >> the sector size alignment checking quite earlier in bio layer, if the LBA
> >> is
> >> not sector size aligned, it is rejected in the bio code, and the underlying
> >> driver doesn't have chance to see the bio anymore. So for now, the
> >> unaligned
> >> LBA for 4Kn device cannot reach bcache code, that's to say, the original
> >> reported condition won't happen now.
> > 
> > The issue is not with unaligned 4k IOs hitting /dev/bcache0 because you
> > are right, the bio layer will reject those before even getting to
> > bcache:
> > 
> > The issue is that the bcache cache metadata sometimes makes metadata or
> > journal requests from _inside_ bcache that are not 4k aligned.  When
> > this happens the bio layer rejects the request from bcache (not from
> > whatever is above bcache).
> > 
> > Correct me if I misunderstood what you meant here, maybe it really was
> > fixed.  Here is your response from that old thread that pointed at
> > unaligned key access where you said "Wow, the above lines are very
> > informative, thanks!"
> > 
> 
> It was not fixed, at least I didn't do it on purpose. Maybe it was avoided
> by other fixes, e.g. the oversize bkey fix. But I don't have evidence the
> issue was fixed.
> 
> > bcache: check_4k_alignment() KEY_OFFSET(&w->key) is not 4KB aligned:
> > 15725385535
> >   https://www.spinics.net/lists/linux-bcache/msg06076.html
> > 
> > In that thread Kent sent a quick top-post asking "have you checked extent
> > merging?"
> >  https://www.spinics.net/lists/linux-bcache/msg06077.html
> > 
> 
> It embarrassed me that I received your informative debug information, and I
> glared very hard at the code for quite long time, but didn't have any clue
> that how such problem may happen in the extent related code.

You do great work on bcache, I appreciate everything you do.  No need to 
be embarrassed, this is just a hard bug to pin down!

> Since you reported the issue and I believe you, I will keep my eyes on the
> non-aligned 4Kn issue for bcache internal I/O. Hope someday I may have idea
> suddenly to point out where the problem is, and fix it.

You might try this for testing:

1. Format with -w 4096

2. Add some WARN_ONCE's around metadata and journal IO operations and run 
   it through your stress test to see what turns up.  The -w 4096 will 
   guarantee that all userspace IOs are 4k aligned, and then if any WARN's 
   trigger then they are suspect.  Even on 512-byte cache deployments we 
   should target 4k-aligned meta IOs hitting the SSD cache.  This would
   fix 2 things:

      a. It will guarantee that all journal/meta IOs are aligned to 4k for 
         4k cache users.

      b. Fix Adriano's performance issues since for at least his Hynix 
         SSD because 512b IOs are ~6x high latency than 4k IOs on his 
         system.

--
Eric Wheeler


> 
> Coly Li
> 
> 

  reply	other threads:[~2022-05-28  0:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <958894243.922478.1652201375900.ref@mail.yahoo.com>
2022-05-10 16:49 ` Bcache in writes direct with fsync. Are IOPS limited? Adriano Silva
2022-05-11  6:20   ` Matthias Ferdinand
2022-05-11 12:58     ` Adriano Silva
2022-05-11 21:21       ` Matthias Ferdinand
2022-05-18  1:22   ` Eric Wheeler
2022-05-23 14:07     ` Coly Li
2022-05-26 19:15       ` Eric Wheeler
2022-05-27 17:28         ` colyli
2022-05-28  0:58           ` Eric Wheeler [this message]
2022-05-23 18:36     ` [RFC] Add sysctl option to drop disk flushes in bcache? (was: Bcache in writes direct with fsync) Eric Wheeler
2022-05-24  5:34       ` Christoph Hellwig
2022-05-24 20:14         ` Eric Wheeler
2022-05-24 20:34           ` Keith Busch
2022-05-24 21:34             ` Eric Wheeler
2022-05-25  5:20               ` Christoph Hellwig
2022-05-25 18:44                 ` Eric Wheeler
2022-05-26  9:06                   ` Christoph Hellwig
2022-05-28  1:52                 ` Eric Wheeler
2022-05-28  3:57                   ` Keith Busch
2022-05-28  4:59                   ` Christoph Hellwig
2022-05-28 12:57                     ` Adriano Silva
2022-05-29  3:18                       ` Keith Busch
2022-05-31 19:42                         ` Eric Wheeler
2022-05-31 20:22                           ` Keith Busch
2022-05-31 23:04                             ` Eric Wheeler
2022-06-01  0:36                               ` Keith Busch
2022-06-01 18:48                                 ` Eric Wheeler
     [not found]                         ` <2064546094.2440522.1653825057164@mail.yahoo.com>
     [not found]                           ` <YpTKfHHWz27Qugi+@kbusch-mbp.dhcp.thefacebook.com>
2022-06-01 19:27                             ` Adriano Silva
2022-06-01 21:11                               ` Eric Wheeler
2022-06-02  5:26                                 ` Christoph Hellwig
2022-05-25  5:17           ` Christoph Hellwig
     [not found]     ` <681726005.1812841.1653564986700@mail.yahoo.com>
2022-05-26 20:20       ` Bcache in writes direct with fsync. Are IOPS limited? Adriano Silva
2022-05-26 20:28       ` Eric Wheeler
2022-05-27  4:07         ` Adriano Silva
2022-05-28  1:27           ` Eric Wheeler
2022-05-28  7:22             ` Matthias Ferdinand
2022-05-28 12:09               ` Adriano Silva

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=c542b8d-2bda-2075-ab51-6f37956ac48@ewheeler.net \
    --to=bcache@lists.ewheeler.net \
    --cc=adriano_da_silva@yahoo.com.br \
    --cc=bcache@mfedv.net \
    --cc=colyli@suse.de \
    --cc=linux-bcache@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 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.