Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2624720pxb; Sun, 17 Oct 2021 20:50:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUryVL897klPv6xlJn2lxHs9tWgROw5YdUVAwaooTNGT7T6rDZn/v23dcRnK3rKqiNw3g2 X-Received: by 2002:a17:90b:4ac1:: with SMTP id mh1mr30117231pjb.144.1634529044460; Sun, 17 Oct 2021 20:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634529044; cv=none; d=google.com; s=arc-20160816; b=tRxckpxZkrisVdAGDZfs361In7xzx//CAvIKj3rNPvsF7Hi6tW8IMUM01F3gCvI/wX bdGZD+UNTQ+MF0nSG3vd5oHzAMfoY3HOmkl67qjYXjO/L+jGaXihejMEDuSujtFgBi1m hRMqYcrJzzhnSNnmSUuiMXZAEZ7W5cz9hTGyZjMZeOyEu/qgDe29M/f+06QXWXxOk6kd dJAOvKy+9pSTzts5HICA0CorIB1k96uzqBf1p/RVOaHgIgr6KZFaWfsd8WEM3Ow1Jme+ eFBeWpuwPh1PX15C4E/Gq9IPB5zKuFEfSVKtCeTnXHbxJ87O7r2LTvU1r/04B0i+zk9h IXpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=SFVjxN4Q39KMIkGtiiawMo9zCtifnSBm1taSRpnKui4=; b=dHzrDAitZ/PhETYe9bSR/zkC1zcIK4Q2L4xOJ0DhN0AiN7DLUfltyjvQ/pQeR2hLCU dgpwsbC+AKwhvK5MJZzBWlRqjiPGblg2erWryoMnIH92wDaYLyJyMmt480Ik2OmDJdS8 W0lVRMn4VxzUD3YWTh2EqxdIQjcOZxeRwHMqaLetLgOhGypxYI49+jmvEnfTG8+3ouhl gk/hdiLgE3VMOzsueSoIzKpawEcBaMTH0V8p4lxGbiAmjQ7M9SnKw0GYUV48Jhlck6wn 2wVVrjnNPmOqTue9hUiJ9AQ/qXtSpizhPXWtaXLwlTSc0nPTg8eidW7jn/3y6u91e1z8 A7Iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si15040425pgg.211.2021.10.17.20.50.32; Sun, 17 Oct 2021 20:50:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231776AbhJRDZ3 (ORCPT + 99 others); Sun, 17 Oct 2021 23:25:29 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:25163 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231645AbhJRDZ1 (ORCPT ); Sun, 17 Oct 2021 23:25:27 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4HXhx75Fr1z1DHgh; Mon, 18 Oct 2021 11:21:31 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 18 Oct 2021 11:23:15 +0800 Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 18 Oct 2021 11:23:14 +0800 To: , Steven Rostedt CC: linux-kernel From: Yang Jihong Subject: [QUESTION] Performance deterioration caused by commit 85f726a35e504418 Message-ID: <992d3b1c-70db-5cc7-8400-39caa5d502d5@huawei.com> Date: Mon, 18 Oct 2021 11:23:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tom and Steven, commit 85f726a35e504418 use strncpy instead of memcpy when copying comm, on ARM64 machine, this commit causes performance degradation. I test the number of instructions executed by invoking the trace_sched_switch function once on an arm64 machine: 1. Use memcpy, the number of instructions executed is 850. 2. Use strncpy, the number of instructions executed 1100. That is, use strncpy is almost 250 more instructions than memcpy. Has the impact on performance been considered in this commit? :) What is the impact of revert the patch? Kind regards, Jihong