public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>,
	akpm@linux-foundation.org, jack@suse.cz, kirill@shutemov.name
Cc: borntraeger@de.ibm.com, david@redhat.com, aarcange@redhat.com,
	linux-mm@kvack.org, frankja@linux.ibm.com, sfr@canb.auug.org.au,
	jhubbard@nvidia.com, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org, peterz@infradead.org,
	sean.j.christopherson@intel.com
Subject: Re: [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages
Date: Tue, 28 Apr 2020 17:25:16 -0700	[thread overview]
Message-ID: <42cda753-a5df-9024-9076-11d75eec16c1@intel.com> (raw)
In-Reply-To: <20200428225043.3091359-1-imbrenda@linux.ibm.com>

On 4/28/20 3:50 PM, Claudio Imbrenda wrote:
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -106,6 +106,9 @@ static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe,
>  	struct page *page = buf->page;
>  	int err;
>  
> +	if (arch_make_page_accessible(page))
> +		return -EIO;
> +
>  	if (!PageUptodate(page)) {
>  		lock_page(page);

This is a cute fix, but doesn't it 100% depend on the internal
implementation detail of page cache sendfile() being implemented with a
pipe?  Depending on that seems rather fragile.  While I'm glad that you
surgically plugged the one single, specific case that I pointed out, I
can't help but suspect there are more of these.

For instance, I tried a file-to-file sendfile, basically:

	fd1 = open("file1");
	fd2 = open("file2");
	sendfile(fd1, fd2, ...);

ftrace showed page_cache_pipe_buf_confirm() getting called for the
source pipe pages but not the receiver.  There were no calls to
arch_make_page_accessible() outside of page_cache_pipe_buf_confirm() (I
put a stub in for it on x86 so I could trace it).

That indicates to me that one side of this might be fixed (the sender),
but the receiver is not.

This also doesn't even have the maintainer of fs/splice.c on cc.  The
changelog about what this is trying to do probably also lacks enough
context to bring Al up to speed about what this is trying to do.


  reply	other threads:[~2020-04-29  0:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 22:50 [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages Claudio Imbrenda
2020-04-29  0:25 ` Dave Hansen [this message]
2020-04-29 16:07 ` Dave Hansen
2020-04-29 17:31   ` Christian Borntraeger
2020-04-29 17:55     ` Dave Hansen
2020-04-29 22:53       ` Claudio Imbrenda
2020-04-29 23:52         ` Dave Hansen
2020-04-30 17:19           ` Claudio Imbrenda
2020-04-30 17:30             ` Dave Hansen
2020-04-30 18:12   ` Christian Borntraeger
2020-04-30 19:02     ` Christian Borntraeger
2020-04-30 19:54       ` Christian Borntraeger
2020-04-30 22:26         ` John Hubbard
2020-04-30 19:32     ` Dave Hansen
2020-04-30 19:38       ` Christian Borntraeger
2020-04-30 20:01         ` Dave Hansen
2020-04-30 20:03           ` Christian Borntraeger
2020-04-30 19:45       ` Christian Borntraeger

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=42cda753-a5df-9024-9076-11d75eec16c1@intel.com \
    --to=dave.hansen@intel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=jack@suse.cz \
    --cc=jhubbard@nvidia.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=sfr@canb.auug.org.au \
    /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