linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: zuoze <zuoze1@huawei.com>, Matthew Wilcox <willy@infradead.org>,
	<gustavoars@kernel.org>, <akpm@linux-foundation.org>,
	<linux-hardening@vger.kernel.org>, <linux-mm@kvack.org>,
	<keescook@chromium.org>
Subject: Re: [PATCH -next] mm: usercopy: add a debugfs interface to bypass the vmalloc check.
Date: Tue, 3 Dec 2024 22:10:26 +0800	[thread overview]
Message-ID: <d659d925-a322-4566-955a-97894a2aa795@huawei.com> (raw)
In-Reply-To: <Z08M88NdLfugqhu9@pc636>



On 2024/12/3 21:51, Uladzislau Rezki wrote:
> On Tue, Dec 03, 2024 at 09:45:09PM +0800, Kefeng Wang wrote:
>>
>>
>> On 2024/12/3 21:39, Uladzislau Rezki wrote:
>>> On Tue, Dec 03, 2024 at 09:30:09PM +0800, Kefeng Wang wrote:
>>>>
>>>>
>>>> On 2024/12/3 21:10, zuoze wrote:
>>>>>
>>>>>
>>>>> 在 2024/12/3 20:39, Uladzislau Rezki 写道:
>>>>>> On Tue, Dec 03, 2024 at 07:23:44PM +0800, zuoze wrote:
>>>>>>> We have implemented host-guest communication based on the TUN device
>>>>>>> using XSK[1]. The hardware is a Kunpeng 920 machine (ARM architecture),
>>>>>>> and the operating system is based on the 6.6 LTS version with kernel
>>>>>>> version 6.6. The specific stack for hotspot collection is as follows:
>>>>>>>
>>>>>>> -  100.00%     0.00%  vhost-12384  [unknown]      [k] 0000000000000000
>>>>>>>       - ret_from_fork
>>>>>>>          - 99.99% vhost_task_fn
>>>>>>>             - 99.98% 0xffffdc59f619876c
>>>>>>>                - 98.99% handle_rx_kick
>>>>>>>                   - 98.94% handle_rx
>>>>>>>                      - 94.92% tun_recvmsg
>>>>>>>                         - 94.76% tun_do_read
>>>>>>>                            - 94.62% tun_put_user_xdp_zc
>>>>>>>                               - 63.53% __check_object_size
>>>>>>>                                  - 63.49% __check_object_size.part.0
>>>>>>>                                       find_vmap_area
>>>>>>>                               - 30.02% _copy_to_iter
>>>>>>>                                    __arch_copy_to_user
>>>>>>>                      - 2.27% get_rx_bufs
>>>>>>>                         - 2.12% vhost_get_vq_desc
>>>>>>>                              1.49% __arch_copy_from_user
>>>>>>>                      - 0.89% peek_head_len
>>>>>>>                           0.54% xsk_tx_peek_desc
>>>>>>>                      - 0.68% vhost_add_used_and_signal_n
>>>>>>>                         - 0.53% eventfd_signal
>>>>>>>                              eventfd_signal_mask
>>>>>>>                - 0.94% handle_tx_kick
>>>>>>>                   - 0.94% handle_tx
>>>>>>>                      - handle_tx_copy
>>>>>>>                         - 0.59% vhost_tx_batch.constprop.0
>>>>>>>                              0.52% tun_sendmsg
>>>>>>>
>>>>>>> It can be observed that most of the overhead is concentrated in the
>>>>>>> find_vmap_area function.
>>>>>>>
...
>>
> Thank you. Then you have tons of copy_to_iter/copy_from_iter calls
> during your test case. Per each you need to find an area which might
> be really heavy.

Exactly, no vmalloc check before 0aef499f3172 ("mm/usercopy: Detect 
vmalloc overruns"), so no burden in find_vmap_area in old kernel.

> 
> How many CPUs in a system you have?
> 

128 core


  reply	other threads:[~2024-12-03 14:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  2:31 Ze Zuo
2024-12-03  4:11 ` Matthew Wilcox
2024-12-03 11:23   ` zuoze
2024-12-03 12:39     ` Uladzislau Rezki
2024-12-03 13:10       ` zuoze
2024-12-03 13:25         ` Uladzislau Rezki
2024-12-03 13:30         ` Kefeng Wang
2024-12-03 13:39           ` Uladzislau Rezki
2024-12-03 13:45             ` Kefeng Wang
2024-12-03 13:51               ` Uladzislau Rezki
2024-12-03 14:10                 ` Kefeng Wang [this message]
2024-12-03 14:20                   ` Uladzislau Rezki
2024-12-03 19:02                     ` Uladzislau Rezki
2024-12-03 19:56                       ` Matthew Wilcox
2024-12-04  1:38                         ` zuoze
2024-12-04  4:43                         ` Kees Cook
2024-12-04  7:55                         ` Uladzislau Rezki
2024-12-04  9:21                           ` zuoze
2024-12-04  9:27                             ` Uladzislau Rezki
2024-12-04  8:51                         ` Uladzislau Rezki
2024-12-16  4:24                           ` Matthew Wilcox
2024-12-16 19:18                             ` Uladzislau Rezki
2024-12-04  1:21                       ` zuoze
2024-12-03  6:12 ` Uladzislau Rezki

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=d659d925-a322-4566-955a-97894a2aa795@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=urezki@gmail.com \
    --cc=willy@infradead.org \
    --cc=zuoze1@huawei.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