Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp146391ybg; Tue, 28 Jul 2020 02:12:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsPvOfZNaq5pBhN5BrFUbHFDSsSDGtps5JKp3FjebJ+TIcZDg+ktLD+tISHhQ73r0QQ97h X-Received: by 2002:a05:6402:377:: with SMTP id s23mr25719905edw.200.1595927544820; Tue, 28 Jul 2020 02:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595927544; cv=none; d=google.com; s=arc-20160816; b=nWkOkjaT4GGJsHyHpAvrJM0GBV00i1KbeSExC8DzneS/bZRUgx2SyIdmwcgZ/NTWf8 cvLkgsaCYuGbkH0bv5Jydyb3L8ceDBG8GIPqo0a7ch0fp1ff44D4+c4giR3tF5u2fcfz E3Y6JiWelyXNrQQc1MwlLZnVYiCSVYvDtHpC36QxQlq2Frafe0JxeYSH1lAbGQMsb1gg wU2dxOq5stu1jSG2WZVroffMcWEGEQ9WzBCO1s0EJIr3lb4qmBfne1OrLp0nB2MhTgHP i+VYaMmFmUSeM+H13irUeMQHh1xcD8dAdBagS44TT7OiuUf3sEYO65QWd+zRqQi0zo6a DzmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=RCy2UfD9USNG2MKnEjkeIua+Kr2VV9azOis7p2H6lTo=; b=Hkz0wIm1/uGx7Vc3mSpAi+ITFsq0T0BJZHo43j4w1GGiTf5d9UCYX1/wNXcidimIV7 Rt8RQZWh9g2AMEwPB8p7nNw8xnOCwv2uVncQrmxFEpb4Z4lt9zl0smlTxHr0xJukYf9D mA1xhyo/oZxVyixhDGloVbzaGm77SRCJPvkj7WiUk8/moItnh4dJ8YEWInzhlT3JPZCW 2mlYzmQ4cLar/U2zi1RGZRE+sjRiqeoAcmp6rEa4Bqkz1Kzd+7ORhE65DiB4eXw9aoYw dtrpvemPfDjqvzLPOVrT/Xa37SdxywzQSVUKZBKgo19e+QkeKGCZ/vNFH6pRBDDlSa8T 8pDw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si7429519edd.112.2020.07.28.02.11.59; Tue, 28 Jul 2020 02:12:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728421AbgG1JJg (ORCPT + 99 others); Tue, 28 Jul 2020 05:09:36 -0400 Received: from foss.arm.com ([217.140.110.172]:59026 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728321AbgG1JJf (ORCPT ); Tue, 28 Jul 2020 05:09:35 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D78930E; Tue, 28 Jul 2020 02:09:35 -0700 (PDT) Received: from [10.37.12.33] (unknown [10.37.12.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5FFE13F66E; Tue, 28 Jul 2020 02:09:33 -0700 (PDT) Subject: Re: [PATCH] sched/fair: provide u64 read for 32-bits arch helper To: vincent.donnefort@arm.com Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, valentin.schneider@arm.com References: <1595847564-239957-1-git-send-email-vincent.donnefort@arm.com> From: Lukasz Luba Message-ID: <7131ec02-39ae-fe8a-e3d6-171a6e6c8103@arm.com> Date: Tue, 28 Jul 2020 10:09:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1595847564-239957-1-git-send-email-vincent.donnefort@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vincent, On 7/27/20 11:59 AM, vincent.donnefort@arm.com wrote: > From: Vincent Donnefort > > Introducing two macro helpers u64_32read() and u64_32read_set_copy() to > factorize the u64 vminruntime and last_update_time read on a 32-bits > architecture. Those new helpers encapsulate smp_rmb() and smp_wmb() > synchronization and therefore, have a small penalty in set_task_rq_fair() > and init_cfs_rq(). > > The choice of using a macro over an inline function is driven by the > conditional u64 variable copy declarations. > > #ifndef CONFIG_64BIT > u64 [vminruntime|last_update_time]_copy; > #endif > > Signed-off-by: Vincent Donnefort > I've run it on 32-bit ARM big.LITTLE platform (odroid xu3) with the CONFIG_FAIR_GROUP_SCHED and CONFIG_CGROUP_SCHED. I haven't observed any issues while running hackbench or booting the kernel, the performance of affected function set_task_rq_fair() is the same. Function profile results after hackbench test: --------w/ Vincent's patch + performance cpufreq gov------------ root@odroid:/sys/kernel/debug/tracing# cat trace_stat/function? Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 4068 3753.185 us 0.922 us 1.239 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 4492 4180.133 us 0.930 us 2.318 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 4208 3991.386 us 0.948 us 13.552 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 4753 4432.231 us 0.932 us 5.875 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 7980 5037.096 us 0.631 us 1.690 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 8143 5078.515 us 0.623 us 2.930 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 9721 6477.904 us 0.666 us 2.425 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 7743 4896.002 us 0.632 us 1.188 us -----------w/o Vincent patch, performance cpufreq gov------------ root@odroid:/sys/kernel/debug/tracing# cat trace_stat/function? Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 6525 5830.450 us 0.893 us 3.213 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 6646 6069.444 us 0.913 us 9.651 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 5988 5646.133 us 0.942 us 7.685 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 5883 5390.103 us 0.916 us 29.283 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 3844 2561.186 us 0.666 us 0.933 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 5515 3491.011 us 0.633 us 9.845 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 6947 4808.522 us 0.692 us 5.822 us Function Hit Time Avg s^2 -------- --- ---- --- --- set_task_rq_fair 4530 2810.000 us 0.620 us 0.554 us Tested-by: Lukasz Luba Regards, Lukasz