Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp73438rwl; Thu, 30 Mar 2023 12:20:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZZ9yonTgA4GB6Ien+CAgp52x6Lk29WTfM5WR3kgi8MmksGPhY2Tr4Mk5Rv33PryEB5hTVc X-Received: by 2002:a05:6a20:8f14:b0:d3:a13a:4c06 with SMTP id b20-20020a056a208f1400b000d3a13a4c06mr3914581pzk.2.1680204027469; Thu, 30 Mar 2023 12:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680204027; cv=none; d=google.com; s=arc-20160816; b=FZXGCKNQFwkBAHAC6PtClexnMv4yxevM6/iZUJb929M3oxOvLgWyfZVQfVrVmBcvhZ mnsrNoYPAOVu6SxvTT4BT3KzlIg8tHoG5chmj1j/tfigDSlOiyoNtjZtnMI5rrwDcwOC 13h+qWY1UrwnMeuyyo5Q9+BsaF19ffbFxOk4/49Oetuk/t6QX548BACNLHf9gdAbLHcg f30UZC2O6HoIk7ZaNB36f1U128a5RmZO+whJGrUIBGHP3OZavxvZwih2SywThuDZJE2u lwp3L1WSxkz4dDZ+XvHABmlOcnQBpYR7AayNvysGn80EEsMsdgTRppg4180nRBtinhPP hjaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=ECd9n7cK9XN/T+IJ39MyPXAm65DzgHuyZCFnDGQgZIE=; b=gt8Iux1fItox7SKP+KGt/7G+kfJ457NjvMpdEWZj2kYTpeRqkk54ZX2x1Vh4bHGP8p oy3EXdcbtCvW1/it3LJG0nAmj7h3BWFqZGi4pPX3Luc+UB1oRXOlYue9nfqZDpdYiasc mxor18Sa3qV80roQtWD8P8RTIhBkwR/lqptUcesserRE3eIngrHj4D9HleegOI8IyGSY c9caAg5nkYzwfega8qp/5/wqVYvE+MumlxTLLaAfmMtS6uMlf/l5o8aHSAMrd3pbybz/ 5HxmxmgO0Bpy5hISDUVIj3rpwR/V2F5z//Mnkp/6N+aTm5q4UBIGLC2tiGbTiqHSryaY rF+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=tY0E3oyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k184-20020a6384c1000000b004fb33a76e2csi357933pgd.834.2023.03.30.12.20.14; Thu, 30 Mar 2023 12:20:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=tY0E3oyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231656AbjC3TSK (ORCPT + 99 others); Thu, 30 Mar 2023 15:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjC3TSH (ORCPT ); Thu, 30 Mar 2023 15:18:07 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59072E1A9 for ; Thu, 30 Mar 2023 12:18:06 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id g187-20020a2520c4000000b00b74680a7904so19669925ybg.15 for ; Thu, 30 Mar 2023 12:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680203885; 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=tY0E3oybgVZIuKKOOKBykm8/TKbf2scexLJVT3DkzJcaMo8pgAVQKd31VkYqY1QVPJ mHo+yh2Z2e/UWhIAS6NyKjgzsMFfM3Q7bRmRT9xetX5hDAZEg0lz49jvXxYxOEOA0GHz 2iOR7gvTKjdYv9QT9UofKbbkFs9vSWVQ0TKS3904q473sNNcjSfvya1m1B2ab+CL/f+M 4qtYTT2pypw3Co5Bobg3nKNc5an7wdNYyXFt6rny9eUWrmoVflUhZJQGBV9r+u9oNXbf thlMA7X4kUIdycQp/zBF4S4OoaK6pqFmZjXA4rakf85jUKtTz9rXXIDv36itoKwLwzmv vt/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680203885; 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=ZxbIG5mekY3H39mY2QQYiVP1LYkFZ//Lazw3LpX5wKT4k6KvgQdVKRFH1imlXR8vPi /jTohxS+KYDihKf+kgQZzhrE/MpkJjHz3DsPrNZkofoBOG0+GxN4buOJVSrcS/7aw9Zj jT+Ex+dF2xWexJknMUw6Z1oRDdS04ieuvlwm2ZiGKL6ZXhssQaaXtxzTWN/kTZytNuEu qQVGZkLGzbqBNlg9bwwEpcAdygnnE2NVuvyj60NpGRR1CbYc0zn89GRfGfiXuvax4/OY 60vXBq3h+4vkYBPc137BiepkOL3Ovezl2H5V0qW2l7RAQ/pKrxvQda5oEq1MYe2BCrdG 4BcA== X-Gm-Message-State: AAQBX9cw1NmTKaicQqqXd1b2KP1qMo92a7cf2jOZoEGkmUvOvcYsXKw5 qcxYAusKIL9sKVkx+Ax5IXstKwfwPeWxv2EO X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a25:d1d8:0:b0:b6d:fc53:c5c0 with SMTP id i207-20020a25d1d8000000b00b6dfc53c5c0mr4650822ybg.1.1680203885608; Thu, 30 Mar 2023 12:18:05 -0700 (PDT) Date: Thu, 30 Mar 2023 19:17:54 +0000 In-Reply-To: <20230330191801.1967435-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230330191801.1967435-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230330191801.1967435-2-yosryahmed@google.com> Subject: [PATCH v3 1/8] 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=20Koutn=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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } -- 2.40.0.348.gf938b09366-goog