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 AC33AFC6172 for ; Fri, 13 Sep 2024 19:01:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D5656B0095; Fri, 13 Sep 2024 15:01:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 284C26B0098; Fri, 13 Sep 2024 15:01:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 125656B00AA; Fri, 13 Sep 2024 15:01:41 -0400 (EDT) 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 DE8926B0095 for ; Fri, 13 Sep 2024 15:01:40 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7DBA5A0420 for ; Fri, 13 Sep 2024 19:01:40 +0000 (UTC) X-FDA: 82560633960.10.A4E969D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id EA0F34001F for ; Fri, 13 Sep 2024 19:01:36 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NQjhAoUU; spf=pass (imf01.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726254042; a=rsa-sha256; cv=none; b=pyLnPIsB/p4TfYt7jg35tmB8WTsPAaz47Vn90ZUzld0j2M6OVXLDG34s7r1cVlHXlPSNlZ uNLgaCRrnXB6ku/c0+2RM8NeYUvwfzPnUYy5EougorAp9hrSrm8cOxhBIThX1G+/N49cJi DiVkLO594vfIRxpJKVJyFePVj+aLTDc= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NQjhAoUU; spf=pass (imf01.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726254042; 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=5WUawk6UeQz1fgAqAjCjADByI3bac24dG1c8uUPGGkU=; b=mu0pchTD9dj8m35MQOU7TcTVZOs3GKJdttGYBNjeGxsGuw0ESYjoHgX53Gtx8Dul5swZW6 yc4cwg7qjxiwi4qyqpKyi3uwrQVjgmU77qeOq8aB2OuW5ypYusF92w2flgLW728GBlDcjn PokscBE2Ly1EahbUvjqmq7pKyM8gziQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726254096; 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=5WUawk6UeQz1fgAqAjCjADByI3bac24dG1c8uUPGGkU=; b=NQjhAoUUfO7xiZOOQzi8Vs01amGgHItWeolAMQigux9stiOqnDdYDrL1c1Tgt37U/Yy6gI pd34vfQCEhA4Mw+QtjfzVoE9W/aQq/OlUYVBBWnF8E6lgSsqsgwzkDOKmnT/k9XFqnOZuF Z3aROkns0kCp6R3von3lnVoTL7uYCvw= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-230-hceF7FbvMV6F0nIyfMopfw-1; Fri, 13 Sep 2024 15:01:32 -0400 X-MC-Unique: hceF7FbvMV6F0nIyfMopfw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 36B081955F2C; Fri, 13 Sep 2024 19:01:31 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.5]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4C2EA1956088; Fri, 13 Sep 2024 19:01:30 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 610B7400E52F5; Wed, 11 Sep 2024 00:04:46 -0300 (-03) Date: Wed, 11 Sep 2024 00:04:46 -0300 From: Marcelo Tosatti To: Hillf Danton Cc: Leonardo Bras , Michal Hocko , Roman Gushchin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v1 0/4] Introduce QPW for per-cpu operations Message-ID: References: <20240905221908.1960-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240905221908.1960-1-hdanton@sina.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Stat-Signature: 8eo65bjt9g775erph58r1zdcrkdrf96m X-Rspamd-Queue-Id: EA0F34001F X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1726254096-622478 X-HE-Meta: U2FsdGVkX1+uQjjwYRTgWCQ+DsKzH+ldy3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xkaXw2VU3HFpUCUiy/AwZW49fLeS6D3U87w8Pxf61BIUxUu3CP1OD3oWX6TwKDjb9FWS1PgY6pwoJ0ulR2gH/iHxClsuRZ9/HK2iucM1gMxANPw891a5FCGlGOk2zkSByNUmUi6y6CCcLqQpDgyYJGWsU5oJc2qSDs6YdtWMhY8HPPqfpr/S4VqDXtdGMwoh4yVwahiQYy9/HlDRf6MUVR8Ew2wGP+KioFIsipFB9UjcrdU2Fk1Pm/dqRpH8QI= 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: List-Subscribe: List-Unsubscribe: On Fri, Sep 06, 2024 at 06:19:08AM +0800, Hillf Danton wrote: > On Tue, 23 Jul 2024 14:14:34 -0300 Marcelo Tosatti > > On Sat, Jun 22, 2024 at 12:58:08AM -0300, Leonardo Bras wrote: > > > The problem: > > > Some places in the kernel implement a parallel programming strategy > > > consisting on local_locks() for most of the work, and some rare remote > > > operations are scheduled on target cpu. This keeps cache bouncing low since > > > cacheline tends to be mostly local, and avoids the cost of locks in non-RT > > > kernels, even though the very few remote operations will be expensive due > > > to scheduling overhead. > > > > > > On the other hand, for RT workloads this can represent a problem: getting > > > an important workload scheduled out to deal with remote requests is > > > sure to introduce unexpected deadline misses. > > > > Another hang with a busy polling workload (kernel update hangs on > > grub2-probe): > > > > [342431.665417] INFO: task grub2-probe:24484 blocked for more than 622 seconds. > > [342431.665458] Tainted: G W X ------- --- 5.14.0-438.el9s.x86_64+rt #1 > > [342431.665488] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > > [342431.665515] task:grub2-probe state:D stack:0 pid:24484 ppid:24455 flags:0x00004002 > > [342431.665523] Call Trace: > > [342431.665525] > > [342431.665527] __schedule+0x22a/0x580 > > [342431.665537] schedule+0x30/0x80 > > [342431.665539] schedule_timeout+0x153/0x190 > > [342431.665543] ? preempt_schedule_thunk+0x16/0x30 > > [342431.665548] ? preempt_count_add+0x70/0xa0 > > [342431.665554] __wait_for_common+0x8b/0x1c0 > > [342431.665557] ? __pfx_schedule_timeout+0x10/0x10 > > [342431.665560] __flush_work.isra.0+0x15b/0x220 > > The fresh new flush_percpu_work() is nop with CONFIG_PREEMPT_RT enabled, why > are you testing it with 5.14.0-438.el9s.x86_64+rt instead of mainline? Or what > are you testing? I am demonstrating a type of bug that can happen without Leo's patch. > BTW the hang fails to show the unexpected deadline misses. Yes, because in this case the realtime app with FIFO priority never stops running, therefore grub2-probe hangs and is unable to execute: > > [342431.665417] INFO: task grub2-probe:24484 blocked for more than 622 seconds > > > [342431.665565] ? __pfx_wq_barrier_func+0x10/0x10 > > [342431.665570] __lru_add_drain_all+0x17d/0x220 > > [342431.665576] invalidate_bdev+0x28/0x40 > > [342431.665583] blkdev_common_ioctl+0x714/0xa30 > > [342431.665588] ? bucket_table_alloc.isra.0+0x1/0x150 > > [342431.665593] ? cp_new_stat+0xbb/0x180 > > [342431.665599] blkdev_ioctl+0x112/0x270 > > [342431.665603] ? security_file_ioctl+0x2f/0x50 > > [342431.665609] __x64_sys_ioctl+0x87/0xc0 Does that make sense now? Thanks!