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 865D7C3DA59 for ; Mon, 15 Jul 2024 19:34:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFE946B00A7; Mon, 15 Jul 2024 15:34:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EADCA6B00A8; Mon, 15 Jul 2024 15:34:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4E6A6B00A9; Mon, 15 Jul 2024 15:34:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B1C4B6B00A7 for ; Mon, 15 Jul 2024 15:34:34 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5087A120206 for ; Mon, 15 Jul 2024 19:34:34 +0000 (UTC) X-FDA: 82342988868.12.67406CF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 7F2F81A002A for ; Mon, 15 Jul 2024 19:34:32 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DQGIhepx; spf=pass (imf19.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.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=1721072043; 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=1KX7IEr2zKnMtYo6NKNA4TARkllCcLg1jqXMkrl6O60=; b=TdaOFfqME3nQctakLm/PMeXv4kupkIvH1llplWdYhjDnS1T/wZY4iAT3qlBeDFeLWpWpqx 3Fzhbawt8JovoTcZW8YsKrrS4DU6FTkPZJ4W894Gro5/bZ58MjnMqzPHkoUDK0I1iProDn bVM3IDlunySbqrjVzzYEnXF59AIc9X0= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DQGIhepx; spf=pass (imf19.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.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=1721072043; a=rsa-sha256; cv=none; b=8XpIKZgiAwSjMuIzP94V4IuWkx3ouUSCpT28bCtLlX6ZJ2X8NoUHirYMkPvaoRzLHd3NB7 AM+/otbLJTk9KPXxOMSiLPAEqmpLSxhVrCxQtw4YFulteIYDj/HYlu4Fjb+l3Mf3M1IXDt GpogEJsun7nqnQDUElsqWfcFO80DkR0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721072071; 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=1KX7IEr2zKnMtYo6NKNA4TARkllCcLg1jqXMkrl6O60=; b=DQGIhepxbJimDBfW+zxceVur2jZwTkqbDCMVrLdJXruHB0D4TpSxMYx58erE83ETDamYSA 6bYkJmvJ0/cutabV0Kh39pRerRh/0vLO0DMEwLXwztBBRkI/I1wGUhVN0w1J0foiY1O7uv uVMxFzRWNc23uYRmhBgsDQVzCNXBu7w= Received: from mx-prod-mc-03.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-497-seHeETyFOkWXnSB293hp-Q-1; Mon, 15 Jul 2024 15:34:28 -0400 X-MC-Unique: seHeETyFOkWXnSB293hp-Q-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C62E11955D44; Mon, 15 Jul 2024 19:34:24 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 184B73000190; Mon, 15 Jul 2024 19:34:22 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id E7095400EC901; Mon, 15 Jul 2024 15:38:27 -0300 (-03) Date: Mon, 15 Jul 2024 15:38:27 -0300 From: Marcelo Tosatti To: Vlastimil Babka , Thomas Gleixner Cc: Leonardo Bras , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v1 0/4] Introduce QPW for per-cpu operations Message-ID: References: <20240622035815.569665-1-leobras@redhat.com> <261612b9-e975-4c02-a493-7b83fa17c607@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <261612b9-e975-4c02-a493-7b83fa17c607@suse.cz> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Stat-Signature: 5tih87ph9s4ftja55skyuxn5s6eju49r X-Rspam-User: X-Rspamd-Queue-Id: 7F2F81A002A X-Rspamd-Server: rspam02 X-HE-Tag: 1721072072-442405 X-HE-Meta: U2FsdGVkX1+yd/GAKcrd73+txHZhUsIu1WG1bGcIjhXQOVccDdS72oqj8E0tL2fJrAl5Fv6MGUorO87fB12l3rszQ83n0w1o9fy9Ruc51IENytk++R02WXVp238BT9AMFoUFfNBZzWb0ToSXpXjSuAtNkZPSaA0lViZg3bUXh5Um2z5JAi+ogsG9DWq5WU5+YuWtyAEV3HwqSA6K2dXG+09/qL5UFMLuYGQDd72FYAinGQpS3n9Ba5ccb3kcGrMUSCaABO502NmdeAmUzLPYKq7ciMEsSOaus/CxhLkR8+J5ikuYIq+VpMHK/gVTfhfYfP5HZFxNlxnBqCBPx7BMZSbJ8n19z0VcdFrO+P8RLIPwYXG5SjF61VYpc4Frj5udk/3wNhfLEpSXLYtv7FCdAPcsO1o5oyK3PGHm6jGQFJVFqduLOvIweb/TwnNNVOC55dPoIqzC24tFYaH1E81gs6pEHlu+YZdPaOpYaAdQ01L6dSbVuLnspXCPEVvIzmfHoy/1I5RRVRA/payemBX3VBIiecByUfxRxp9NFNzcsUu6ordKlCkFvPs+Rb6HEWzur7AMu6iOibZ+zphD0JmKGlL0XcQm+pi54VGHaplYdc6Uzn7ehPIVmihYO6zpiIOka2HxDh7zd8TzCNr+O+2Z302i8WnSo4Y6UAC84pybqX2s13BTFzo9Ak9M5PAa4x+iwwLfx6aQqoAz3GOXeeNQhD+lPhlge/kCWOXW/vCBjgV1gUaapaocJiTnGYZv7EXg21BME/fMsykHGdWqQs27/P1i+WfrKANPqqIV/1/O9iZJbh/3ItkvUHrmkOw1+gd+yJNj6PfpCXllEuFDoQgQG4Nm5e+JIRa24uFG/Es/+cvNFFmZq1VcaZYTB89S7moPFKgbRvVtFbYMqyqQ0zwnkOrviidrbPZV0WLNFr4t0NiDzSqIX2RemYhCB2sKhWLCBhwVNCxGKkriFxb4KGb mu7JDddl 8kmRhYLo+2GqlpCDLOz/j13uAQl2qoPvJ9hs3UImFd4rWTPQx2JUD2Pdt74jtA71v2qCtVZ97E9/lvxbwWzmq6+M45mYkIhIYj12Mly86L6+rpZwvwO1qmvHJ1ZHQs0CUGvV0ThXfZNVFBAGiHzbTU+6oDdKm3kPMdsqJjsJ8wAzmAcP32sjD/IynXgX0Wr+VcJPOPRpU4nqk3FdgL+QmcbBae3YNHtz7ryvoBUVYQUJArzm7afsIIZBpROXPdJChqaO+lA7zj2KNQmvzPBdEmjPdFqiwyQcS9AvPtdkp4EeibyJEekPY1OYIgz0jG1ZZqW2+MKygqXeoGqBk3G+I8s+qetgbZnGDEp3rRUIDycTzgIvEMZkVduK9rZvYGuKUJPnkvpXhev7S7BEbtAMXQKA+/5VxUr5R6K3lwBjVOkmAyrLkzDTEr/RM/A== 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 Mon, Jun 24, 2024 at 09:31:51AM +0200, Vlastimil Babka wrote: > Hi, > > you've included tglx, which is great, but there's also LOCKING PRIMITIVES > section in MAINTAINERS so I've added folks from there in my reply. > Link to full series: > https://lore.kernel.org/all/20240622035815.569665-1-leobras@redhat.com/ > > On 6/22/24 5:58 AM, 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. > > > > The idea: > > Currently with PREEMPT_RT=y, local_locks() become per-cpu spinlocks. > > In this case, instead of scheduling work on a remote cpu, it should > > be safe to grab that remote cpu's per-cpu spinlock and run the required > > work locally. Tha major cost, which is un/locking in every local function, > > already happens in PREEMPT_RT. > > I've also noticed this a while ago (likely in the context of rewriting SLUB > to use local_lock) and asked about it on IRC, and IIRC tglx wasn't fond of > the idea. But I forgot the details about why, so I'll let the the locking > experts reply... Thomas?