All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] btrfs: submit superblock io with REQ_META and REQ_PRIO
@ 2017-08-21 15:42 David Sterba
  2017-08-21 17:31 ` Josef Bacik
  2017-08-21 19:00 ` Liu Bo
  0 siblings, 2 replies; 3+ messages in thread
From: David Sterba @ 2017-08-21 15:42 UTC (permalink / raw)
  To: linux-btrfs; +Cc: bo.li.liu, David Sterba

The superblock is also metadata of the filesystem so the relevant IO
should be tagged as such. We also tag it as high priority, as it's the
last block committed for metadata from a given transaction. Any delays
would effectively block the whole transaction, also blocking any other
operation holding the device_list_mutex.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/disk-io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 90b967ae46d0..27d458640536 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3433,9 +3433,10 @@ static int write_dev_supers(struct btrfs_device *device,
 		 */
 		if (i == 0) {
 			ret = btrfsic_submit_bh(REQ_OP_WRITE,
-						REQ_SYNC | REQ_FUA, bh);
+				REQ_SYNC | REQ_FUA | REQ_META | REQ_PRIO, bh);
 		} else {
-			ret = btrfsic_submit_bh(REQ_OP_WRITE, REQ_SYNC, bh);
+			ret = btrfsic_submit_bh(REQ_OP_WRITE,
+				REQ_SYNC | REQ_META | REQ_PRIO, bh);
 		}
 		if (ret)
 			errors++;
-- 
2.14.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] btrfs: submit superblock io with REQ_META and REQ_PRIO
  2017-08-21 15:42 [PATCH v2] btrfs: submit superblock io with REQ_META and REQ_PRIO David Sterba
@ 2017-08-21 17:31 ` Josef Bacik
  2017-08-21 19:00 ` Liu Bo
  1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2017-08-21 17:31 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs, bo.li.liu

On Mon, Aug 21, 2017 at 05:42:27PM +0200, David Sterba wrote:
> The superblock is also metadata of the filesystem so the relevant IO
> should be tagged as such. We also tag it as high priority, as it's the
> last block committed for metadata from a given transaction. Any delays
> would effectively block the whole transaction, also blocking any other
> operation holding the device_list_mutex.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Josef Bacik <jbacik@fb.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] btrfs: submit superblock io with REQ_META and REQ_PRIO
  2017-08-21 15:42 [PATCH v2] btrfs: submit superblock io with REQ_META and REQ_PRIO David Sterba
  2017-08-21 17:31 ` Josef Bacik
@ 2017-08-21 19:00 ` Liu Bo
  1 sibling, 0 replies; 3+ messages in thread
From: Liu Bo @ 2017-08-21 19:00 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Aug 21, 2017 at 05:42:27PM +0200, David Sterba wrote:
> The superblock is also metadata of the filesystem so the relevant IO
> should be tagged as such. We also tag it as high priority, as it's the
> last block committed for metadata from a given transaction. Any delays
> would effectively block the whole transaction, also blocking any other
> operation holding the device_list_mutex.
> 

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

-liubo

> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/disk-io.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 90b967ae46d0..27d458640536 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3433,9 +3433,10 @@ static int write_dev_supers(struct btrfs_device *device,
>  		 */
>  		if (i == 0) {
>  			ret = btrfsic_submit_bh(REQ_OP_WRITE,
> -						REQ_SYNC | REQ_FUA, bh);
> +				REQ_SYNC | REQ_FUA | REQ_META | REQ_PRIO, bh);
>  		} else {
> -			ret = btrfsic_submit_bh(REQ_OP_WRITE, REQ_SYNC, bh);
> +			ret = btrfsic_submit_bh(REQ_OP_WRITE,
> +				REQ_SYNC | REQ_META | REQ_PRIO, bh);
>  		}
>  		if (ret)
>  			errors++;
> -- 
> 2.14.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-21 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 15:42 [PATCH v2] btrfs: submit superblock io with REQ_META and REQ_PRIO David Sterba
2017-08-21 17:31 ` Josef Bacik
2017-08-21 19:00 ` Liu Bo

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.