From patchwork Mon Dec 9 13:25:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13899766 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 A4C45E77180 for ; Mon, 9 Dec 2024 13:26:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C9AF8D0057; Mon, 9 Dec 2024 08:26:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 14D546B043F; Mon, 9 Dec 2024 08:26:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03C308D0057; Mon, 9 Dec 2024 08:26:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D76196B043D for ; Mon, 9 Dec 2024 08:26:02 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5ADA01A04DC for ; Mon, 9 Dec 2024 13:26:02 +0000 (UTC) X-FDA: 82875493134.24.4EDB19A Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf21.hostedemail.com (Postfix) with ESMTP id 6E1B91C000F for ; Mon, 9 Dec 2024 13:25:20 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf21.hostedemail.com: domain of ruanjinjie@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=ruanjinjie@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733750750; a=rsa-sha256; cv=none; b=zU5pF+CPt0GHEOuaw82c4QfB+HOxyJ2K5j+ZZEWxygZiNGaJeNL4ytGbabOJ0LG6+OpMNd Xl+sb3eOz2sJP+p0QHnDYBf/7SnOaEcm+qHYNwEekBGeGZqQlX9K2aBcrtaIh7xSg62qhx CICB9EpDqELnKhPMDIONwKSElEpkYWo= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf21.hostedemail.com: domain of ruanjinjie@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=ruanjinjie@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733750750; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=vasX3XVk5LszVrdTcvaegdlOiZ5yLFtfcVlSG2qsjUQ=; b=AoTLdKMfUh+vv8fEyzU9YzHbuIALYefFQgaR/AHI/galvFAHsTvDG0ZgmWUfD3c0dSPNsV /YPGIYhJLYhOl+E6We/u+CyhFQDAvvpRWUrI2hQA66tUDO1UL4MZVnDgxn4Rb4CwbosrMG Ib1u4Xz4r2/2r01rReTxCB9yrxmxoT4= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Y6Mx80YRbz1V5xd; Mon, 9 Dec 2024 21:22:52 +0800 (CST) Received: from kwepemg200008.china.huawei.com (unknown [7.202.181.35]) by mail.maildlp.com (Postfix) with ESMTPS id 3AF9C140FEC; Mon, 9 Dec 2024 21:25:55 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemg200008.china.huawei.com (7.202.181.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 9 Dec 2024 21:25:51 +0800 From: Jinjie Ruan To: , , , , , , , , , , , , , Subject: [PATCH 0/2] userfaultfd: handle few NULL check inline Date: Mon, 9 Dec 2024 21:25:47 +0800 Message-ID: <20241209132549.2878604-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemg200008.china.huawei.com (7.202.181.35) X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6E1B91C000F X-Stat-Signature: b77dpxxckuhao9wpbnw8btdk4ruyzw5x X-HE-Tag: 1733750720-920989 X-HE-Meta: U2FsdGVkX1+EQESXAgWNnWxBXlRAMfEp61NKtBwDXCQZG6ZPH27oOHNwlLI+CgynOlmRJWp70A2mVRwBQ/BCdWTg+8rLjhFtYGYMtrx/LFP+ic/zONb4ID0nFgvpzoSQk7v6Ah//5T/XsZ7euLi5Vtxkoy/kntKvvVZBd+87T28tjgtbZyoMW59L5EygaQvLEPnUD7hgl3PukwSW4WjX4xdPeVaOpyVtz/OV3vvpkYO4itIhd7vzedkOGCpzfwMPu+2gmK3rM0xOfUfOcbbuTQVYnJPvBLCg2BDgoHwuk3+4APosPUvW6/EYShbmAUUQJGB2PC1B5Eoigyj050JJ5hloJV8q/9h1UJ6zmJK1wZrgqTICjfDkP3tyor2kwRBUAhavmnZgLfd9cbNjLWrOTtM8yKaUD5n/cla/FsmtClPzrvNXJ8cIyh887p/KepS2eq2SHQriptp8YG7sHJoPtn2GWm7VoOiv2hPLRSlbxSMfQOxGcAXNtz9xqewjPaL3olFFBAx4AC7fXe/5dWklqQmc3T+cmIpWRz6DXCgcE4zaKe04TPHawT5zxVDwB7khcK52bChB5H1L2JWF0oUXioE+PYlAGdLKpvzEOB/UsUdRKItFYIaS4G4WMm6Axwb533a6JgG2wyyrVvzczdw1wKYi4EnxcQuWMvfBKo/wburs4Stfhc/VA8N6Kk1N8ZAWPJ3uzJl80IrSA7aG39zsaA4mRM7iDvSggC9/uNYtL9cD+9V412iZc3f6HbPyhkeZEuaiQ6qUCcFRv5dg3iMLNI4r1po3m67NFA9qbJSsvyPXuXq8oWt3mPRGCqhdefAzv6by1Jx3GH1pfzmIYWX4YxpyIffXq4K7MGkFHjYeoQqBsxCxckOVICd/ATlt2gaH37twh2tt1L3ZYePWS4I7fxYeVj47eFEz7rudcya5XoEzN/ROfwVL501hG/nH4icPitAC8fcJ+b+u5kKpNMN xx5rTJAw 95yUa2XG86LHJmEo4Ciw6ndtqN6oCKkUQOTpVhwaWAQPOUpHssRN78egA9LJAIQD1/sL3B9qOPJowDXrXo6pk6m9OConiaNSmhgbuYKPpNlS6jv2NDdRix4hmKg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Handle dup_userfaultfd() and anon_vma_fork() NULL check inline to save some function call overhead. The Unixbench single core process create has 1% improve with these patches. Jinjie Ruan (2): userfaultfd: handle dup_userfaultfd() NULL check inline mm, rmap: handle anon_vma_fork() NULL check inline fs/userfaultfd.c | 5 +---- include/linux/rmap.h | 12 +++++++++++- include/linux/userfaultfd_k.h | 11 ++++++++++- mm/rmap.c | 6 +----- 4 files changed, 23 insertions(+), 11 deletions(-)