From patchwork Tue Dec 5 13:30:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Schnelle X-Patchwork-Id: 17573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3429175vqy; Tue, 5 Dec 2023 05:31:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0kJu8X60FHpv7l3rvD9Xrq5C83xq17fC94NEQAnBdXRWjdIWFdPCzbB7c3jlPNvpPGKsE X-Received: by 2002:a17:902:d212:b0:1d0:6ffd:6115 with SMTP id t18-20020a170902d21200b001d06ffd6115mr1603543ply.55.1701783074940; Tue, 05 Dec 2023 05:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701783074; cv=none; d=google.com; s=arc-20160816; b=gdVwd2wxnTvSKBG9R0SB7RePMch0EtUMqaHxEGNwdJhUythB/Ua1seOCC0vNM4GeKq 2qyxhK9sgKCqBdkua/h2uX6t8SZYTqCZncrRrTNsr2rutVuc99eglqUvn+0BB3URFf0v +bVL1h9lhzBSjgfrOWOaiZuSI3zGaE38LY0wi2urGVFTGLsWGx4EeunaxjMYmJBo0h+f /VsMbdy9lM9kGycA1CcW6uK6tIyBwKb6SfdjsZxfxGpLqJ8IaKSBx3i6BTMpyyfNS3fh eBjuA1g5vy7ZtoBCipGd+TW8zSMniz45Z9AsDN8E+o0P/d22c3NnlGz4ZgIf9M2tfnF9 VrMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IxxfLKX8MzSwgz9dQIi2KYO51vLAAjIBTx7N6eaZqN0=; fh=U2g0jiA3Tw7gpGNywwyfYnxP8tTSM1Q6YkOBxeYNVJ0=; b=g47D5ktObRMFF8DBfp9S07s1cvxgdEeD36jk20q4EOU9XVPrw/u7cjhNGJv65o+TmT WN8h8ojMXWO5rTI6A6F6oIb6JLqSKGsyUPj1MhAQNNLpKSgOFFcUdS3adBiVpB4Ytb9j fsqpHiYbMeF1WAOyITBmI44i8z755LAxuraZQX8kL9Pw/WSJGUn5Slm6NlZuoPDG1dtt uHhzl0F1CmRo0r1N+WBLyw8KWQL3fnRCG2nICMKoThnoVl15f/Fkk4m4klj9Ypxq0bVc BmzG78r4R/qjfb4OBxguctHXK9kPn5EOBzmj8FundWg4R/srjWttkYVgV6zv5Ppm5Amb FlYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gjYZk7dq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id g5-20020a1709026b4500b001b3d6c68bd1si7377653plt.643.2023.12.05.05.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 05:31:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gjYZk7dq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1FCD581112C9; Tue, 5 Dec 2023 05:31:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442219AbjLENas (ORCPT + 99 others); Tue, 5 Dec 2023 08:30:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442200AbjLENam (ORCPT ); Tue, 5 Dec 2023 08:30:42 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBFE19B for ; Tue, 5 Dec 2023 05:30:47 -0800 (PST) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B5DMxxL014011; Tue, 5 Dec 2023 13:30:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=IxxfLKX8MzSwgz9dQIi2KYO51vLAAjIBTx7N6eaZqN0=; b=gjYZk7dqkmvyTD1Ne1g0A1RtVertEoNUDNbb+OmI69mYV+nRG82vmZTRohZPVAo9uPoz TI9FlB4AHnD2CqHjyQC+KucDFD/WNAPhAmOoF3tcQnQIdTlM/K4A3OfxosBNoctMUEzP PRzvHeGfE3FDrWyP2WaRjPmjC+HUXfuYo1+Iq+aSocNpKc41TIpTAe3i3IPlm1Ze27Yd kRM8efmmzjGJIOFDpLSC5cI1AxZkEHE95Srjd7MpSswT+dLScMpQteKZidgziYV1w9VX y6lnYaf6QntVtfqMUQJtsThfjKcW4fdqH4h0hYunIDypKk18GvVhfXRvprVb5h+utYsR nw== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ut4pq8ayk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2023 13:30:26 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3B5AnuS1028493; Tue, 5 Dec 2023 13:30:26 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3urv8b3knd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2023 13:30:26 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3B5DUOqw59965918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Dec 2023 13:30:24 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC18E2004B; Tue, 5 Dec 2023 13:30:23 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD5A920043; Tue, 5 Dec 2023 13:30:23 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS; Tue, 5 Dec 2023 13:30:23 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 55390) id B17A2E08BE; Tue, 5 Dec 2023 14:30:23 +0100 (CET) From: Sven Schnelle To: Thomas Gleixner , Peter Zijlstra , Andy Lutomirski Cc: linux-kernel@vger.kernel.org, Heiko Carstens Subject: [PATCH 0/3] entry: inline syscall enter/exit functions Date: Tue, 5 Dec 2023 14:30:12 +0100 Message-Id: <20231205133015.752543-1-svens@linux.ibm.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Qp2KZ1wCvP--ewQ9wSU_vP71h_4m-_ku X-Proofpoint-GUID: Qp2KZ1wCvP--ewQ9wSU_vP71h_4m-_ku X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-05_08,2023-12-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 mlxlogscore=499 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2312050105 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 05:31:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784448889784679399 X-GMAIL-MSGID: 1784448889784679399 Hi List, looking into the performance of syscall entry/exit after s390 switched to generic entry showed that there's quite some overhead calling some of the entry/exit work functions even when there's nothing to do. This patchset moves the entry and exit function to entry-common.h, so non inlined code gets only called when there is some work pending. I wrote a small program that just issues invalid syscalls in a loop. On an s390 machine, this results in the following numbers: without this series: # ./syscall 1000000000 runtime: 94.886581s / per-syscall 9.488658e-08s with this series: ./syscall 1000000000 runtime: 84.732391s / per-syscall 8.473239e-08s so the time required for one syscall dropped from 94.8ns to 84.7ns, which is a drop of about 11%. Sven Schnelle (3): entry: move exit to usermode functions to header file move enter_from_user_mode() to header file entry: move syscall_enter_from_user_mode() to header file include/linux/entry-common.h | 137 ++++++++++++++++++++++++++++++++- kernel/entry/common.c | 145 ++--------------------------------- 2 files changed, 138 insertions(+), 144 deletions(-)