From patchwork Thu Mar 30 19:17:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13194751 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 73053C77B6E for ; Thu, 30 Mar 2023 19:18:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EE12900003; Thu, 30 Mar 2023 15:18:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0770A6B0078; Thu, 30 Mar 2023 15:18:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3320900003; Thu, 30 Mar 2023 15:18:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D480C6B0074 for ; Thu, 30 Mar 2023 15:18:09 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AB05E140F75 for ; Thu, 30 Mar 2023 19:18:09 +0000 (UTC) X-FDA: 80626525098.14.C2F442C Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf15.hostedemail.com (Postfix) with ESMTP id 7775DA0016 for ; Thu, 30 Mar 2023 19:18:06 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tY0E3oyb; spf=pass (imf15.hostedemail.com: domain of 3beAlZAoKCOwmcgfmOVaSRUccUZS.QcaZWbil-aaYjOQY.cfU@flex--yosryahmed.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3beAlZAoKCOwmcgfmOVaSRUccUZS.QcaZWbil-aaYjOQY.cfU@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=1680203886; 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=t0CUaTfO/2nb6E2qYVKNzEzhQgl/A3ISjMcddWXt2Mhsuu5jx0/DpX2BjLnp+d/D8BU8QA uQcXFlyYMF0whHHtgFjro9t0psZ59FoaGNsUTbgqy+4xhlDaIPbM732/COQIz9XezPkdA+ P56zfSju5Jqc/DAvp0vGHYU+G7Dr4cM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tY0E3oyb; spf=pass (imf15.hostedemail.com: domain of 3beAlZAoKCOwmcgfmOVaSRUccUZS.QcaZWbil-aaYjOQY.cfU@flex--yosryahmed.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3beAlZAoKCOwmcgfmOVaSRUccUZS.QcaZWbil-aaYjOQY.cfU@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680203886; a=rsa-sha256; cv=none; b=EuqNWQYC8DJQyh84xUoqvxfadouiMgfamwSH5ZZhPp5Tztry1rWR86pDInkju0wVUhwz6X Nszh0aSLoX5JwIgHgm2zxF3MGXMuqbV3sKBwdurstPtlIo9stWZHGHOemJmomcdgaa9A3t L3Z+LFYq0S3zZgkYea1C8FBBHelFGC8= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-5458dde029bso199618027b3.13 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=Eqwg2QQON2zQDkRB8VfQrXvDCuOU5O0bKgQEn/t9dQzxSAuiP/Kx4/gWxUj/VcHXgH jVAxPn/ZAaCMq/AryMARDQt2vmaXddvGL3nr74LbqH1zzl0Yx+mE1sL/dG/bUIPW1jnP WRHr+qElAYetPha5pXZyirt0plThVhsyWT9CRPcxlPSbS41/RW+WMCjnPkc+IHnbaUxS MmDUQ7zIkAnB4g4Q3fH2tC+050WaA08V096o/t8OuEb3K1V+DFtlsr67XnoAc4wtjBig HcklgrriWQbZwKX12UwQcOipsQXIIzzCfbmCbNAgF2khW5KDF5rL/cX7W4gFknipfXmC Mrpw== X-Gm-Message-State: AAQBX9cnsb6GBjvpLxEkv2kbsSC1rCyGJgteFKMoIgBA6qfmtvXo5D4r s6GgpvYh0bhrxKfciNI0RLyz39mJl/3KTz2J X-Google-Smtp-Source: AKy350aEWgmUGoq47vtgVPSLObUE1OHXFIc1JYGvZjZHSdRsfuGe4z8jTEoHLVbNJzm7tfhcDcAxLa1st977h/QM 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_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-Stat-Signature: azdf9n3myzfaquedr519fp593h73ii1z X-Rspam-User: X-Rspamd-Queue-Id: 7775DA0016 X-Rspamd-Server: rspam06 X-HE-Tag: 1680203886-228548 X-HE-Meta: U2FsdGVkX1/g3VujgbgELHasFD1wZny0kyOf2/CSFbHSI38ykTF6LeIkEOmSjvsBHXRU6F+4DkYBQsx1ivDIH4aHiGHKA1VUIuFmcMGqWNwYAjd4hH6QDh/mgw1FE488hMIakyUpaAp7UJvN5EN9NUTjAhZFpIZ7Dv/Yu6suDrn0DGQXV1SWlVBRB7f7cvQQuf8QmHe+EXWJRR+38e6jN/y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daijoenrTckv6KDeP68cG2IjIduQ7XKf2veEH1ZV0paQHkQPqatXvFhX9dWgT3dzc3WLmf2eCKKVJf4vW4OBZbCsZB/gIkcXk/ygs5TxjG3HDHONrnPPGVyJEN2RWWgMg/zxo7Tz+Bf2hrBV8/oc/5WMd2952EHF3TjjynLuFvk3ENTpaRquN/YfZK+NnnOMgFZDebY1iqL3fVGsQafo9GIe8YbMRRPxxWeFlsgRWl0HmJosDlIHxAnn7DDFhMHLB5PlHq6vjD74cQSgjt1lDP29oA85xa5hAQfj0/xc4l0AXib1U/Yz+1fBGgQ1qHrtrzIAr9q7pdcNe8VCezDZKee+apiYfMPoDkpZbcRGe7LOCfBSzhWWBhdQVb4/YOYD+iwpIKWJKFx3xSuJisgBTtRNGZ0gxbSrq7e/oHDx6Y09YBwpZcpGNIUfRqYiBpEGg0+oQZAbRZ66ki68+FHioVFsmI+oUtG5evuhrSdkNiEUo= 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); }