From: Tony Lu <tonylu@linux.alibaba.com>
To: Karsten Graul <kgraul@linux.ibm.com>
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
linux-s390@vger.kernel.org
Subject: Re: [PATCH net-next] net/smc: Use kvzalloc for allocating smc_link_group
Date: Fri, 21 Jan 2022 11:24:32 +0800 [thread overview]
Message-ID: <YeoncJZoa3ELWyxM@TonyMac-Alibaba> (raw)
In-Reply-To: <4c600724-3306-0f0e-36dc-52f4f23825bc@linux.ibm.com>
On Thu, Jan 20, 2022 at 03:50:26PM +0100, Karsten Graul wrote:
> On 20/01/2022 15:09, Tony Lu wrote:
> > When analyzed memory usage of SMC, we found that the size of struct
> > smc_link_group is 16048 bytes, which is too big for a busy machine to
> > allocate contiguous memory. Using kvzalloc instead that falls back to
> > vmalloc if there has not enough contiguous memory.
>
> I am wondering where the needed contiguous memory for the required RMB buffers should come from when
> you don't even get enough storage for the initial link group?
Yes, this is what I want to talking about. The RMB buffers size inherits
from TCP, we cannot assume that RMB is always larger than 16k bytes, the
tcp_mem can be changed on the fly, and it can be tuned to very small for
saving memory. Also, If we freed existed link group or somewhere else,
we can allocate enough contiguous memory for the new link group.
> The idea is that when the system is so low on contiguous memory then a link group creation should fail
> early, because most of the later buffer allocations will also fail then later.
IMHO, it is not a "pre-checker" for allocating buffer, it is a reminder
for us to save contiguous memory, this is a precious resource, and a
possible way to do this. This patch is not the best approach to solve
this problem, but the simplest one. A possible approach to allocate
link array in link group with a pointer to another memory. Glad to hear
your advice.
Thanks,
Tony Lu
next prev parent reply other threads:[~2022-01-21 3:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 14:09 [PATCH net-next] net/smc: Use kvzalloc for allocating smc_link_group Tony Lu
2022-01-20 14:50 ` Karsten Graul
2022-01-21 3:24 ` Tony Lu [this message]
2022-01-21 11:06 ` Karsten Graul
2022-01-24 9:46 ` Tony Lu
2022-01-27 15:28 ` Karsten Graul
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=YeoncJZoa3ELWyxM@TonyMac-Alibaba \
--to=tonylu@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.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