From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95B6CC6FD1C for ; Thu, 23 Mar 2023 13:32:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3125F6B0072; Thu, 23 Mar 2023 09:32:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C2C16B0074; Thu, 23 Mar 2023 09:32:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 164176B0075; Thu, 23 Mar 2023 09:32:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 068B96B0072 for ; Thu, 23 Mar 2023 09:32:45 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 97A9040629 for ; Thu, 23 Mar 2023 13:32:44 +0000 (UTC) X-FDA: 80600253048.01.7828E7F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 77E621C0028 for ; Thu, 23 Mar 2023 13:32:42 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GdF0K3aC; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679578362; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D0+UIJf+hRDi9UkxorblNOIBkjDzSQBgUMEBtPodtXk=; b=kR2Ph56B/ybhEfp8mSqHnUa6NMkarAywbyBgQYHBeEIN2lQdJct9AI9fINZDLj6Y9KT3I/ QQlZxisoNuSMkNVeynDR4dYxSpKwxSq6Dp/5oC/3SrRit2V5x03BsUb1DKtV39F/LVsjkH dUbPNmbpkT1+e+joIKgYu4aNEc61DhE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GdF0K3aC; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679578362; a=rsa-sha256; cv=none; b=EVwClOwfZ2MxQ26NMSl4mf8OhNKM8wmXfOtqxqMI6M6dvnKKtBD3YjwxNRJoSevZlahsBn +uve4FpTaBuHM9IL5xAdoADGj3yPHBFXlEH9MAMdHscxllRGq2fgbn1h7ZUraniYDb+JFh knnX3aS/MVY9A3w/c6xXJBVpTNoMHDk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679578361; 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=D0+UIJf+hRDi9UkxorblNOIBkjDzSQBgUMEBtPodtXk=; b=GdF0K3aCKJQrJ8d8joJXoswu4NWIfAQsrTVAQN70xr2zyaBl29acLCZTSG7XTepsOE0r4G x1VX9q/2D2LHjwNvD1QTAtLtGyTcC0hHq2847JnbylWitHF9EajZ4GKdxGbumkizT+DC6Z ljtfhkEfEAy6utBSrkkkwwIeOUpuwJg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-116-DZqokFX7OLmnTRvdk9qSNg-1; Thu, 23 Mar 2023 09:32:38 -0400 X-MC-Unique: DZqokFX7OLmnTRvdk9qSNg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 064131C0A59C; Thu, 23 Mar 2023 13:32:36 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CDCDC15BA0; Thu, 23 Mar 2023 13:32:35 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id B193C403C40DA; Thu, 23 Mar 2023 10:32:15 -0300 (-03) Date: Thu, 23 Mar 2023 10:32:15 -0300 From: Marcelo Tosatti To: Michal Hocko Cc: Christoph Lameter , Aaron Tomlin , Frederic Weisbecker , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Russell King , Huacai Chen , Heiko Carstens , x86@kernel.org, Vlastimil Babka Subject: Re: [PATCH v7 00/13] fold per-CPU vmstats remotely Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 77E621C0028 X-Stat-Signature: 7dbmgfg8nu5ytgh6aw8m6sdgtou4d8mp X-HE-Tag: 1679578362-94171 X-HE-Meta: U2FsdGVkX1+dJSx+z5nx2ec4icZj2qmxlm9Gpcgw/jTXziHlHH0hK8Y2wfI41W89pbb92VVx+5SlO2yRY2AXGcxC4e98IPTySEt1QVMGhra1Jl++wmKmIES/M9VZhFYnu4c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fsHrB+9YmhRn+q6wi+SH5p4OyeOoQtQhW X-Bogosity: Ham, tests=bogofilter, spamicity=0.000014, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 23, 2023 at 10:30:13AM -0300, Marcelo Tosatti wrote: > On Thu, Mar 23, 2023 at 01:17:32PM +0100, Michal Hocko wrote: > > On Thu 23-03-23 07:52:22, Marcelo Tosatti wrote: > > > On Thu, Mar 23, 2023 at 08:51:14AM +0100, Michal Hocko wrote: > > > > On Wed 22-03-23 11:20:55, Marcelo Tosatti wrote: > > > > > On Wed, Mar 22, 2023 at 02:35:20PM +0100, Michal Hocko wrote: > > > > [...] > > > > > > > "Performance details for the kworker interruption: > > > > > > > > > > > > > > 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 for certain applications." > > > > > > > > > > > > Yes, I have seen that but it doesn't really give a wider context to > > > > > > understand why those numbers matter. > > > > > > > > > > OK. > > > > > > > > > > "In the case of RAN, a MAC scheduler with TTI=1ms, this causes >100us > > > > > interruption observed in a guest (which is above the safety > > > > > threshold for this application)." > > > > > > > > > > Is that OK? > > > > > > > > This might be a sufficient information for somebody familiar with the > > > > matter (not me). So no, not enough. We need to hear a more complete > > > > story. > > > > > > Michal, > > > > > > Please refer to > > > https://www.diva-portal.org/smash/get/diva2:541460/FULLTEXT01.pdf > > > > > > 2.3 Channel Dependent Scheduling > > > The purpose of scheduling is to decide which terminal will transmit data on which set > > > of resource blocks with what transport format to use. The objective is to assign > > > resources to the terminal such that the quality of service (QoS) requirement is fulfilled. > > > Scheduling decision is taken every 1 ms by base station (termed as eNodeB) as the > > > same length of Transmission Time Interval (TTI) in LTE system. > > > > > > In general: > > > > > > https://en.wikipedia.org/wiki/Real-time_computing > > > > Thank you, but not something I was really asking for (repeatedly). I am > > pretty aware of what RT computing is about. I am not really interested > > in a generic fluff. I am asking about specific usecases you have in mind > > when pushing these changes. > > > > > For example, for the MAC scheduler processing must occur every 1ms, > > > and a certain amount of computation takes place (and must finish before > > > the next 1ms timeframe). A > 50us latency spike as observed by cyclictest > > > is considered a "failure". > > > > OK, you are claiming that much but you are not really filling up other > > holes in your story. Let me just outline few questions I have. Your > > measurements talk about 7us overhead the vmstat processing might add. > > This is really far from > 50us above. > > 7us in the host, for the following sched_switch events: > > oslat -> kworker > kworker -> oslat > > However, if the impact is for a virtualized application: > > oslat, executing via qemu-vcpu process in the host. > > oslat executing > qemu-vcpu VM-EXIT > qemu-vcpu -> kworker > kworker -> qemu-vcpu > qemu-vcpu VM-ENTRY > > is much higher than the 7us (can be above 100us). And nothing prevents this from happening: oslat executing qemu-vcpu VM-EXIT qemu-vcpu -> kworker (in the host, to handle vmstat_update) kworker -> qemu-vcpu qemu-vcpu VM-ENTRY oslat -> kworker (in the guest, to handle vmstat_update) kworker -> oslat