Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1045313pxm; Wed, 23 Feb 2022 16:44:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9AfU3zTBu9IjTAk2AfIyXB0j6NLenQEtg6qMS0Gkv8wh3lGUewVFIsituuBk1J4tuj5ur X-Received: by 2002:a17:902:704b:b0:14d:2c86:387 with SMTP id h11-20020a170902704b00b0014d2c860387mr76875plt.1.1645663449493; Wed, 23 Feb 2022 16:44:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645663449; cv=none; d=google.com; s=arc-20160816; b=qZiV4Vmj/C91Vw10eIm7bTunMtjnrsYUmTO7Wd1fPPF8Kin9D4Lu9+CkEAN+ekBnHM iRPvfobxbTfD3vPTYAm07JldxwCOlJLVOLjCEowb8BKotL2Ef+Qi5tUXW4QmjZ04YClA CqqabmL6zbCrBoE/dO9AYE1wQNJ2Ze3BKTf5PeRVlCT15ry/pTAi4eAyq1syaclgrpPX EDzfjwC6Uc1sdGsIRXpqrCBWw3lgi0CVyUIYNyc6WfPOCXxQrYmhGNCUFnFGy+CepFyC aT0AcrLc/r10jb+fWfwD6/QaW6Q3N21RdyO5tC6/mOTvY10xhpfQQdm9gFlYGx1q2u8s KgwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fZTx6rkdVq8MJb095qCc+m29wfJPTq/nh3YyPpCbjOY=; b=sMllWRLawJldjvJffeIZHO3J8PcAOcU2Add4AUgB6cIY8P74vYT2gynsXSUxH8kJqm n+91VO8mu1PcLgbFAdu4kNDT0W40W9/p7iHMtrG9a9bQHbnQEx2+sDCvtZBS0ziYGzeY w/6Va5LdyNk6o+E7h+PICMrwGaVQRPiEZZRRvRc78JhbMJK8OZAHLScphVkTInNBqo/C Fp91rEC6ovlzK2hSZdhf1YvDg7rZ5CcHb53VdED1f9/bcu1sqp6d+39AZXUifxqvtx5e AGBO//yLJDfMbc77cRecfxdIJ54SsvFzMkx8scKbe0pBCF/OT5R+BXJRX1rGufVOTeik Ujkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W2GlMo6T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s21si1162413pfu.268.2022.02.23.16.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 16:44:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W2GlMo6T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E75D3B91F6; Wed, 23 Feb 2022 16:41:02 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243504AbiBWRsf (ORCPT + 99 others); Wed, 23 Feb 2022 12:48:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243501AbiBWRsb (ORCPT ); Wed, 23 Feb 2022 12:48:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2301626CA for ; Wed, 23 Feb 2022 09:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645638482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fZTx6rkdVq8MJb095qCc+m29wfJPTq/nh3YyPpCbjOY=; b=W2GlMo6T0eOuPxlUMhFWu9wMovCJUWWgoX4xyD797ZkdBqd9BFcjhY9NOds+OHV3yDp95h jEaxYh+hDnaztwTnt9NwTvbdRaji6sLPuFDua6kLbTicSWzZSSadSMmSNX6IKmdHw3+sti RUfRCnhchnmhtGAv+iZ+O6cwFFKxgrA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-JV4nWpbuPvChy6MBoD9asw-1; Wed, 23 Feb 2022 12:47:58 -0500 X-MC-Unique: JV4nWpbuPvChy6MBoD9asw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0B921006AA6; Wed, 23 Feb 2022 17:47:56 +0000 (UTC) Received: from fuller.cnet (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C958F1086486; Wed, 23 Feb 2022 17:47:21 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 337594168B84; Wed, 23 Feb 2022 14:31:03 -0300 (-03) Date: Wed, 23 Feb 2022 14:31:03 -0300 From: Marcelo Tosatti To: Oscar Shiang 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 Message-ID: References: <20220204173537.429902988@fedora.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 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 # > [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? 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...