netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Gerd Bayer <gbayer@linux.ibm.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Wen Gu <guwen@linux.alibaba.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	pasic@linux.ibm.com, schnelle@linux.ibm.com,
	linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	Alexandra Winter <wintera@linux.ibm.com>,
	Thorsten Winkler <twinkler@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH net 1/1] s390/ism: fix receive message buffer allocation
Date: Fri, 5 Apr 2024 08:49:19 +0200	[thread overview]
Message-ID: <20240405064919.GA3788@lst.de> (raw)
In-Reply-To: <cb7b036b4d3db02ab70d17ee83e6bc4f2df03171.camel@linux.ibm.com>

On Thu, Apr 04, 2024 at 01:10:20PM +0200, Gerd Bayer wrote:
> > Why can't you use get_free_pages() (or similar) here? (possibly
> > rounding up to the relevant page_aligned size). 
> 
> Thanks Paolo for your suggestion. However, I wanted to stay as close to
> the implementation pre [1] - that used to use __GFP_COMP, too. I'd
> rather avoid to change interfaces from "cpu_addr" to "struct page*" at
> this point. In the long run, I'd like to drop the requirement for

The right interface actually is to simply use folio_alloc, which adds
__GFP_COMP and is a fully supported and understood interface. You can
just convert the folio to a kernel virtual address using folio_address()
right after allocating it.

(get_free_pages also retunrs a kernel virtual address, just awkwardly as
an unsigned long. In doubt don't use this interface for new code..)

> compound pages entirely, since that *appears* to exist primarily for a
> simplified handling of the interface to splice_to_pipe() in
> net/smc/smc_rx.c. And of course there might be performance
> implications...

While compounds pages might sound awkward, they are the new normal in
form of folios.  So just use folios.

  reply	other threads:[~2024-04-05  6:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 15:41 [PATCH net 0/1] s390/ism: Fix splice for SMC-D Gerd Bayer
2024-03-28 15:41 ` [PATCH net 1/1] s390/ism: fix receive message buffer allocation Gerd Bayer
2024-03-28 15:59   ` Gerd Bayer
2024-04-04  8:13   ` Paolo Abeni
2024-04-04 11:10     ` Gerd Bayer
2024-04-05  6:49       ` Christoph Hellwig [this message]
2024-04-05 10:42         ` Gerd Bayer
2024-04-05 11:29           ` Niklas Schnelle
2024-04-05 14:36             ` Christoph Hellwig
2024-04-15 13:28               ` Gerd Bayer

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=20240405064919.GA3788@lst.de \
    --to=hch@lst.de \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gbayer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=guwen@linux.alibaba.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=twinkler@linux.ibm.com \
    --cc=wenjia@linux.ibm.com \
    --cc=wintera@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).