Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3550258pxp; Tue, 8 Mar 2022 17:13:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuFTx3Zd1DcgVnrOoHcs/uLGcs/xVTtFI0pqyzfV9ZWqT2L9hS51ioWN0BYC3dUSzYEc5b X-Received: by 2002:a63:3d0b:0:b0:37f:ef34:1431 with SMTP id k11-20020a633d0b000000b0037fef341431mr16050966pga.547.1646788385251; Tue, 08 Mar 2022 17:13:05 -0800 (PST) Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b18-20020a056a000a9200b004f139308bddsi496689pfl.110.2022.03.08.17.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:13:05 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; arc=fail (signature failed); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=livemail.tw Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9113A1BD9A0; Tue, 8 Mar 2022 16:21:12 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240281AbiCHGef (ORCPT + 99 others); Tue, 8 Mar 2022 01:34:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231716AbiCHGec (ORCPT ); Tue, 8 Mar 2022 01:34:32 -0500 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2107.outbound.protection.outlook.com [40.92.98.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45B6E3A709 for ; Mon, 7 Mar 2022 22:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ggw+RbO2tN6Z/JQFnQKgZ6jmBsppYOGHiFYVcE9lXMjBZj13rRn+6o/oj57E1G6Dey8ihM4IzkjTRmhPRoKuKx+7yXYFFd7Us8JmK5WIPTWGY83h7ERLl6RCUfjOvC1EuF5O2gaUMS4TNlryff1HK8p87jiUp8+cg2V8zq5QZ9T8wZMZissdBiDAUty0hY1crdYEbXG+UzGWvJ7cKwHoK6HB/s9LDbpu21LoaLd//knC0VpR0yu1gEqelBd7V5bd925W6f8z1PnJR3enZkYCg2XhAge+jyHHaXG0s5CGOUexGIuTz86vFKiaX/Wv0H0Drx0pwWewvbbKYaxoRXqXOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a8GN93pEWGUlF0KdEgOhbaqrfDSvnLiBhbus0urt/vc=; b=Y7WgZsAAret8v1ORB7ZnHqJ6Ryahn9bzLUnH+wpxi//8nQUeEIkTrO9dGlTce2X5pGZHGDkbbdZZeq5hnhpEMEtEY6DAGgukC8Ri5soi1Y0vhz/Hwv7i4FrJIXRm+eaL4fSXvoEcpPTkwZ1/z8gDvY7IkarDgXupkUOSoWl6oa2uLBWi1zZzWDZ96EAvccOAk5ugocoNYJSwJil56TXfkFhgJ7vfHS7uk971SWecAkqmo+uhEJcelfSYzhLivgyQzgP2x1Sd+YbPU/5D1jxUXHnWXY0ITXGPkzF5l65/mwXbQi48TVTVmAyMqNMRXg68MehwQ354p3OlPyK3FrWq+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:11e::14) by TYWP286MB2005.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:166::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Tue, 8 Mar 2022 06:33:31 +0000 Received: from TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM ([fe80::d80d:59f5:2572:ab1d]) by TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM ([fe80::d80d:59f5:2572:ab1d%5]) with mapi id 15.20.5038.027; Tue, 8 Mar 2022 06:33:31 +0000 From: Oscar Shiang To: Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, Nitesh Lal , Nicolas Saenz Julienne , Frederic Weisbecker , Christoph Lameter , Juri Lelli , Peter Zijlstra , Alex Belits , Peter Xu , Thomas Gleixner , Daniel Bristot de Oliveira Subject: Re: [patch v11 00/13] extensible prctl task isolation interface and vmstat sync Date: Tue, 8 Mar 2022 14:32:46 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-TMN: [bS9NK6e6VKQMlwyr0Tio1k0X2qaLWbTP] X-ClientProxiedBy: HK0PR01CA0058.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::22) To TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:11e::14) X-Microsoft-Original-Message-ID: <20220308063246.3668-1-oscar0225@livemail.tw> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b28e898-1246-4600-2483-08da00cd904c X-MS-TrafficTypeDiagnostic: TYWP286MB2005:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y10ecNaTp3TIUOMhOBrypDelLiSQogkqmQGLLpnBqF0h7mOpB0I42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KhPJ7hWwS?= =?us-ascii?Q?LKqJgM6MpAu6bulu3ptgrwLHtbTp7qZ7+YiBCRNTYiPqz/TDaR8hCFD11D47?= =?us-ascii?Q?0fHInX8Kf4+wv5FFIjyrLmcDWn8bHht6SyCSBv5xh27bYNe+SRmYNm4adt5f?= =?us-ascii?Q?MRVuIuuxglF46QBJs9+xPsmsBJm0haQxumxXPzeTtbdCfs5djifosdfpEJgn?= =?us-ascii?Q?2A3NYYwwaPpHvtyjut4p0a/Y5MhpDJEmjNUacZvCIITmC1+89iivOs9otCOK?= =?us-ascii?Q?xTH1JrkdSVzrQZ89ox0f6VegDal6LaE8rbOJvoxxqW1yOlwut9WalnFN7IZl?= =?us-ascii?Q?wukQejK3yKUd5GYWr1bVudYEJYZdQPA0ldB6IudlNe0D4a72p/b5bhNSbdoD?= =?us-ascii?Q?6xKBWAd24IPmldSSMEBfseT1xhlwLZFL1QC6k5lhvkzjDXQN56qS0H9gonPb?= =?us-ascii?Q?w10e+QPgY8/DvcR6t3BGuX5QOgSnX51iDwKR6aALzSezuZbJTuCdua+D10Qw?= =?us-ascii?Q?MuXEpOdNdKUdVX5Hh2PTqix5B/Dt5huL+TMHEEVVlIQsviWWOvU/Paj8nQzI?= =?us-ascii?Q?rRKRzmNFrm0tyAv8oJYd/1I6lKYFubjUfx33QRTYcBWZT9TLXzsQnLuD5NzR?= =?us-ascii?Q?cgwK2zPPDJ7V1H7ozyNhzg=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-05f45.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 6b28e898-1246-4600-2483-08da00cd904c X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2022 06:33:31.8675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWP286MB2005 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Feb 24, 2022, at 1:31 AM, Marcelo Tosatti wrote: > Hi Oscar, > > On Sat, Feb 19, 2022 at 04:02:10PM +0800, Oscar Shiang wrote: > > Hi Marcelo, > > > > I tried to apply your patches to kernel v5.15.18-rt28 and measured > > the latencies through oslat [1]. > > > > It turns out that the peak latency (around 100us) can drop to about 90us. > > The result is impressive since I only changed the guest's kernel > > instead of installing the patched kernel to both host and guest. > > > > However, I am still curious about: > > 1) Why did I catch a bigger maximum latency in almost each of the > > results of applying task isolation patches? Or does it come from > > other reasons? > > There are a number of things that need to be done in order to have an > "well enough" isolated CPU so you can measure latency reliably: > > * Boot a kernel with isolated CPU (or better, use realtime-virtual-host profile of > https://github.com/redhat-performance/tuned.git, which does a bunch of > other things to avoid interruptions to isolated CPUs). > * Apply the userspace patches at https://people.redhat.com/~mtosatti/task-isol-v6-userspace-patches/ > to util-linux and rt-tests. > > Run oslat with chisol: > > chisol -q vmstat_sync -I conf oslat -c ... > > Where chisol is from patched util-linux and oslat from patched rt-tests. > > If you had "-f 1" (FIFO priority), on oslat, then the vmstat work would be hung. > > Are you doing those things? > > > 2) Why did we only get a 10us improvement on quiescing vmstat? > > If you did not have FIFO priority on oslat, then other daemons > could be interrupting it, so better make sure the 10us improvement > you see is due to vmstat_flush workqueue work not executing anymore. > > The testcase i use is: > > Stock kernel: > > terminal 1: > # oslat -f 1 -c X ... > > terminal 2: > # echo 1 > /proc/sys/vm/stat_refresh > (hang) > > Patched kernel: > > terminal 1: > # chisol -q vmstat_sync -I conf oslat -f 1 -c X ... > > terminal 2: > # echo 1 > /proc/sys/vm/stat_refresh > # Sure, I did see the terminal hung during oslat with FIFO priority. BTW, thanks for providing this test case. I used to run all workload stuff to just verify the improvement of task isolation. It is a more straightr- forward way to do. > > [1]: The result and the test scripts I used can be found at > > https://gist.github.com/OscarShiang/8b530a00f472fd1c39f5979ee601516d#testing-task-isolation-via-oslat > > OK, you seem to be doing everything necessary for chisol > to work. Does /proc/pid/task_isolation of the oslat worker thread > (note its not the same pid as the main oslat thread) show "vmstat" > configured and activated for quiesce? The status of task_isolation seems to be set properly with "vmstat" and activated > However 100us is really high. You should be able to get < 10us with > realtime-virtual-host (i see 4us on an idle system). > > The answer might be: because 10us is what it takes to execute > vmstat_worker on the isolated CPU (you can verify with tracepoints). > > That time depends on the number of per-CPU vmstat variables that need flushing, > i suppose... Considering the interferences outside of the KVM, I have redone the measurements directly on my x86_64 computer [1]. As result, most of the latencies are down to 60us (and below). There are still some latencies larger than 80us, I am working on and trying to figure out the reason. [1]: https://gist.github.com/OscarShiang/202eb691e649557fe3eaa5ec67a5aa82 Thanks, Oscar