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 E4687C54EBC for ; Tue, 10 Jan 2023 16:12:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 487C38E0002; Tue, 10 Jan 2023 11:12:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 438028E0001; Tue, 10 Jan 2023 11:12:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FFFE8E0002; Tue, 10 Jan 2023 11:12:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1D74F8E0001 for ; Tue, 10 Jan 2023 11:12:37 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D8A8CC1031 for ; Tue, 10 Jan 2023 16:12:36 +0000 (UTC) X-FDA: 80339382312.08.5250947 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf25.hostedemail.com (Postfix) with ESMTP id 2F708A0026 for ; Tue, 10 Jan 2023 16:12:33 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cVFp8Eru; spf=pass (imf25.hostedemail.com: domain of frederic@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=frederic@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673367154; 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=Ikq6RVFlRaWYrO1txOr5QC1+BaNYBP5f0BRbloFUcsk=; b=sLjwnqG/rXg4IuCZe7QBLKlxqtThBG9c4M49OlAig7BgPpLr+iZ7rH8yLziWPUEKNRYwAT IiKeSakjpeG0UX0bmFYupmXHmCbs/DT0WiOxPbvTvQ73wmKbvXWptcv3wzC+/b6B93VY0+ 7ovchM4PDzc8/+qnO68BNmnzp09LMcQ= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cVFp8Eru; spf=pass (imf25.hostedemail.com: domain of frederic@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=frederic@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673367154; a=rsa-sha256; cv=none; b=bCf2/P2mlfSRoidvX9USPiGR1nJbMSGhpWmUos1nnN+/XsDaYs5EN8vwDQPbYNuduWFb28 jyaEb/fUo2NlMtUF0i5GpLnsdLycYVbxf/s9fr9GvB4FubElF6GxCNh8YeOpJ2r22rmJf+ K5XA71QieODYCrGRW5u3WBBO/yLZxuE= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 28848B817BB; Tue, 10 Jan 2023 16:12:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1831C433EF; Tue, 10 Jan 2023 16:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673367150; bh=BHR15KV7j/mY6DkIeo7xOuawAwemaEc/pZ+yDqH89rU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cVFp8Erub9/6Z2hg1mpXGwPhgS5X08t85PQ1pkQkCVYK+HsdVCOAcPm1t5MR7jooc YCKYE72SZTNpscwPf5m1bEmMZJN5ix+AXHxnQV+Pp9XPIwLGO9WSwSKz1Td0oUqp1s +Yj6fDpn0e7ATw45dQp2hrlFbnsabKpFlQyefvxiiqegOrZXEbtnOMTmuexIQzi/sy 6baqh5jodXMEk7HZZ8A66b90gWnOLFvljN6eUZjCOXaO0m3l+v2GRA2/JJtoAWOgkY qAwwdkUtDEkNaWU3bTM/t7+7OsLZBRdo1heIx8unFSmunA1ISl4iIGgQUT0Ir0UVGi dcGDyCd7JaIOw== Date: Tue, 10 Jan 2023 17:12:22 +0100 From: Frederic Weisbecker To: Hillf Danton Cc: Marcelo Tosatti , atomlin@atomlin.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v13 3/6] mm/vmstat: manage per-CPU stats from CPU context when NOHZ full Message-ID: References: <20230105125218.031928326@redhat.com> <20230106001244.4463-1-hdanton@sina.com> <20230106150154.4560-1-hdanton@sina.com> <20230107001529.4617-1-hdanton@sina.com> <20230110024356.336-1-hdanton@sina.com> <20230110151901.402-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230110151901.402-1-hdanton@sina.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2F708A0026 X-Rspam-User: X-Stat-Signature: hijrbmugqzwaefx9twxr5qqjrtzawzup X-HE-Tag: 1673367153-359789 X-HE-Meta: U2FsdGVkX1+bNglJHGoQt75nfEfJ9a6/yBCqaMhojGUrufBfpbI5G2SeNZ7hGUBOAlCkECgojc/IpvKAt0JkJfBjSKPrlIaWVFTGCoh9dwreX++NI06YM6saViwug7CV86TQSEOAJJpAGjiQfhixnjnhamO0hAJPBMREDQ7EgMkYgT5w0fl7bTZASHlWVjEzd0HXUPgqXHjGEPAq6FqZzFCEs5ohIaqUsjLclrvpLKtC95tz8l6q8dsNaU9f98ArFEXyqS+VH/VFdAGhWQ5yKxWpkJF6EUGwrTO5L8rnIYwhOCXThBcmvbTw+kjnKV8gmnnYC1TZRIljdSIC3TZhCw0nVWIVW38QhBPwtTyFaDzEmBHjZ1H/02WWvxycz88xtwia4SPuQshnTR22v7YGW1or3plu5aQBmyEOLFm9QEY4dmWMR+G+k6Nzzx+vSnH0PSSPptrt8paOzvNQvBLbyHG29A5D/mMksM6ERWIT2gaOFUuIrC2MpVF5AvOdeOwWxxDij+37IovdnQlv+bNfqfde/dp48sPK/XhbEEIhTmqRh1BzLiW/+h8BsxVlEt4ng6evx3ycNukE0Az3gSq7m7H4YvZh1aBFLgnq0TRD8NYoZJkUjRGDx+4xR/BE8YJzpqnNOIesJNYY5fsaYEHr4O23Mdcx8k4u35KNBxOz6xHHYDrXP4xmIx4LRdDA8MOQqf8mJVcC92f4NIKmqqkIeDAGoewmPcZM+1H4qgv52KeSOfPr6yxkGRyppbiB/FGbnp7o+h3hoZKJ6a3EQoj9++M7l0FB7/jHkVDSyJDlUZR3MqHCBJaFA1fIWs4GUdzQSh0pxazkYx7g2Ve/sgD+erU3RUH+L196OMPXXTA524UZ9cWcFubBgCEKZYXqAJb6QrtggHH1l2PczGvM5U+/01Gk/UUXSjphYPe+dPSy5zY1F6XYRuhBa803mB9FMqXu5D6KGjwzuo5950gz5Qt hEg/XbSE 6tHaxmYrq2qOLqLbHcm8QxFf05g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jan 10, 2023 at 11:19:01PM +0800, Hillf Danton wrote: > On Tue, 10 Jan 2023 08:50:28 -0300 Marcelo Tosatti > > On Tue, Jan 10, 2023 at 10:43:56AM +0800, Hillf Danton wrote: > > > On 9 Jan 2023 11:12:49 -0300 Marcelo Tosatti > > > > > > > > Yes, but if you do not return to userspace, then the per-CPU vm > > > > statistics can be dirty indefinitely. > > > > > > Could you specify the reasons for failing to return to userspace, > > > given it is undesired intereference for the shepherd to queue work > > > on the isolated CPUs. > > > > Any system call that takes longer than the threshold to sync vmstats. > > Which ones? > > If schedule() occurs during syscall because of acquiring mutex for instance > then anything on the isolated runqueue, including workqueue worker shepherd > wakes up, can burn CPU cycles without undesired intereference produced. The above confuses me. How others tasks would help with syscalls that take too long too service? > > > > Or a long running kernel thread, for example: > > It is a buggyyyy example. > > > > https://stackoverflow.com/questions/65111483/long-running-kthread-and-synchronize-net I can imagine a CPU spending most of its time processing networking packets through interrupts/softirq within ksoftirqd/NAPI while another CPU process these packets in userspace. In this case the CPU handling the kernel part can theoretically never go to idle/user. nohz_full isn't optimized toward such job but there is nothing to prevent it from doing such job. Thanks.