From patchwork Tue Mar 28 22:16:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13191614 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 A4CECC761A6 for ; Tue, 28 Mar 2023 22:16:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 330066B0072; Tue, 28 Mar 2023 18:16:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E0606B0074; Tue, 28 Mar 2023 18:16:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A9096B0075; Tue, 28 Mar 2023 18:16:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 005656B0072 for ; Tue, 28 Mar 2023 18:16:55 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AA00EC0B15 for ; Tue, 28 Mar 2023 22:16:55 +0000 (UTC) X-FDA: 80619717990.06.ABAF227 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf11.hostedemail.com (Postfix) with ESMTP id E28454000B for ; Tue, 28 Mar 2023 22:16:53 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="hC/hCzGf"; spf=pass (imf11.hostedemail.com: domain of 3VGcjZAoKCNcRHLKR3AF769HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yosryahmed.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3VGcjZAoKCNcRHLKR3AF769HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680041814; 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=ECd9n7cK9XN/T+IJ39MyPXAm65DzgHuyZCFnDGQgZIE=; b=2mK07MVPQDHUzFrihBzWZ9bQWDlbz6pqiD2FsE3r3uiDOWUHe1rRa1i/Yao15ucqk1m17f 2LBXSoL5OdMevnhIvFZ0zaiD4JxDBrcW0gHGImzrXsz+XvQxNWhhbmp4JwzrZgxzi3ohbu IL5zXSTlALa0qhX17pJI6/YFXH0tCtA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="hC/hCzGf"; spf=pass (imf11.hostedemail.com: domain of 3VGcjZAoKCNcRHLKR3AF769HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yosryahmed.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3VGcjZAoKCNcRHLKR3AF769HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680041814; a=rsa-sha256; cv=none; b=Yu7Xf8b/GHrBMP6uQmtqKiYf0vMfIYtu+SwQe13yI57yIBJy/kFo3OmSTSMnBbCFpQoDz7 gGW3a/jkTTZjuR8qC3znSNDYU/jwkOOyeFO0+VLh49k+QAXmJEQz5/V4HiKblhn9HUohJV BIPmJok9FlwwWX3k80IL1BQgsHYjVos= Received: by mail-pl1-f202.google.com with SMTP id k3-20020a170902ce0300b0019ca6e66303so8351509plg.18 for ; Tue, 28 Mar 2023 15:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680041813; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ECd9n7cK9XN/T+IJ39MyPXAm65DzgHuyZCFnDGQgZIE=; b=hC/hCzGf8kQKLtuU/Lq4g/PH8Bikoaov/kMCU55X6hS3y0cgLvVqN0Ui9SeHKqoI2Y MLR9yv7Q6ZpTQchtNNsVDSGumEgnJDRGOrdjWF1vQ04Hu4VkyeJ+agrrQETPfZvxGuwE fYcWpRh33+ZEKqsq/V4FxFGt/SOC7Xson0BSVI7SL+S7Djz8oPuCrC/TQcGQu540vmXS GyCet5dMYq6C9cPRyqnOFXjOod08thOhwnsgDFjm//XeVxGxDJp0Yqlgz0MeTNLqnkrX POTGQvY7O/HgL6iaisQLmX0ut7TKBC/YmOGLurxCyE9UYzyCbGnroCIDWbRRsYz1/a88 d5vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680041813; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ECd9n7cK9XN/T+IJ39MyPXAm65DzgHuyZCFnDGQgZIE=; b=Xl01KPNtcUpxTYwdDe4sEkXhJfKe5/hqLVdbSOMq2Az5EXyyans8WyjYFSLXGSX0C2 KD/wqBGw+JzHjmBTfAlGDLq9FqHMWweiOVBiMFtzD2z0Si/JYDBUtuYWJvfV35WXDc2c 9mZgoPMnCjisUITZOH/hxZrhAxPFQMlM7158Pv4bfEboZNI02xaN7akzmtar6ROriUrN ELmJSo5jRC0/M9adtpzd9twvCI9uq4r6A1l9FggBvpYLQYykSh2xAFAmDwq5WYouNRBL LNvAXnLu6TteyZafqE2+31KFDJpFPe4kuho/xe5esskGxDdpcQw9pvdCt4yKJ/UQmYn4 Hyzw== X-Gm-Message-State: AAQBX9elvz02lxT7HyuZalnwQ23wnE/iJ9cMwkWnPsA+VSgPGE780TFv FO9kg4xfB+OZZdr0jdAL+drJO5tFo16YcnRj X-Google-Smtp-Source: AKy350bt7vkQiq6OhtHhv/j8fBGrKxEfoXOdpNRwyGSGJDzpsapd3WOuPFqtBqzF+StnrMen5GR5vLj6Xa5jtVdE X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a17:90a:6943:b0:236:a1f9:9a9d with SMTP id j3-20020a17090a694300b00236a1f99a9dmr64331pjm.2.1680041812843; Tue, 28 Mar 2023 15:16:52 -0700 (PDT) Date: Tue, 28 Mar 2023 22:16:36 +0000 In-Reply-To: <20230328221644.803272-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230328221644.803272-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230328221644.803272-2-yosryahmed@google.com> Subject: [PATCH v2 1/9] cgroup: rename cgroup_rstat_flush_"irqsafe" to "atomic" From: Yosry Ahmed To: Tejun Heo , Josef Bacik , Jens Axboe , Zefan Li , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , " =?utf-8?q?Michal_Koutn=C3=BD?= " Cc: Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, Yosry Ahmed X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E28454000B X-Stat-Signature: w9hcxwjbbrtzemx7g7nsxr73wtqwj16m X-HE-Tag: 1680041813-836379 X-HE-Meta: U2FsdGVkX18lzMyMpwTSQ4cvu/wizlmhh+skRD6LOmx6Vbt3a3o2iJcPMfhvb9xI1vMaZCcfINIrsF04x+7lqQd/iqHkiOHWhzabIirRHhBCcXmKJPZaWX5EqJt6QafrJoUfxPg6w2EIC5vW9FAemCT907+wJURx9vbwMNOfmu4qLQQbc6W0/jUAZDdfdq638jpRNukm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BES1UCG3Nnac2gSOSQYgUsO4nkY4tAiS49XCvv0cWQ13E86t+IAd5zgB3siXa3RpTOmljjaVCF+YM8Mr7tC9+o01XdHMXe5lvGKlUnrh3AUFsRARvix57/ugi3ercv2A+uNC0jY5+C7IZIToN2JUNpMIa8tc8r01W+DCvLk4fq2iYZoRyvfiQBOTJvKUN3S0MsZo7BNDvMYztwgTL0m9S/hcqRHAhA7aauUhFPjCuTqiZ9JL1c8oqrlk53uLpnigRt2W1594aTeGxcLGM41+o/uV+3JB2BRI8BPzO/Wdwc3Ap5Mw1rBdT476Tppc26yW8vRLUjmR61U1+r7N1R1/zAlJgfbwEPSJqhf+prSillrS2JgsJ6eIat4Nln8R7lYHZm8+dqjiWfMd5ze4ZRhB9LWEk8D+MQHs1DnIp9wh+wCotOcPol42zV8gY7ES0ZyamMfve8xXNgnAEltT9MoPPYrVhuCjQ= 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: cgroup_rstat_flush_irqsafe() can be a confusing name. It may read as "irqs are disabled throughout", which is what the current implementation does (currently under discussion [1]), but is not the intention. The intention is that this function is safe to call from atomic contexts. Name it as such. Suggested-by: Johannes Weiner Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Acked-by: Johannes Weiner --- include/linux/cgroup.h | 2 +- kernel/cgroup/rstat.c | 4 ++-- mm/memcontrol.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 3410aecffdb4..885f5395fcd0 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -692,7 +692,7 @@ static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen) */ void cgroup_rstat_updated(struct cgroup *cgrp, int cpu); void cgroup_rstat_flush(struct cgroup *cgrp); -void cgroup_rstat_flush_irqsafe(struct cgroup *cgrp); +void cgroup_rstat_flush_atomic(struct cgroup *cgrp); void cgroup_rstat_flush_hold(struct cgroup *cgrp); void cgroup_rstat_flush_release(void); diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index 831f1f472bb8..d3252b0416b6 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -241,12 +241,12 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp) } /** - * cgroup_rstat_flush_irqsafe - irqsafe version of cgroup_rstat_flush() + * cgroup_rstat_flush_atomic- atomic version of cgroup_rstat_flush() * @cgrp: target cgroup * * This function can be called from any context. */ -void cgroup_rstat_flush_irqsafe(struct cgroup *cgrp) +void cgroup_rstat_flush_atomic(struct cgroup *cgrp) { unsigned long flags; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 5abffe6f8389..0205e58ea430 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -642,7 +642,7 @@ static void __mem_cgroup_flush_stats(void) return; flush_next_time = jiffies_64 + 2*FLUSH_TIME; - cgroup_rstat_flush_irqsafe(root_mem_cgroup->css.cgroup); + cgroup_rstat_flush_atomic(root_mem_cgroup->css.cgroup); atomic_set(&stats_flush_threshold, 0); spin_unlock_irqrestore(&stats_flush_lock, flag); }