From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB090C3DA60 for ; Wed, 17 Jul 2024 18:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XJ+DO1XFPA3kG5fZOCBOo8jUV2iAAVsZ3cSbK5/oCdI=; b=aoaBGoiCTBnYuI2TkKyC5PKws5 6ez6Bxh8pv+R+DqOfrjZbTV29OrnMru2PTVdNv9KRtP8Ke97fD6mMAKkq0/sq++C23F7zQ5jWvxKt UX/sXbXVv8igHWuDnRGVreqB11fDB5k/vCfAXlls7QEwXyxyGg16RIX0r1IRsvzf1+Cl3ZGIrVG/V TVDy45WmUBc0BWcKU9E7RaCQesSJgLxRRNAoQ3d5yzkuZHwvMZ6kmFjRSRFilhpRdU3n3z2wxQiQP +a7nJPSS1/xYRsHPnM07FzpVtXfRHFZtj7e21u5dThgD6PSw65D0zAiYuENntfftfB6TmWpZMx65l 00T9Ja3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sU9F9-0000000EbN2-1Ojd; Wed, 17 Jul 2024 18:19:11 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sU9Es-0000000EbI0-3pFe for linux-mediatek@lists.infradead.org; Wed, 17 Jul 2024 18:18:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721240334; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XJ+DO1XFPA3kG5fZOCBOo8jUV2iAAVsZ3cSbK5/oCdI=; b=RmlJzD06ucYS/mAqxiMQCU1t6jBJ76yEzuN3mieuMHXaymI55XM1kbwNVXh9yanKNfPLM2 d5wmphyH3r0EVJfm6MBaEWn7CKpe+EN03bGTZzNRWD948eiKfg0zhhlEZTBc8/nQX5m9zn ZctwOO6dClwSqQozV+RNibW8B4SyL3c= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-Z9YBNzkfPSCEdpDdbWu1QA-1; Wed, 17 Jul 2024 14:18:46 -0400 X-MC-Unique: Z9YBNzkfPSCEdpDdbWu1QA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F2C871955D50; Wed, 17 Jul 2024 18:18:43 +0000 (UTC) Received: from [10.22.16.209] (unknown [10.22.16.209]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BBECE1955D47; Wed, 17 Jul 2024 18:18:40 +0000 (UTC) Message-ID: <134fc34c-10b8-4d00-aaca-8285efce9899@redhat.com> Date: Wed, 17 Jul 2024 14:18:39 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] blk-cgroup: Replace u64 sync with spinlock for iostat update To: "tj@kernel.org" Cc: =?UTF-8?B?Qm95IFd1ICjlkLPli4Poqrwp?= , "boris@bur.io" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "cgroups@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "axboe@kernel.dk" , =?UTF-8?B?SXZlcmxpbiBXYW5nICjnjovoi7PpnJYp?= , "josef@toxicpanda.com" , "linux-arm-kernel@lists.infradead.org" , "matthias.bgg@gmail.com" , "angelogioacchino.delregno@collabora.com" References: <20240716075206.23121-1-boy.wu@mediatek.com> <5560c690cc6de67139a9b2e45c7a11938b70fc58.camel@mediatek.com> <1b19b68adb34410bf6dc8fd3f50e4b82c1a014e4.camel@mediatek.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240717_111855_029507_D5AE5934 X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 7/17/24 13:40, tj@kernel.org wrote: > Hello, Waiman. > > On Wed, Jul 17, 2024 at 01:37:56PM -0400, Waiman Long wrote: >> bis->sync is still being used in blk_cgroup_bio_start(). Replacing it with a >> global lock may kill performance. We may have to use a per-cpu lock if we >> want to go this route of eliminating bis->sync. > So, the idea is to keep using u64_sync for blkg->iostat_cpu and use > blkg_stat_lock for blkg->iostat. The former is the only one which is updated > in hot path, right? Well, it can be confusing whether we are dealing with blkg->iostat or blkg->iostat_cpu. In many cases, we are dealing with iostat_cpu instead of iostat like __blkcg_rstat_flush() and blkg_clear_stat(). So we can't eliminate the use of u64_stats_update_begin_irqsave() in those cases. Cheers, Longman