Message ID | 20221104182050.342908-1-longman@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp566435wru; Fri, 4 Nov 2022 11:23:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Bt5N4N258FVPf1zKfl5UEbpehZejENrCjh3ajsIR0TcvzN2BAXy1ZaoEY9XWD2/0awFkf X-Received: by 2002:a05:6402:2a03:b0:463:11e7:cd5f with SMTP id ey3-20020a0564022a0300b0046311e7cd5fmr33508385edb.274.1667586223823; Fri, 04 Nov 2022 11:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667586223; cv=none; d=google.com; s=arc-20160816; b=F6yprfCfqe3IAln/pUP7gAhwwc/f4CmkD/8f36m7a1fk+E2UD11VIX2IbhJjcrQQYY P93Sny0AoA1y7jHAzctsf0ovYkp2LY4HgAf6H7r4yA9ckQFnl/7HWBVKurBVGYSJnobM JSB+ohmbLXRPHF/wwIekb5KGJhfjZU6Pxs8ShTCDE9qfOUBjeAuJLjglFwRQtSPyMc4N wgOAabhTWy23DvPs7Btiavj3pulZEKRK77u9UjNAWFsB9OEiWh/9arcLmKqV/hojDgkL SMB0TJTClorAN5P5TT7cf3zoY7xtfPCn+/qLB7ZFjnmVNm+9PdR0nRnBzoH4pBgm7A6Z hA4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mwGJiTiSAfN6PRbmiMouEvgWpKw4XbL4CZuerrQ/8Q0=; b=ykEZwTWY4BdlEn2rgFwoYbyU6trIAaZ/HfAnSStkIOWsi3L477R75YAWzoaEiuBC2B NjWzAQX7F77SasBbyqtsLZ6H7dL2gMAJSwzaiDO/3I81D7BJY7UbEqioBsUT56TrH4pu N/LEKwEE01H4ukqfDlUMwN6fWURtrtLE8NbiDXwjxWDeRK45UyHaQsvuugDVgbE4OXJa Saomc3udKmlxQdSVOCtM9KP9wgGVryL2QDi/xDCWz2fGJgk0w2vwlnSl3qKQAwNTR/LH GHAhK1UJvQLlXc57mpV/iSvdI3d173LNfwzRyMfTw024LYHAScVtGOSA8G6KkA8WIUO6 v9Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="H/3sOjE1"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd16-20020a170907969000b0078db6f488cesi6568211ejc.112.2022.11.04.11.23.19; Fri, 04 Nov 2022 11:23:43 -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=@redhat.com header.s=mimecast20190719 header.b="H/3sOjE1"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231800AbiKDSWA (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Fri, 4 Nov 2022 14:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbiKDSV6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Nov 2022 14:21:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 336774B984 for <linux-kernel@vger.kernel.org>; Fri, 4 Nov 2022 11:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667586060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=mwGJiTiSAfN6PRbmiMouEvgWpKw4XbL4CZuerrQ/8Q0=; b=H/3sOjE1AyWZmzrBEzNhNyflt7Xx9bAFXtCUpOqSxloXxZi+yEND94A0swj4ioxy2Y0uws rkR0Qmm8aVhYs8t1DzcECD3VqB9Ri0jraiZtJWUda0lmS0BV/ouN+60TpkFQdRNuq8m6we 7kpHucxHn6oXBkCOG+9suU2mZ6v9X2Q= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-cI6xdKNwNXayL6aN7p5wlQ-1; Fri, 04 Nov 2022 14:20:57 -0400 X-MC-Unique: cI6xdKNwNXayL6aN7p5wlQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 867B61C05196; Fri, 4 Nov 2022 18:20:56 +0000 (UTC) Received: from llong.com (unknown [10.22.34.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB927C15BA5; Fri, 4 Nov 2022 18:20:55 +0000 (UTC) From: Waiman Long <longman@redhat.com> To: Tejun Heo <tj@kernel.org>, Jens Axboe <axboe@kernel.dk> Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei <ming.lei@redhat.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Andrew Morton <akpm@linux-foundation.org>, =?utf-8?q?Michal_Koutn=C3=BD?= <mkoutny@suse.com>, Hillf Danton <hdanton@sina.com>, Waiman Long <longman@redhat.com> Subject: [PATCH v9 0/3] blk-cgroup: Optimize blkcg_rstat_flush() Date: Fri, 4 Nov 2022 14:20:47 -0400 Message-Id: <20221104182050.342908-1-longman@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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?1748590892387727437?= X-GMAIL-MSGID: =?utf-8?q?1748590892387727437?= |
Series |
blk-cgroup: Optimize blkcg_rstat_flush()
|
|
Message
Waiman Long
Nov. 4, 2022, 6:20 p.m. UTC
v9: - Remove patch "llist: Allow optional sentinel node terminated lockless list" for now. This will be done as a follow-up patch. - Add a new lqueued field to blkg_iostat_set to store the status of whether lnode is in a lockless list. - Add a new patch 3 to speed up the freeing of blkcg by flushing out the rstat lockless lists at blkcg offline time. v8: - Update the llist patch to make existing llist functions and macros work for both NULL and sentinel terminated lockless list as much as possible and leave only the initialization and removal functions to have a sentinel terminated llist variants. v7: - Drop patch 1 ("blk-cgroup: Correctly free percpu iostat_cpu in blkg on error exit") as it is found to be unnecessary. - Add a new llist patch to provide a lockless list variant terminated by a sentinel node. - Modified patch 3 to use the new sllist API and move percpu_ref_put() later in the blkcg_rstat_flush() loop to prevent potential use-after-free problem. This patch series improves blkcg_rstat_flush() performance by eliminating unnecessary blkg enumeration and flush operations for those blkg's and blkg_iostat_set's that haven't been updated since the last flush. Waiman Long (3): blk-cgroup: Return -ENOMEM directly in blkcg_css_alloc() error path blk-cgroup: Optimize blkcg_rstat_flush() blk-cgroup: Flush stats at blkgs destruction path block/blk-cgroup.c | 103 +++++++++++++++++++++++++++++++++++------ block/blk-cgroup.h | 10 ++++ include/linux/cgroup.h | 1 + kernel/cgroup/rstat.c | 20 ++++++++ 4 files changed, 119 insertions(+), 15 deletions(-)