From patchwork Tue Mar 28 06:16:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13190554 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 93072C76195 for ; Tue, 28 Mar 2023 06:16:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F69C6B0072; Tue, 28 Mar 2023 02:16:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A67A900003; Tue, 28 Mar 2023 02:16:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06EE66B0075; Tue, 28 Mar 2023 02:16:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EE0FD6B0072 for ; Tue, 28 Mar 2023 02:16:46 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BB0A2120121 for ; Tue, 28 Mar 2023 06:16:46 +0000 (UTC) X-FDA: 80617298412.12.0113D44 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf03.hostedemail.com (Postfix) with ESMTP id 051FC2000F for ; Tue, 28 Mar 2023 06:16:44 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=IrEj06HW; spf=pass (imf03.hostedemail.com: domain of 3S4YiZAoKCAo8y218krwonqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yosryahmed.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3S4YiZAoKCAo8y218krwonqyyqvo.mywvsx47-wwu5kmu.y1q@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=1679984205; 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=Cs9g98LfB/5B5fgCHg0khEoDDLXk/FbX9zQPYHFGol8=; b=a2oIiNa74DJe0wyo+OhQioXAgcWPgxRtQbSaJBFPuuOcEBKt4W0esnnNaJyJp84ZnMAfXh wgzy+xstW2MuRIfLqQ64eseDsEkThXeRBZUF/xggAf/pAZ7z/eORa51ZBYj2QUb+UFrk0c OvtI0lzEkMdJpZhcjspxZ4e4VbOMoU4= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=IrEj06HW; spf=pass (imf03.hostedemail.com: domain of 3S4YiZAoKCAo8y218krwonqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yosryahmed.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3S4YiZAoKCAo8y218krwonqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679984205; a=rsa-sha256; cv=none; b=HrjPjc/ihqzAMXSQIhYfnBgmJCUHxFpgZZJ16Ob4KffvazDTX+LioNE2jyFnox5lDTHwH2 muSBu2h707zm8Odr26M5RZ0sFig4svbOgb4DZBEMQiKEn+U19KWHUTF6oAFBRZ7qcJM9IR POA5eIZkwPbsgDQPnHldtdrczdj20JU= Received: by mail-pl1-f202.google.com with SMTP id s11-20020a170902a50b00b001a1f8fc0d2cso7139079plq.15 for ; Mon, 27 Mar 2023 23:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679984204; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Cs9g98LfB/5B5fgCHg0khEoDDLXk/FbX9zQPYHFGol8=; b=IrEj06HWrJaiEe47kle+4mjwycO8VkK4UYyVi89hOr/BT4ba3YoJaIkMxMmDu91Azt OCiIdpmqw/gfkGEUiinzv01MOm68VDd/zLRgX2gIU8f7UybpdpXtpixpCNAld7gzowZR +gyt1jsqLawCKRD+ojRnZ6c35iauByhdICeE6tA9/AW2kV9h46wsE+qITfJzQSmauG1W ySDyn3mwIkhUXYNihBaZeA4rjBJGjlP0HSdTCoy9A7k1vdMTk4m51J+idABUhgX1bKO7 He48ZTeiLxeRfpruo08A01IDO1BpVxjEsw+pmwGtbL4byIuTDU8yveD/qiON77jThzUh Vo3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679984204; 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=Cs9g98LfB/5B5fgCHg0khEoDDLXk/FbX9zQPYHFGol8=; b=pk/H6wwt95xjwnVIVuQnEdwLr6n3TjmYG+t0Sif0GVVnVMEB/Dl7W1HoYPR0f6spb0 7rT85qoPNVpjv9Wc1cpvb7KpGtLEEf6vPr2UJ7RyQbDnc0zhAVMZn8PwCM4rZKmTLISF kSCEnXvdG5ChAratrjvJKH0Su2+pfsFqc0FfLNK+75HNrEnjXtNz7yaookESUzc3xpSm Am5Dm88OxKsCHqMRzZFAjv8OCBIP/64yQWz39l0huxzNmS/85+4ZYasTwnX5xJi/GGlY MO4U0CTSYEZsVihFR50YotQXCKKsHRCRvS1TdOMKf7M7XqnPSxlzKF8fSA/aT6ivgeGP hsXw== X-Gm-Message-State: AAQBX9fdPVlPqp0BWUAefyL20dztJAIhfwXXAPXOI3EEO4tKQsg4Auha 8JzTF85ZMaU/pDFFvowMGlLEFvMN83UEZN62 X-Google-Smtp-Source: AKy350aYOPbMPoVcZ2xVfirHkGMy5US/bJka4xE6zLbD6emP+rv0j2dGtP2N8z3/3tcuS7Hx271FErAXLO/AbXkX X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a05:6a00:24c4:b0:629:f9a2:64e6 with SMTP id d4-20020a056a0024c400b00629f9a264e6mr7565323pfv.4.1679984203700; Mon, 27 Mar 2023 23:16:43 -0700 (PDT) Date: Tue, 28 Mar 2023 06:16:30 +0000 In-Reply-To: <20230328061638.203420-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230328061638.203420-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230328061638.203420-2-yosryahmed@google.com> Subject: [PATCH v1 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: rspam03 X-Stat-Signature: heij338xccugibzofoyuu3c76zams8d6 X-Rspamd-Queue-Id: 051FC2000F X-HE-Tag: 1679984204-78330 X-HE-Meta: U2FsdGVkX18CWF3qGGLzCblqD/W/giclpWHv6RdhTRQc5Q8WNOnrHqcNcC0ypSMfTPHgd6Hc2x5YZH3MCetEpwGYm/WgmNgwsYRyHS3kWhi7nM4KP1PGcBCjStW4mr+S5okdK4J+dJ1cYDneXuW9m11HZ5to8rQR28ntYJoPXVtXJOTBHK0LDWhkkSzmD9sBXWcTauUd2zfLztoHKM3ZEzzUICkBlg4vowQrXA3dAIUv+PGx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FFEjXWlXnc0nxaf8zqv6vQlm3JCZJ2oHFSJG1JEz6q3h+CoSR7hlFG8eiKKJWxipYjwj7YGY91on6g2Qui3I3OHbHbjahLICsDoJb/BehhKzFdExC4hR2MiPBIeGcIuls1a2wu8NIY/kLw7mSPRqTMH7d4WdXHE3CVOV7ky79deLmvnB2bMV1aE/D97Mm1NEDgjInIei3T4g6/FDJESk687eA3CNGHTY6wf9Ht93TmKRSRED6tv9VymPBIEd85osYn72kE2t6zEiboAub9qgx2FHZpNw/sDoFpt7m8BZyUHgwBt0l62DKC36I6BzwDLSNF4OOKcbF+quueGYXJ41XIPo81liesIYkTME2H1u9MHTANgMt9JbIuT2dhJurle+45bRzUBeMsEMkyI0P1STsK5az7ey7+EUSlTDToyBsEgW5RkPvVAigm70= 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); }