Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5844709rwd; Mon, 5 Jun 2023 09:15:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lrqgFkmRqSZE7hlbAsYiNU962vMhxS4wg3u30okjO4c8yBKxZugWCqHUFQzCQxuy7meSl X-Received: by 2002:a92:dcc4:0:b0:338:18f1:db72 with SMTP id b4-20020a92dcc4000000b0033818f1db72mr255680ilr.29.1685981744461; Mon, 05 Jun 2023 09:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685981744; cv=none; d=google.com; s=arc-20160816; b=qVh3oOQuS7pQx5duikm5evrzdBR5YocB/jlUseyXk8Z7wLLzH3om9Hl2IrIZW3kBne nkjSzB3SK4bYZpqFzVPIVhG4s+12oaHGt9a3tuI06gaO177ThFwXH7MU5XMJloKHZQ3w IUFkD2MVKMVlcp87xEli+GiOhgIHQs1reXKCOhytnEg9+wxbAnOQyF6S8a/VBWCu44mP n2+UbtPvR4rBEaN4qe1FmE/CdAA2aByeMhnTgQEKq5d5ZZtzrw2jgsVf8wZYz+11KFbZ qx9Gtqsl1LGpzOehifnYNOi9YrTEH1Gdi/gEeonqdJmblEdueEuTWp4RMhOHsebka1AN TvdA== 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=CDbBDd76+g36YdPoCZnc5BqxAkbEzRWHB7RMa8s1Aw8=; b=yO66VRcL15/mKC8ANHSuJ8eXQA2cQSnVvLQUms27vP2RtxmBn/DPgj1FK/8J8H+C7o kVWOV4biAWkiWWpPb0x+sqcKlhOvYnvC9+QEQmaHMkKD+URFRRKdBhRzr2sXhwID8WHV IMUQrkLPdP2KHmEokhefrjqciJ12BvV7I0eVWI6m6FUdrE+5+60knkDJ77y3VTZL3RD8 KpGkSSshhbZneuZrgOD05ySEak5cViVwTbXhZ6ET+zhJB/1Nt0jsJfOZIi3D5jSa1qog otdXXT/oihIQZf3jfkYEH0sPqXH2wC40DOPe78mCrpEluHJ2+H7Y4WK6Ljbq8EFEdBbA H4bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=kOcxagBW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 84-20020a630457000000b005347fcae977si5673113pge.832.2023.06.05.09.15.31; Mon, 05 Jun 2023 09:15:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=kOcxagBW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbjFEPz4 (ORCPT + 99 others); Mon, 5 Jun 2023 11:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbjFEPzx (ORCPT ); Mon, 5 Jun 2023 11:55:53 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E743D91 for ; Mon, 5 Jun 2023 08:55:51 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9444B1F8CC; Mon, 5 Jun 2023 15:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1685980550; h=from:from:reply-to: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=CDbBDd76+g36YdPoCZnc5BqxAkbEzRWHB7RMa8s1Aw8=; b=kOcxagBWDlK6abNkLUwEhfYcWWEv1nJzIqn9WdWYrQYv9HhMA3u0FU90iDBKDp5Dva0YZU 3ekp/u9DseT+VwegoPX0dIufBjiWzYpETX4rfeQifS5O6sdAxec5NbhdpkIWdp3ujbXP7u pVJ3vik/ZrpZbnSfHQ8sbDHb578BXwc= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 738FD139C7; Mon, 5 Jun 2023 15:55:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id po5FGYYFfmRQBQAAMHmgww (envelope-from ); Mon, 05 Jun 2023 15:55:50 +0000 Date: Mon, 5 Jun 2023 17:55:49 +0200 From: Michal Hocko To: Marcelo Tosatti Cc: Christoph Lameter , Aaron Tomlin , Frederic Weisbecker , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka Subject: Re: [PATCH v2 2/3] vmstat: skip periodic vmstat update for nohz full CPUs Message-ID: References: <20230602185757.110910188@redhat.com> <20230602190115.521067386@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon 05-06-23 11:53:56, Marcelo Tosatti wrote: > On Mon, Jun 05, 2023 at 09:55:57AM +0200, Michal Hocko wrote: > > On Fri 02-06-23 15:57:59, Marcelo Tosatti wrote: > > > The interruption caused by vmstat_update is undesirable > > > for certain aplications: > > > > > > oslat 1094.456862: sys_mlock(start: 7f7ed0000b60, len: 1000) > > > oslat 1094.456971: workqueue_queue_work: ... function=vmstat_update ... > > > oslat 1094.456974: sched_switch: prev_comm=oslat ... ==> next_comm=kworker/5:1 ... > > > kworker 1094.456978: sched_switch: prev_comm=kworker/5:1 ==> next_comm=oslat ... > > > > > > The example above shows an additional 7us for the > > > > > > oslat -> kworker -> oslat > > > > > > switches. In the case of a virtualized CPU, and the vmstat_update > > > interruption in the host (of a qemu-kvm vcpu), the latency penalty > > > observed in the guest is higher than 50us, violating the acceptable > > > latency threshold. > > > > I personally find the above problem description insufficient. I have > > asked several times and only got piece by piece information each time. > > Maybe there is a reason to be secretive but it would be great to get at > > least some basic expectations described and what they are based on. > > There is no reason to be secretive. > > > > > E.g. workloads are running on isolated cpus with nohz full mode to > > shield off any kernel interruption. Yet there are operations that update > > counters (like mlock, but not mlock alone) that update per cpu counters > > that will eventually get flushed and that will cause some interference. > > Now the host/guest transition and intereference. How that happens when > > the guest is running on an isolated and dedicated cpu? > > Follows the updated changelog. Does it contain the information > requested ? > > ---- > > Performance details for the kworker interruption: > > With workloads that are running on isolated cpus with nohz full mode to > shield off any kernel interruption. For example, a VM running a > time sensitive application with a 50us maximum acceptable interruption > (use case: soft PLC). > > oslat 1094.456862: sys_mlock(start: 7f7ed0000b60, len: 1000) > oslat 1094.456971: workqueue_queue_work: ... function=vmstat_update ... > oslat 1094.456974: sched_switch: prev_comm=oslat ... ==> next_comm=kworker/5:1 ... > kworker 1094.456978: sched_switch: prev_comm=kworker/5:1 ==> next_comm=oslat ... > > The example above shows an additional 7us for the > > oslat -> kworker -> oslat > > switches. In the case of a virtualized CPU, and the vmstat_update > interruption in the host (of a qemu-kvm vcpu), the latency penalty > observed in the guest is higher than 50us, violating the acceptable > latency threshold. > > The isolated vCPU can perform operations that modify per-CPU page counters, > for example to complete I/O operations: > > CPU 11/KVM-9540 [001] dNh1. 2314.248584: mod_zone_page_state <-__folio_end_writeback > CPU 11/KVM-9540 [001] dNh1. 2314.248585: > => 0xffffffffc042b083 > => mod_zone_page_state > => __folio_end_writeback > => folio_end_writeback > => iomap_finish_ioend > => blk_mq_end_request_batch > => nvme_irq > => __handle_irq_event_percpu > => handle_irq_event > => handle_edge_irq > => __common_interrupt > => common_interrupt > => asm_common_interrupt > => vmx_do_interrupt_nmi_irqoff > => vmx_handle_exit_irqoff > => vcpu_enter_guest > => vcpu_run > => kvm_arch_vcpu_ioctl_run > => kvm_vcpu_ioctl > => __x64_sys_ioctl > => do_syscall_64 > => entry_SYSCALL_64_after_hwframe OK, this is really useful. It is just not really clear whether the IO triggered here is from the guest or it a host activity. overall this is much better! -- Michal Hocko SUSE Labs