All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	linux-um@lists.infradead.org
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] Add DISCARD support to UML udb driver
Date: Fri, 09 Nov 2018 23:06:00 +0100	[thread overview]
Message-ID: <5868448.ctSSMDQgOm@blindfold> (raw)
In-Reply-To: <79343bcf-8cf7-27e8-1d53-ee404f6431bd@cambridgegreys.com>

Am Freitag, 9. November 2018, 22:20:03 CET schrieb Anton Ivanov:
> > What shall happen if the host filesystem does not support these
> > fallocate() operations?
> > I guess we need to probe for them first and decide whether to
> > accept/offer the discard command
> > at run time.
> 
> If it the filesystem is using periodic (not realtime) fstrim, It will 
> return IO error on those and fstrim will fail. Normal file ops - write, 
> read, fsync should continue as this should not force a remount.
> 
> I could not test with realtime fstrim ans btrfs was having some issues 
> in 4.20-rc1. It was hitting spinlock recursions and irq on/off where 
> they should not be BUG()s.
> 
> Non-destructive probing is a bit difficult. IMHO, we should leave this 
> to the user and add flags the way nbd and loop have done it. We can also 
> add a config option to set a default on or off at compile time (same as 
> for sync io on ubd).

Well, we could do what qemu does.
If the syscall fails with -ENOTSUP, disable discard.

Thanks,
//richard



_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


      reply	other threads:[~2018-11-09 22:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09  9:19 [PATCH] Add DISCARD support to UML udb driver anton.ivanov
2018-11-09 15:55 ` Jens Axboe
2018-11-09 21:04 ` Richard Weinberger
2018-11-09 21:20   ` Anton Ivanov
2018-11-09 22:06     ` Richard Weinberger [this message]

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=5868448.ctSSMDQgOm@blindfold \
    --to=richard@nod.at \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-um@lists.infradead.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.