Message ID | 20230403220337.443510-3-yosryahmed@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2617810vqo; Mon, 3 Apr 2023 15:19:32 -0700 (PDT) X-Google-Smtp-Source: AKy350Z2+wl+FwsdI3fKiUPQv5Zbyq9fjFJ4/xfEpvzwJA1jrg32OBrabZ7/rUi//gv50zVGH+t0 X-Received: by 2002:a17:906:c791:b0:931:d350:9aef with SMTP id cw17-20020a170906c79100b00931d3509aefmr214358ejb.25.1680560372672; Mon, 03 Apr 2023 15:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680560372; cv=none; d=google.com; s=arc-20160816; b=prapwN0fQrRv/u9GCN33oaS7YBPaFnew0wWUsDiJ5ZI8bGEEZWe2Mz8RJhtB1x/Puu 3V4ydjVpj/7lIAWn8vfsS3kMeDEzZ+ODUasLpd6fUCQbMyxj2BD0jFw6iGGpxsMxDOCl GWrlWc1iLbllZk0T2FqUfsUrjNBS+2nxRU+JQm99K5KV5fCD6VhcWYVwpiKBhmnTKmfK esGh22wuJyKQDSSQKqp7+xkn0wgUpur/rru+LV3aSm7JpngWWEUF0Lsy7Zmwyz0Kxc6g 5FuFLBKyUACMRa3JKUznlEGoLt/In9cv+5E6vtRKMpAupmrAbFjC2ZFP97xh5Ru9qtuO ZqjA== 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=9Hf88QAEgRalaH3f7thcio7vExcVqqDxAYa/aCaE9Jc=; b=B+pP+zJ6IfVChOHycQuZxOQN0mkYpDzIsW18eEj+259cEkaIQ77W11ibjFRNuAoqRs 8daJy+729PMONHgWeqdb1nMmWZ2eg7VrX/eeLXmkt3mMbC+W9F/hucV7WiH4CCjneS0O u5vw7hpnWkwkkAAAgEZOIXsu74zU31uYODaxFo9lguidS7Gyg9W29C0d0bLsS1XrLHvB W91fGLoXlhRRIxTqAyRGZpTuQKGzwPgiut/tr/DrXL6Yg7+r2nVsgpbBw6KUgtsgh1D1 VydIRG3d+W1b84eNvSRmOtMyFPae7hnRJQ7q1E8WRrcNJhT2+n3+bJzWw34PX4c4Q41T cbdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Qd1B7SbD; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020aa7c542000000b005026ee01040si511092edr.687.2023.04.03.15.19.08; Mon, 03 Apr 2023 15:19:32 -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=Qd1B7SbD; 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 S233674AbjDCWDv (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 3 Apr 2023 18:03:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233609AbjDCWDo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 18:03:44 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 975261BF3 for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 15:03:43 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5446a91c40cso305705697b3.18 for <linux-kernel@vger.kernel.org>; Mon, 03 Apr 2023 15:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680559423; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9Hf88QAEgRalaH3f7thcio7vExcVqqDxAYa/aCaE9Jc=; b=Qd1B7SbDQyGizezUFQyV/0tO/bOhj44AtZ1VKHtgOG9TbJavAnnMGZmO6zQIpqIoK7 5cj24hiW5m5RcceJDQ1KEplDfhRxIe4M8gmfj3L+NZAuLHvyis3MtYjzW6MZhBerb1QT JbsSvLpI6syO5GW80nsYNqGOYj2kCCLCJxDrHY++EHRBCuORnOG3ZRIIIY9qF02f9mrK 7QKQBjFz8zSpKFSQE5ME0/wr0Ah4Zv+Tdpoq6l9nLH2lZJPiIROIUeme5UI6HVL7rK6b PMhT9C0HP1QYba587rjt9xa6OsG8uX3e11ytS9ZKFnspyAhVnb6ce2SHS6u9IWMy0H74 szug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680559423; 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=9Hf88QAEgRalaH3f7thcio7vExcVqqDxAYa/aCaE9Jc=; b=3DulaFOOceirPGK7isgrgoRwFREToXZL4+w0qsYE0Zv5YDjWC+A1ANPfxfPr71QFIz OicO5fmMK7jNHzgehbOlddLK+Wxf1o9PLeiwtmVbkW8X6vdZEX02WooqStsX4EFlrbNo ayIOhV2WqI67iGzS4V8ojZE4nfWrfFdUGQIdPvFVknBLxuglR0M/R6ZqSzi/yGNHSZW4 jPk2K2hbzFLmCTFe5u8wvlcxVIgvUmqu/vNfjEYo0BSa/jC9KM35+NVunmJ+4UCIq+WP cyr1Q/zqVuOvc+YXrVHhsHTvhqO9EN3t546MNj5p8TlonjYe7p9me01LhNJAtu6nPloR zaSQ== X-Gm-Message-State: AAQBX9ehX78i5t+yBQAcM1zq6lkHU2R79AuLyK0X5lEfGJV2yI81CVEZ +LY5o/RmZDANCYIK+g/CU50NMhNdCPHXtQT4 X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a81:b60f:0:b0:545:bade:c57e with SMTP id u15-20020a81b60f000000b00545badec57emr288637ywh.5.1680559422857; Mon, 03 Apr 2023 15:03:42 -0700 (PDT) Date: Mon, 3 Apr 2023 22:03:34 +0000 In-Reply-To: <20230403220337.443510-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230403220337.443510-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230403220337.443510-3-yosryahmed@google.com> Subject: [PATCH mm-unstable RFC 2/5] memcg: flush stats non-atomically in mem_cgroup_wb_stats() From: Yosry Ahmed <yosryahmed@google.com> To: Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Roman Gushchin <roman.gushchin@linux.dev>, Shakeel Butt <shakeelb@google.com>, Muchun Song <songmuchun@bytedance.com>, Andrew Morton <akpm@linux-foundation.org> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Yosry Ahmed <yosryahmed@google.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762195273275437500?= X-GMAIL-MSGID: =?utf-8?q?1762195273275437500?= |
Series |
cgroup: eliminate atomic rstat
|
|
Commit Message
Yosry Ahmed
April 3, 2023, 10:03 p.m. UTC
The previous patch moved the wb_over_bg_thresh()->mem_cgroup_wb_stats()
code path in wb_writeback() outside the lock section. We no longer need
to flush the stats atomically. Flush the stats non-atomically.
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
---
mm/memcontrol.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Comments
On Mon, Apr 03, 2023 at 10:03:34PM +0000, Yosry Ahmed <yosryahmed@google.com> wrote: > mm/memcontrol.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) Reviewed-by: Michal Koutný <mkoutny@suse.com>
On Mon, Apr 3, 2023 at 3:03 PM Yosry Ahmed <yosryahmed@google.com> wrote: > > The previous patch moved the wb_over_bg_thresh()->mem_cgroup_wb_stats() > code path in wb_writeback() outside the lock section. We no longer need > to flush the stats atomically. Flush the stats non-atomically. > > Signed-off-by: Yosry Ahmed <yosryahmed@google.com> Acked-by: Shakeel Butt <shakeelb@google.com>
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3d040a5fa7a35..bdd52fe9e7e4b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4637,11 +4637,7 @@ void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages, struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css); struct mem_cgroup *parent; - /* - * wb_writeback() takes a spinlock and calls - * wb_over_bg_thresh()->mem_cgroup_wb_stats(). Do not sleep. - */ - mem_cgroup_flush_stats_atomic(); + mem_cgroup_flush_stats(); *pdirty = memcg_page_state(memcg, NR_FILE_DIRTY); *pwriteback = memcg_page_state(memcg, NR_WRITEBACK);