From patchwork Tue Apr 16 17:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 13632260 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 D275EC4345F for ; Tue, 16 Apr 2024 17:51:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 496226B0096; Tue, 16 Apr 2024 13:51:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 446776B009B; Tue, 16 Apr 2024 13:51:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 334786B009C; Tue, 16 Apr 2024 13:51:32 -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 174E96B0096 for ; Tue, 16 Apr 2024 13:51:32 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9722CA19E1 for ; Tue, 16 Apr 2024 17:51:31 +0000 (UTC) X-FDA: 82016137182.21.909FB9C Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf08.hostedemail.com (Postfix) with ESMTP id 8747A160026 for ; Tue, 16 Apr 2024 17:51:29 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FAmSAcR6; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of hawk@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=hawk@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713289890; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=oEWKmCtUb8giZahChZ30F/upfJjYlK9V1G00405z+Tw=; b=qUUGo6iokJn8Nt2iH5ZTsXqy1foz0oxxZb8YatbTleGZbnkvvtXSCMSFeehEMjqH7olI/x u00QBKYAe2vQqgCmInro6XqtMCFtuiv+Rh9fH87oCHltLrf6AMBMlN8hbh+TQ/9AmT2dBr BJueUGROf+3G640Zx6d2RHdiwezUaJc= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FAmSAcR6; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of hawk@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=hawk@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713289890; a=rsa-sha256; cv=none; b=Kwfh+/ehdcVwnUDejnOlI957AxqKwzC/9egjk612lINpvsqRlDYh0UipXKzYHHN86wHEKd QPyHGzj9VtwXZ963SR14oR5sNMqJs542dxV1c6A96DUqaGMqTgkUV7qY35dsGGlcYMyuUm PBW0FxkkRUzVNRrBY30rPCr9LecAu5w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 027AFCE068B; Tue, 16 Apr 2024 17:51:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEECFC113CE; Tue, 16 Apr 2024 17:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713289885; bh=bM4xJrevzHisjJsEBCKMA21c1+HdvIZqUoYp2jCPlJw=; h=Subject:From:To:Cc:Date:From; b=FAmSAcR6ed3Fi+OIR5DzruE8DSs+YfuciiT/vPtdTIR08H4t8Vx9gAqgaWFWagxOQ gJW4+sL1iz+m0xWQtVZpMl7RIW5S0ufVGcXMGJZOdU7dmCzn0X21tdcFljjJ6XrRlM xjmXTs6bUj9Tvrz2bo5yUPQjnruWastd0fcH97gH/DgUEGy2NoEtP6IIos+FZp7++4 ccmzDFNPzkTRYfPIs3D9h5LIvUZPKsz33aMHRSD1DfGVNNucW9AAuMClftZvfPEYYA rF3SqZSlqtRhExXS6EUYr3IfizqJ5W5nND9fgkb48e74MFsdtYEFE80+yd4x9d9sZL DRkygFoJbUvog== Subject: [PATCH v1 0/3] cgroup/rstat: global cgroup_rstat_lock changes From: Jesper Dangaard Brouer To: tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, cgroups@vger.kernel.org, yosryahmed@google.com, longman@redhat.com Cc: Jesper Dangaard Brouer , netdev@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, shakeel.butt@linux.dev, kernel-team@cloudflare.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Sebastian Andrzej Siewior , mhocko@kernel.org Date: Tue, 16 Apr 2024 19:51:19 +0200 Message-ID: <171328983017.3930751.9484082608778623495.stgit@firesoul> User-Agent: StGit/1.5 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8747A160026 X-Stat-Signature: rzpq1op5utspq8z6t53f4hytm9z1iaxr X-HE-Tag: 1713289889-603780 X-HE-Meta: U2FsdGVkX18pC07FlGdlXlZzrBAffo8wBgf6/J+cIrI+RN9Qa56J6r1bwdysVm124IgPrUE8old6eP+vLn/0SYScNqDE0VvJnUX01SfYTRw211soUz8I68MbEcFW8GQ+JvGUuM1ImAj4kfnqQl5Rp8cKJZOpNlWN4dFsKq0/Yw8VxWTrlwfDFN//ZIY/xzcedot6EbHtnd+vTk4+pS4/tIlgbwHdmNuc5XVwQPBazszfIdPZvNDZ/wBElSEAbirqSmZ0ltkbVPW1KLqxxnkjK8V1x8Ew7ftEK1+Y8XeLaOiDFVGAHpFI0zh0+OAmzhyU8ICyuH2GfqPNoR8yDT4rdXH9iuyDojaZ1TSVJAZYrTWtYC75IPK+YME0W7NEkaF4Bqg4CQr/5OgSdPOpjc2j24R1Ke5Wycf4N76R18M918kjd8wykCf3Po9Mpb4AyCUbkR+D2mgzqRt3OntEtX7qDH+9rpp72Qd2K3lkus48OjY9Oguh3PVoiga2FA0TcAplZvrMhKe8a+/zdzotyzvGXtBR01sbEkbGDkkkcTFpGJ6m9ySw9ex55ziCHg9D+gob3RvtL6y/KyOSDkn3pKFTlbzoDk4QAyI/Lcysu/Ap9WfxbfALW163ezk4y8O9YaZWUBB5r7A5DU1rshS55WQ3wqwb2SJS413brjh0o/sfAzwKKhnjSdWXxIeFmT6/5QD8e7KIl1fudwUY+jjVAlIj/kaDsGD8q8N/Dt8h7UknqIseeDkPCeUMnpzEMrXWgBYQftH4ENC2zoZP+djbVbdQGuFf48LxWd6n0b/mdE3k1shTbwiBrkj5zARp8S0x7zZFfx12jQfYBORPDINDCs7Leb5T3+ko4U4EYrEITdyvSqOoVpeE0xrqaRz28F4Rm+sxdOsXMnUN/vwxNtZj7ZAlcl68v9xU52QLyI2Bcg8vZpK486mw49qJ9q4n5VxWY540oZzWKJFFD1+RSBal54r rQNh4Tns eq6xXPpbCHDV/f8R02cd4XzCgTb4F0JJc6jnp1ktxbBtVD66xCcTDm6vJg82G6Bn33SYTtgzZ4xkVwyZpUHVlfp+S0AOTeWGUDMgnkj+SVxptUAaD1ppBHs9AQ1NWPIR4oSXUhKAIg1h8R16Akqyv33CU5OGf2jI96PmMIu96Ra2QRWChXPzfu0cLpWUTmTFQxvu4jHZuoMIlcvxFjN549JP2is8MPih2GRHmQZ2S4XZSG6a4AFpOZdjsVIj2gA9zAOzRL6WCn2fKHNnwahFvsoijMKPYIJp6qJzV X-Bogosity: Ham, tests=bogofilter, spamicity=0.000209, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This patchset is focused on the global cgroup_rstat_lock. Patch-1: Adds tracepoints to improve measuring lock behavior. Patch-2: Converts the global lock into a mutex. Patch-3: Limits userspace triggered pressure on the lock. Background in discussion thread [1]. [1] https://lore.kernel.org/all/ac4cf07f-52dd-454f-b897-2a4b3796a4d9@kernel.org/ --- Jesper Dangaard Brouer (3): cgroup/rstat: add cgroup_rstat_lock helpers and tracepoints cgroup/rstat: convert cgroup_rstat_lock back to mutex cgroup/rstat: introduce ratelimited rstat flushing block/blk-cgroup.c | 2 +- include/linux/cgroup-defs.h | 1 + include/linux/cgroup.h | 5 +- include/trace/events/cgroup.h | 48 +++++++++++++++ kernel/cgroup/rstat.c | 111 ++++++++++++++++++++++++++++++---- mm/memcontrol.c | 1 + 6 files changed, 153 insertions(+), 15 deletions(-) --