linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	netdev@vger.kernel.org, Vlastimil Babka <vbabka@suse.cz>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: Decline to manipulate the refcount on a slab page
Date: Thu, 13 Mar 2025 02:15:54 -0700	[thread overview]
Message-ID: <Z9KiSspCLcS7DH6J@infradead.org> (raw)
In-Reply-To: <5075cd03-0a4a-46d3-abac-3eda27b9ddcc@suse.de>

On Thu, Mar 13, 2025 at 09:52:18AM +0100, Hannes Reinecke wrote:
> > It doesn't.  It just doesn't want you to use ->sendpage.
> > 
> But we don't; we call 'sendpage_ok()' and disabling the MSG_SPLICE_PAGES
> flag.

MSG_SPLICE_PAGES really just is the new name for the old ->sendpage.
Sorry for being stuck in the old naming.

> Actual issue is that tls_sw() is calling iov_iter_alloc_pages(),
> which is taking a page reference.
> It probably should be calling iov_iter_extract_pages() (which does not
> take a reference), but then one would need to review the entire network
> stack as taking and releasing page references are littered throughout
> the stack.

Yes, it needs to use the proper pinning helpers, if only to not
corrupt out of place write file systems when receiving from a TLS
socket.  But for the network stack below it that doesn't matter,
it expects to be able to grab and release references, and for that
you need page backing.  If that page was pinned or referenced
when resolving the user address does not matter at all.



  reply	other threads:[~2025-03-13  9:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 14:35 Matthew Wilcox (Oracle)
2025-03-10 14:37 ` Vlastimil Babka
2025-03-10 14:50   ` Matthew Wilcox
2025-03-11 10:15 ` Jakub Kicinski
2025-03-11 15:46   ` Hannes Reinecke
2025-03-11 16:59     ` Matthew Wilcox
2025-03-12  5:48       ` Christoph Hellwig
2025-03-13  7:22         ` Hannes Reinecke
2025-03-13  7:36           ` Christoph Hellwig
2025-03-13  8:34             ` Hannes Reinecke
2025-03-13  8:44               ` Christoph Hellwig
2025-03-13  8:52                 ` Hannes Reinecke
2025-03-13  9:15                   ` Christoph Hellwig [this message]
2025-03-12  5:47   ` Christoph Hellwig
     [not found] <20250310142750.1209192-1-willy@infradead.org>
     [not found] ` <77fa8d7e-4752-4979-affe-aa45c8d7795a@suse.de>
     [not found]   ` <Z88vUFweLyk5s8UD@casper.infradead.org>
2025-03-11  7:05     ` Hannes Reinecke

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=Z9KiSspCLcS7DH6J@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=hare@suse.de \
    --cc=kuba@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=vbabka@suse.cz \
    --cc=willy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox