Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1296141rwr; Thu, 20 Apr 2023 12:49:19 -0700 (PDT) X-Google-Smtp-Source: AKy350bzxg06fLiYn+NgndiW7tMZPES8YUcH3mGyzV4GfhWPHjbEF/2emXLvMw5OPKjZqtHTTm9X X-Received: by 2002:a17:902:e543:b0:1a9:37f4:6345 with SMTP id n3-20020a170902e54300b001a937f46345mr2887435plf.12.1682020159052; Thu, 20 Apr 2023 12:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682020159; cv=none; d=google.com; s=arc-20160816; b=Duqpnj+PLdFrvOgIMyQfNX6r5/Quc6Isd5HELlBVJ9gLSacwel4TtfhZFg9StFSCsy 7RTMO7L08ZLGmTrqugEl6sVkOGxbt5vcpt4so56s+cb8yLPxEnNiGPyd0igMh7nxQJ3+ oC9mLstOEdLML9cCEJMJFVYOmtH0RxEny9KeksPD3q3J8u5yD4gdLUUgWXyOlSRrtfX/ 4vdA8YTw9mL1A2TW+eCjceKeEIR6w25UBOHShCH0h20N5+cGxpity1cHeIj94KJBPVVM kv+R9EcnGJ6ga4vBKniD+H4sRBN2X7iEKYwuMWFrpmmF9uVEwgzGe9p7f3BSJotvwaR8 pdUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=DWz8KeUWsabxybWxiN5KihW65aZnZuzamu2iaxIUYWQ=; b=uO7i0hy2yPhjjGu2bUx/QcHDmVRkN1HMJNVvuAqboCsN9prsM7t4ktyCnwnvJ74HN8 yXPek2LahVJ9ACqaqLRPVkMCmmjgSoYea0JP9gdHamqJ/56vwZzBUSLMJJhT/aa1nZBx zcbn6aDmp5OmOjZJzVCnTD2tX+9y82Ge+nhuV69SarHjOp/bXyu8CWArbeNRQZkT0Mqm l5jz2neF9PJneljxB6CGxqpwzciHWmJ+TcopOiFf2k+nar4j+gKIsnX/S78tZ7/988eD Ur5bNchSd7duDJA5kTg5cBDXg88B6Y8zX+IZr89cCEbJVYhmU43U5Oj4sDlPR+Wa4onB ULkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="5/j+YFuZ"; 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 l12-20020a170903244c00b0019cdd3e2aecsi2659921pls.312.2023.04.20.12.49.07; Thu, 20 Apr 2023 12:49:19 -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=20221208 header.b="5/j+YFuZ"; 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 S232068AbjDTTkj (ORCPT + 99 others); Thu, 20 Apr 2023 15:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231909AbjDTTki (ORCPT ); Thu, 20 Apr 2023 15:40:38 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1852940DA for ; Thu, 20 Apr 2023 12:40:36 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-3ef31924c64so912001cf.1 for ; Thu, 20 Apr 2023 12:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682019635; x=1684611635; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DWz8KeUWsabxybWxiN5KihW65aZnZuzamu2iaxIUYWQ=; b=5/j+YFuZMStm9e2iO/ipkrsa2LdUF1SNvtLNHwugoyYSsCQKMQue9JXQIakK2Sw0WU Wwjir2Vk1OMmOskjWngO0ESKAMDsptNSuo09gV/5QRZW5W8BQ9iMjvumS1k8RQnoXgOL 7QkKMY/J5LQkz6+5J4PH84vnF85GhfActqCsLNHBVsQFYF+PvYs6ns1u/RYEmGSx5mPD AkN24JBdy2Ucvj2bMd5NJup/cObu22q8uICbnabF/uvOP7KNKI9LF9Jbp+9EshGpOaYQ /uKWf57USSlHvXnbQWfPzv0CMy0Ikth4sL9Oquuoc8TlAAtalyron/zEhtRI2r8h4bJv 5HEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682019635; x=1684611635; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DWz8KeUWsabxybWxiN5KihW65aZnZuzamu2iaxIUYWQ=; b=fWQxZr5yH3L8mxf5V77hExN7ynMbJT6CkaKkYwFj3XOaUwMyPrEElPKj2Ghdo0BxQR de++7e4SkTTEnxeBjOoPvZr+SdNObypZl+piZQ5i4Ue4SbjmcIXV6YzSUmrTBJBHwr1V bDcbEcrsTQKTrNpBqt1XOTQ3qpLlrA2jgTsbjl0pyyk+54PoX24JjadlP0rKvtODnkGM 5/5iKcH5JOxDmE7SZbbQ9xidIZNhGYUdyvFs/eUeSBOZxFx3/J/dLCn/bty0ktCR1uvQ zM2dnI3zCdibqHDfksgGd3SjN/I1xHpN2nEpyHqZYNdaI4eRMGHEo3m8L9V0KHsi1H1G 8LFg== X-Gm-Message-State: AAQBX9enTOlKYbWWP8p6nR81eDOVTgVJDuoVd3y8o7H7I4a9Z3vnpIXM KGiJrJw4VsHBLPjPFhzkyXos9lOTd3eKgbqJKK80hw== X-Received: by 2002:a05:622a:1043:b0:3de:b0b0:557c with SMTP id f3-20020a05622a104300b003deb0b0557cmr47259qte.18.1682019634988; Thu, 20 Apr 2023 12:40:34 -0700 (PDT) MIME-Version: 1.0 References: <20230403220337.443510-1-yosryahmed@google.com> <20230403220337.443510-6-yosryahmed@google.com> In-Reply-To: <20230403220337.443510-6-yosryahmed@google.com> From: Shakeel Butt Date: Thu, 20 Apr 2023 12:40:24 -0700 Message-ID: Subject: Re: [PATCH mm-unstable RFC 5/5] cgroup: remove cgroup_rstat_flush_atomic() To: Yosry Ahmed , Tejun Heo Cc: Alexander Viro , Christian Brauner , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_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 +Tejun On Mon, Apr 3, 2023 at 3:03=E2=80=AFPM Yosry Ahmed = wrote: > > Previous patches removed the only caller of cgroup_rstat_flush_atomic(). > Remove the function and simplify the code. I would say let cgroup maintainers decide this and this patch can be decoupled from the series. > > Signed-off-by: Yosry Ahmed > --- > include/linux/cgroup.h | 1 - > kernel/cgroup/rstat.c | 26 +++++--------------------- > 2 files changed, 5 insertions(+), 22 deletions(-) > > diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h > index 885f5395fcd04..567c547cf371f 100644 > --- a/include/linux/cgroup.h > +++ b/include/linux/cgroup.h > @@ -692,7 +692,6 @@ 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_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 d3252b0416b69..f9ad33f117c82 100644 > --- a/kernel/cgroup/rstat.c > +++ b/kernel/cgroup/rstat.c > @@ -171,7 +171,7 @@ __weak noinline void bpf_rstat_flush(struct cgroup *c= grp, > __diag_pop(); > > /* see cgroup_rstat_flush() */ > -static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_slee= p) > +static void cgroup_rstat_flush_locked(struct cgroup *cgrp) > __releases(&cgroup_rstat_lock) __acquires(&cgroup_rstat_lock) > { > int cpu; > @@ -207,9 +207,8 @@ static void cgroup_rstat_flush_locked(struct cgroup *= cgrp, bool may_sleep) > } > raw_spin_unlock_irqrestore(cpu_lock, flags); > > - /* if @may_sleep, play nice and yield if necessary */ > - if (may_sleep && (need_resched() || > - spin_needbreak(&cgroup_rstat_lock))) { > + /* play nice and yield if necessary */ > + if (need_resched() || spin_needbreak(&cgroup_rstat_lock))= { > spin_unlock_irq(&cgroup_rstat_lock); > if (!cond_resched()) > cpu_relax(); > @@ -236,25 +235,10 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *= cgrp) > might_sleep(); > > spin_lock_irq(&cgroup_rstat_lock); > - cgroup_rstat_flush_locked(cgrp, true); > + cgroup_rstat_flush_locked(cgrp); > spin_unlock_irq(&cgroup_rstat_lock); > } > > -/** > - * 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_atomic(struct cgroup *cgrp) > -{ > - unsigned long flags; > - > - spin_lock_irqsave(&cgroup_rstat_lock, flags); > - cgroup_rstat_flush_locked(cgrp, false); > - spin_unlock_irqrestore(&cgroup_rstat_lock, flags); > -} > - > /** > * cgroup_rstat_flush_hold - flush stats in @cgrp's subtree and hold > * @cgrp: target cgroup > @@ -269,7 +253,7 @@ void cgroup_rstat_flush_hold(struct cgroup *cgrp) > { > might_sleep(); > spin_lock_irq(&cgroup_rstat_lock); > - cgroup_rstat_flush_locked(cgrp, true); > + cgroup_rstat_flush_locked(cgrp); > } > > /** > -- > 2.40.0.348.gf938b09366-goog >