linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-xfs@vger.kernel.org, David Teigland <teigland@redhat.com>
Subject: Re: dm-writecache issue
Date: Tue, 18 Sep 2018 08:33:24 -0700	[thread overview]
Message-ID: <20180918153324.GB13016@infradead.org> (raw)
In-Reply-To: <alpine.LRH.2.02.1809181014500.28565@file01.intranet.prod.int.rdu2.redhat.com>

On Tue, Sep 18, 2018 at 10:22:15AM -0400, Mikulas Patocka wrote:
> > On Tue, Sep 18, 2018 at 07:46:47AM -0400, Mikulas Patocka wrote:
> > > I would ask the XFS developers about this - why does mkfs.xfs select 
> > > sector size 512 by default?
> > 
> > Because the underlying device told it that it supported a
> > sector size of 512 bytes?
> 
> SSDs lie about this. They have 4k sectors internally, but report 512.

SSDs can't lie about the sector size because they don't even have
sectors in the disk sense, they have program and erase block size,
and some kind of FTL granularity (think of it like a file system block
size - even a 4k block size file can do smaller writes with
read-modify-write cycles, so can SSDs).

SSDs can just properly implement the guarantees they inherited from
disk by other means.  So if an SSD claims it supports 512 byte blocks
it better can deal with them atomically.  If they have issues in that
area (like Intel did recently where they corrupted data left right
and center if you actually did 512byte writes) they are simply buggy.

SATA and SAS SSDs can always use the same trick as modern disks to
support 512 byte access where really needed (e.g. BIOS and legacy
OSes) but give a strong hint to modern OSes that they don't want that
to be actually used with the physical block exponent.  NVMe doesn't
have anything like that yet, but we are working on something like
that in the NVMe TWG.

  reply	other threads:[~2018-09-18 21:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180911221147.GA23308@redhat.com>
2018-09-18 11:46 ` dm-writecache issue Mikulas Patocka
2018-09-18 12:32   ` Dave Chinner
2018-09-18 12:48     ` Eric Sandeen
2018-09-18 14:09       ` Mikulas Patocka
2018-09-18 14:16         ` Eric Sandeen
2018-09-18 14:19           ` Eric Sandeen
2018-09-18 14:29             ` Mikulas Patocka
2018-09-18 14:36               ` Eric Sandeen
2018-09-18 14:42                 ` Mikulas Patocka
2018-09-18 15:04                   ` Eric Sandeen
2018-09-18 15:27                     ` Eric Sandeen
2018-09-18 15:29                       ` Christoph Hellwig
2018-09-18 17:15                     ` Mikulas Patocka
2018-09-18 14:20       ` David Teigland
2018-09-18 14:23         ` Eric Sandeen
2018-09-18 14:22     ` Mikulas Patocka
2018-09-18 15:33       ` Christoph Hellwig [this message]
2018-09-18 17:39         ` Mikulas Patocka
2018-09-18 22:52           ` Dave Chinner

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=20180918153324.GB13016@infradead.org \
    --to=hch@infradead.org \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=teigland@redhat.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;
as well as URLs for NNTP newsgroup(s).