From patchwork Sat Nov 5 00:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 13032787 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E0C5C4332F for ; Sat, 5 Nov 2022 01:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbiKEBA0 (ORCPT ); Fri, 4 Nov 2022 21:00:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiKEBAZ (ORCPT ); Fri, 4 Nov 2022 21:00:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD22193FA for ; Fri, 4 Nov 2022 17:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667609965; 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=CCZSaJ900ZMJsX6FSPePp5c1TELOc3F+zYif5LY5DHo=; b=HLo3xYfH7MFfDKWhSY8QVN5rJ8ETrW6w3BJJ6MBVWGMssnVuK5tcJdXStpICq60U/pigO1 7wcuRDhuXnDAyyTwOaD2TxPmYwDH673Mb8Uj4R2lrkTmwYJDsPzqk3uJ2vqpbkbDxU7jUi OXozWix9JgkWcz+o9WmG6p5dR2GwQKc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-zcCzqGJ5MpiGxNbhuAOwRA-1; Fri, 04 Nov 2022 20:59:21 -0400 X-MC-Unique: zcCzqGJ5MpiGxNbhuAOwRA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3F78985A583; Sat, 5 Nov 2022 00:59:21 +0000 (UTC) Received: from llong.com (unknown [10.22.16.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A2242166B26; Sat, 5 Nov 2022 00:59:20 +0000 (UTC) From: Waiman Long To: Tejun Heo , Jens Axboe Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei , Andy Shevchenko , Andrew Morton , =?utf-8?q?Michal_Koutn=C3=BD?= , Hillf Danton , Waiman Long Subject: [PATCH v10 0/3] blk-cgroup: Optimize blkcg_rstat_flush() Date: Fri, 4 Nov 2022 20:58:59 -0400 Message-Id: <20221105005902.407297-1-longman@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org v10: - Update patch 3 to rename the rstat function to cgroup_rstat_css_cpu_flush(). 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. 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(-)