From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5D0EE6C5F7 for ; Tue, 3 Dec 2024 04:11:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3D9B6B007B; Mon, 2 Dec 2024 23:11:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EEDA76B0083; Mon, 2 Dec 2024 23:11:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDD536B0085; Mon, 2 Dec 2024 23:11:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C112C6B007B for ; Mon, 2 Dec 2024 23:11:54 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2D3D8ADE39 for ; Tue, 3 Dec 2024 04:11:54 +0000 (UTC) X-FDA: 82852324296.04.F1D896B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id EA2D4C0012 for ; Tue, 3 Dec 2024 04:11:37 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=fXoxw5yG; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733199104; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=O+XAXJC7qu7TYDODtxKCg34vNlWfHvrDTW1M0kJoD0w=; b=m5FD8ARXH4E34881i2UE268pZ56ytLn6TgtB5ORI11UHun0ttlnnAFKCs5PkWoxlasxWsU paZ6BffErApalBfkP7dJsUitYCm6VttsyCeGuA7HfMjcTmtlke4x94+ax8d2nNlXj4iwbJ aCaxp056ea/Y3/gv+acCWOs6doYIFuE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733199104; a=rsa-sha256; cv=none; b=JqucwswVXFzmimlfdQ8JT3SUuHV+Y/sX/T0nNtVi1/TFAIRS7iqbI0v9MYuoKJ02h+bya0 afsjh2ex1X+FsptXznwBTkxr7aWNQ4Avq/Ry7hljipX5L8E9CTrmgicmBlCZXK/gfh/gi0 Pz9nONseOidkBNCLH5Qt0WuigCl8GWU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=fXoxw5yG; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=O+XAXJC7qu7TYDODtxKCg34vNlWfHvrDTW1M0kJoD0w=; b=fXoxw5yGxDZqwToKSkXEJfnjdY RzXtYlQFusb6pp4MVbaXM4/yfHCyaUKUJwx1DSsdMu4nKG7MHql1WiAGg9pAVpHy/rqQxIPVgVAto g4EmScfi3b9LYBZD9GfhasSLuhX8YfsUVq6YCV5ZD6lZLSDgV7WW1xOqS/MsNg1a1qteMo7OGD6qw MzlON69mQzSZic0l/a6QarJYi2YiJi34hNl37G507j97o6w+vnZMWVnTEAAgy1apotRyZl4alr6N+ PA6Q2m41oqnbX6G3rRDiiXHgcNfjPERXMuf6xjWudz4jc69ZSq2r403/S7/b+Y1HhCtmiGkV5VWgn fNZ3fqeQ==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tIKGI-000000094Eq-2cLz; Tue, 03 Dec 2024 04:11:46 +0000 Date: Tue, 3 Dec 2024 04:11:46 +0000 From: Matthew Wilcox To: Ze Zuo Cc: gustavoars@kernel.org, akpm@linux-foundation.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, keescook@chromium.org, urezki@gmail.com, wangkefeng.wang@huawei.com Subject: Re: [PATCH -next] mm: usercopy: add a debugfs interface to bypass the vmalloc check. Message-ID: References: <20241203023159.219355-1-zuoze1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241203023159.219355-1-zuoze1@huawei.com> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EA2D4C0012 X-Stat-Signature: uyu8gw41jez4wy3k3tc1iiobo35hhtp4 X-Rspam-User: X-HE-Tag: 1733199097-37803 X-HE-Meta: U2FsdGVkX1+kXkV6Ayo1zWQy4+ZFqmw7gmrUpivSMIzWnNeuMaPeZV2dYE+DUXtceqBrgCtg8bkah9CdzsEKeyVBS48N5impw581wqd8T9scS42n4FjT4X5xxGZYYHssdebbhmOGoTjsWPP8otx2eDpUcn9s9Hu3lDjNGTgy3+wujRDs5oGD5BS+dvXobZMp1xnAP+h/IEjNUcs3zroMh884I9iQTn9G+9asWbqRKmsyJuFxndrYNVvbJ8nLrCeHeh2zqzClOMEcSZfjSjx0DfLEojRLlFm6s+VfHOj64/fUVWIOhWW0uMpPo5wLfTyQuN+I7/XeHCt8OvS49R6244Fl+sAWCN7XywQ0g7CKXNWrTmH+qTDe1LyFRaWdDDueXrdLW5+GwSkjM0gJoG4lfPvrQqSLeGi+QCoUvN3aHpoKFFAu4SlYewULyMcTvii6HXMbV3TcszQvLLcq9pdWaB/8uC+1xb+nS1En5mbpkRKI1Y8p1nRTZ2SwiAMnoyQJhE5bOfTHXjWRMUpgCCmf7a69LBERyfYeOIgNqhyGBcQH/by5BL2Soi0Rxuni1Qxx88nTerJhhUPT7PoI0a6rUA7o8EftG1eqB/3lyF0Sarq/K/ieQNFKxCgPosDXY2zTHwZTgYIVoajQHa0MhBmzS0EAMeYeGEwf9mIkdEiqsWoRyEUclMkUpH9Hj1lBN44tmzayCzNyWYIo9mvzVmUtwmsA3gLbSzM7CZun7eFwN5BZ3klQYrzBFjsp1D2U07Xg35Ysu0f+X6PJCC9JtA4I4OD8cXeOjYXZyXzpIy3LsmJnVijGhA7fpx15luODDq1e0wRHGoCGlljKOMHhmbnNv1AKDjJCEE91IEhy+ysO+OPsZrMXs/3wEtJY4w3bwvnDozVPadbxk0UxLDogzboP5UxcqJYNmpnJTjKY9DM6zyB3XRX2y61PE6DlN33blVZZl2Scz6E/5hAcqi3xSlE HC1jWbte zzVrjClXiGdw/FyHtJcqo6dXDR8vmo184QOTS/qajnV+dfdE2lexgftHQVXL0ftGXqwHz5SBgqWqGb/1cYH0wyIDr4U4HTnbzsG6S/OV4+7Ax9wck7Hz6pCoSrudBKa980r++5oJpgV1w68jZSiNnRDwjfCAJ6Iy+uF4ZgSs4YzRX13Kb7E0k2mKKjCyeg/wyjgWbzo1b7N5HgfsGX7a1eoXBYbMUQePHpmrq X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Dec 03, 2024 at 10:31:59AM +0800, Ze Zuo wrote: > The commit 0aef499f3172 ("mm/usercopy: Detect vmalloc overruns") introduced > vmalloc check for usercopy. However, in subsystems like networking, when > memory allocated using vmalloc or vmap is subsequently copied using > functions like copy_to_iter/copy_from_iter, the check is triggered. This > adds overhead in the copy path, such as the cost of searching the > red-black tree, which increases the performance burden. > > We found that after merging this patch, network bandwidth performance in > the XDP scenario significantly dropped from 25 Gbits/sec to 8 Gbits/sec, > the hardened_usercopy is enabled by default. What is "the XDP scenario", exactly? Are these large or small packets? What's taking the time in find_vmap_area()? Is it lock contention?