public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH RFC] xfs: set block device logical sector size on xfs_buftarg
Date: Wed, 13 Nov 2013 12:25:33 -0600	[thread overview]
Message-ID: <5283C41D.7070503@redhat.com> (raw)

Pure RFC; this might be crazy.  Here's the problem I'm trying to solve:

Today, mkfs.xfs will select a 4k sector size for a 4k physical / 512 logical
drive.  (that change was done by me).  The thought was that it'd be an
efficiency gain to not make the drive do the (possible) RMW cycles on
512-byte log IO, primarily.

However, now this restricts all DIO to 4k alignment, not the otherwise-
possible 512.

This came up when qemu-kvm, in cache=none mode, tries to boot off an
image hosted on such a filesystem, and its bios wants to do a 512 byte
direct IO read off the disk - it fails.

But I'm wondering - the buftarg's bt_sshift and bt_smask are only used
in a few places.  

XFS_IOC_DIOINFO - to get the minimum io size
xfs_file_aio_read() and xfs_file_dio_aio_write() to check alignment
_xfs_buf_find() to be sure we aren't doing sub-sector IO.

So what I'm wondering is:  Can we somehow separate the "sector size"
that i.e. primarily the xfs log does its IO in, based on sb_sectsize,
from the actual, hard-minimum possible IO, in the buftarg bt_sshift &
bt_smask.


Something like this, though untested, and I'm probably missing something.

Our other option, I guess, is to just revert the mkfs change which
picks the physical rather than logical sector size, and go back to 
512 if it's available as a logical size.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---


diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 8968f50..58ce036 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -814,10 +814,12 @@ STATIC int
 xfs_setup_devices(
 	struct xfs_mount	*mp)
 {
+	xfs_buftarg_t		btp;
 	int			error;
 
+	btp = mp->m_ddev_targp;
 	error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize,
-				    mp->m_sb.sb_sectsize);
+				    bdev_logical_block_size(btp));
 	if (error)
 		return error;
 
@@ -833,9 +835,10 @@ xfs_setup_devices(
 			return error;
 	}
 	if (mp->m_rtdev_targp) {
+		btp = mp->m_rtdev_targp;
 		error = xfs_setsize_buftarg(mp->m_rtdev_targp,
 					    mp->m_sb.sb_blocksize,
-					    mp->m_sb.sb_sectsize);
+					    bdev_logical_block_size(btp));
 		if (error)
 			return error;
 	}


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2013-11-13 18:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 18:25 Eric Sandeen [this message]
2013-11-13 18:56 ` [PATCH RFC] xfs: set block device logical sector size on xfs_buftarg Christoph Hellwig
2013-11-13 19:08   ` Eric Sandeen
2013-11-13 21:26     ` Dave Chinner
2013-11-13 21:32       ` Eric Sandeen
2013-11-13 22:10         ` Dave Chinner
2013-11-13 22:18           ` Eric Sandeen
2013-11-14  0:34             ` Dave Chinner
2013-11-14 13:37       ` Christoph Hellwig
2013-11-14 14:56         ` Eric Sandeen
2013-11-14 21:01           ` Dave Chinner
2013-11-22 14:13             ` Ric Wheeler
2013-11-22 14:20               ` Christoph Hellwig
2013-11-22 14:26                 ` Ric Wheeler
2013-11-22 14:57               ` Eric Sandeen
2013-11-14  0:35 ` Eric Sandeen
2013-11-14  6:49   ` Dave Chinner
2013-11-14 13:09     ` Ric Wheeler
2013-11-14 15:03       ` Eric Sandeen
2013-11-14 15:18     ` Eric Sandeen

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=5283C41D.7070503@redhat.com \
    --to=sandeen@redhat.com \
    --cc=xfs@oss.sgi.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