Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp532911lqt; Fri, 19 Apr 2024 03:17:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0asfLNMbLX6VyQYQ6MQA07Ds72pVNlJQBBVEqgVKh9MprKGln/6KVw13UREoOI4NH9SyeaxjeIPy7wy21xL0YEXPmlheSySnIy3etbA== X-Google-Smtp-Source: AGHT+IF16sERVebLao7d8YkdCWrDVfk7pADZW3gIrRkjIUiLtY1dzyZlROMeUXfXcaaEuUDCqic2 X-Received: by 2002:a17:906:ce4c:b0:a52:58a7:11cf with SMTP id se12-20020a170906ce4c00b00a5258a711cfmr1110089ejb.2.1713521829298; Fri, 19 Apr 2024 03:17:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713521829; cv=pass; d=google.com; s=arc-20160816; b=AqEy10ONfGVx/is7EB2SXWc077PVnLF11hk1KHVTrgdw4gEqNOplHzEV6OPf0t03rC nz/aaNsk9MTCi807MdYgp3nJaPv8pVi6aT+cmzN8YAC7Fo6sgFSDTKl1Ch3w2Qdq5XG7 SHChp8apoqDW0LRnqWZiDJU/yk4oW88J9xSl3Vh7hEfk55W+NF2Qb2KD1FTQzWNMKyYf bs+dZpx7QvTM4qjqJMxB0WhKjmWFZub0IlGJ6/DV18A+kbW9/cy6KCWoCb/DgqPUKT33 fqrrEXy52zYXugRHJ3dx1Ly2bPpr57wjY7Lsq49aLlkbx3btCLUgn9wV/24eqjeQVOP2 NOog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=quM63crfd1qy+ADizxnvgIVenMyXIvAEX0e83769e3g=; fh=xEGr2dC1shJJpJeoX6uZ91Fwv5slElf8Ipym9qL78ko=; b=lCPUq9C5wpoZk23gpDflh5jLm5RtQHMe6ZMPzG3eB7tqScmzt0hqFWkOTScRB7jEsZ ky9vd/09BwtcJelEVSGNPlcA7MhEE/4K2e9LxYiLueFUJJkQSdj8+dUjy387GW6Q7pZa DRVLlE0LJX1ovv9AcFetizUJJGcVAgJ5bgCUU4joYvoNFYtFfIZaDrFwCtIZ53iPylt7 MVkyTEIXAQgiQT/kLW3oa4A/3J3YJ097UQvs1dOfZmNjA5c6Ic0sms3a/W/ShUhvTnXv f4LsEbUEPsAzTHC/67a1ZlqcyP3hpfbDVMF6hKit/Y7a4eoecqmVezekXyy3xaZqDXhz 5EFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tNIPxI5H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s7-20020a1709067b8700b00a5245767d95si1937583ejo.131.2024.04.19.03.17.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 03:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tNIPxI5H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151306-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C773A1F21F96 for ; Fri, 19 Apr 2024 10:17:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3FF37D3E6; Fri, 19 Apr 2024 10:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tNIPxI5H" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4434745EF; Fri, 19 Apr 2024 10:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713521816; cv=none; b=PTQbxDatjWDJnmFsXDXcwBAE51EwuPyUbaHjru51lP60NPJ/ANR8K85buPaaeqG1/PEaXN24rdgrK94oAg0YOIoGw6c+RsWUgfkx78NyHAq9qjXNnCRdcZaNGgl7h7ogN4bJVwqTHSgqaZlifM74TfQgIsewAsaQFaG9LKkkBno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713521816; c=relaxed/simple; bh=aC+QA5rjhgsuTqn2kdyip+wg1YmdpSU1U1t0y/JyVB4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BBEx+dtWFV8eTC2KaPcn+c36V/AZx7bQ2D9qhqkX5TMxEPRhevYPfZSQ1Chs2B/VD8qrbQLpf51NiJvHwCA8qeTxTNPNpM+0su3ow4F5i4WOkZFWJuss/9eUwAiQDZYfU4bi9z8rkV7qqxYKOAbl/SlGxQPGURg2kO/z/6g5zdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tNIPxI5H; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9E1AC072AA; Fri, 19 Apr 2024 10:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713521816; bh=aC+QA5rjhgsuTqn2kdyip+wg1YmdpSU1U1t0y/JyVB4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=tNIPxI5HOVILSTXuczGUDtJGoDhmBpJGSxMEqBFvHNc2zXK33PEiKk4HM+8mTjKo/ bu1QPvghvyq31zosBe16/stXNcEqYWg5NdaCyQQ+0r0jpOYs1k0v8NDfk93oso4wyk 3jIMkkHrA7DgSmPunJ14oE0XNCHPHd0btuepG1tf77WZG83xIcjHaeL1Gzdw/tFMp1 Dau3NJVvA9W6sTlorR3yNNq/IyMUo29+AmiNyDXYRERCMv0FSe56YLuG2ErpFVxtuG o8+arByas5NQ5ha1eVk7zFPlQHUct8n2jtqpmfHIuwRBE2lZiVWcAn6bP2VSZQrscQ qR9DgG4w1BvVg== Message-ID: <33295077-e969-427a-badb-3e29698f5cfb@kernel.org> Date: Fri, 19 Apr 2024 12:16:52 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 3/3] cgroup/rstat: introduce ratelimited rstat flushing To: Yosry Ahmed Cc: tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, cgroups@vger.kernel.org, longman@redhat.com, netdev@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, shakeel.butt@linux.dev, kernel-team@cloudflare.com, Arnaldo Carvalho de Melo , Sebastian Andrzej Siewior , mhocko@kernel.org, Wei Xu References: <171328983017.3930751.9484082608778623495.stgit@firesoul> <171328990014.3930751.10674097155895405137.stgit@firesoul> <72e4a55e-a246-4e28-9d2e-d4f1ef5637c2@kernel.org> Content-Language: en-US From: Jesper Dangaard Brouer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 18/04/2024 23.00, Yosry Ahmed wrote: > On Thu, Apr 18, 2024 at 4:00 AM Jesper Dangaard Brouer wrote: >> On 18/04/2024 04.21, Yosry Ahmed wrote: >>> On Tue, Apr 16, 2024 at 10:51 AM Jesper Dangaard Brouer wrote: >>>> This patch aims to reduce userspace-triggered pressure on the global >>>> cgroup_rstat_lock by introducing a mechanism to limit how often reading >>>> stat files causes cgroup rstat flushing. >>>> [...] > Taking a step back, I think this series is trying to address two > issues in one go: interrupt handling latency and lock contention. Yes, patch 2 and 3 are essentially independent and address two different aspects. > While both are related because reducing flushing reduces irq > disablement, I think it would be better if we can fix that issue > separately with a more fundamental solution (e.g. using a mutex or > dropping the lock at each CPU boundary). > > After that, we can more clearly evaluate the lock contention problem > with data purely about flushing latency, without taking into > consideration the irq handling problem. > > Does this make sense to you? Yes, make sense. So, you are suggesting we start with the mutex change? (patch 2) (which still needs some adjustments/tuning) This make sense to me, as there are likely many solutions to reducing the pressure on the lock. With the tracepoint patch in-place, I/we can measure the pressure on the lock, and I plan to do this across our CF fleet. Then we can slowly work on improving lock contention and evaluate this on our fleets. --Jesper p.s. Setting expectations: - Going on vacation today, so will resume work after 29th April.