| To: | Nicholas Piggin <npiggin@xxxxxxxxx> |
|---|---|
| Subject: | Re: xfs_file_splice_read: possible circular locking dependency detected |
| From: | Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> |
| Date: | Tue, 13 Sep 2016 21:01:07 -0700 |
| Cc: | Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, CAI Qian <caiqian@xxxxxxxxxx>, linux-xfs <linux-xfs@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, Jens Axboe <axboe@xxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rgTe/naSbeHPPrkc7bYcisOkD3cS3Fx1ioHgBctd85o=; b=kvbtzrnIAeY0LtLuzqXxfgj1HvUyTgP4lHEcq42jGO1EzBzzgcFdx3aOglQoneaNIV b/RmqM2wsQUY4dxzz6mhclueILX6JTSfdP9io+sNcKMtD4tt8kNlhlWgz9/tE6BwxG2G Zw/OW8caQx05+yCDnsiJ90gp/D29DEfVfB2EH9YBZoak3TMemE4XIFKQD0ikMybvmu69 yRmpF8m5V+4oMjWLjWO/m+gH+PC4jBUtBZhhJz/9Talz1PTF9DS1JpC7vIbQvGQZEAWJ whEf/Y7JoPobU3XlLFR+fOoM/rg+jc02o7ftmtkh6VnH/z5fKj43su8JuttfkAeZl2Nz YCQw== |
| In-reply-to: | <20160914133925.2fba4629@xxxxxxxxxxxxxxxxxxx> |
| References: | <CA+55aFzg+Q0DzFNBR9TeL13_yfrfFwHu9OrZe--Zpje0EeN4Cw@xxxxxxxxxxxxxx> <20160908213835.GY30056@dastard> <20160908235521.GL2356@xxxxxxxxxxxxxxxxxx> <20160909015324.GD30056@dastard> <CA+55aFzohsUXj_3BeFNr2t50Wm=G+7toRDEz=Tk7VJqP3n1hXQ@xxxxxxxxxxxxxx> <CA+55aFxrqCng2Qxasc9pyMrKUGFjo==fEaFT1vkH9Lncte3RgQ@xxxxxxxxxxxxxx> <20160909023452.GO2356@xxxxxxxxxxxxxxxxxx> <CA+55aFwHQMjO4-vtfB9-ytc=o+DRo-HXVGckvXLboUxgpwb7_g@xxxxxxxxxxxxxx> <20160909221945.GQ2356@xxxxxxxxxxxxxxxxxx> <CA+55aFzTOOB6oEVaaGD0N7Uznk-W9+ULPwzsxS_L_oZqGVSeLA@xxxxxxxxxxxxxx> <20160914031648.GB2356@xxxxxxxxxxxxxxxxxx> <20160914133925.2fba4629@xxxxxxxxxxxxxxxxxxx> |
| Sender: | linus971@xxxxxxxxx |
On Tue, Sep 13, 2016 at 8:39 PM, Nicholas Piggin <npiggin@xxxxxxxxx> wrote:
>
> But even for those, at 16 entries, the bulk of the cost *should* be hitting
> struct page cachelines and refcounting. The rest should mostly stay in cache.
Yes. And those costs will be exactly the same whether we do 16 entries
at a time or 4 loops of 4 entries.
There's something to be said for small temp buffers. They often have
better cache behavior thanks to re-use than having larger arrays.
But I still think that the biggest win could be from just trying to
cut down on code, if we can just say "we'll limit splice to N entries"
(where "N" is small enough that we really can do everything in a
simple stack allocation - I suspect 16 is already too big, and we
really should look at 4 or 8).
And if we actually get a report of a performance regression, we'd at
least hear who actually *uses* splice and notices.
I'm (sadly) still not at all convinced that "splice()" was ever a good
idea. I think it was a clever idea, and it is definitely much more
powerful conceptually than sendfile(), but I also suspect that it's
simply not used enough to be really worth the pain.
You can get great benchmark numbers with it. But whether it actually
matters in real life? I really don't know. But if we screw it up, and
make the buffers too small, and people actually complain and tell us
about what they are doing, that in itself would be a good datapoint.
So I wouldn't be too worried about just trying things out. We
certainly don't want to *break* anything, but at the same time I
really don't think we should be too nervous about it either.
Which is why I'd be more than happy to say "Just try limiting things
to a pretty small buffer and see if anybody even notices!"
Linus
|
| Previous by Date: | Re: xfs_file_splice_read: possible circular locking dependency detected, Linus Torvalds |
|---|---|
| Next by Date: | Re: xfs_file_splice_read: possible circular locking dependency detected, Al Viro |
| Previous by Thread: | Re: xfs_file_splice_read: possible circular locking dependency detected, Nicholas Piggin |
| Next by Thread: | Re: xfs_file_splice_read: possible circular locking dependency detected, Al Viro |
| Indexes: | [Date] [Thread] [Top] [All Lists] |