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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80AB9C43334 for ; Wed, 1 Jun 2022 21:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231589AbiFAVcT (ORCPT ); Wed, 1 Jun 2022 17:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231491AbiFAVcQ (ORCPT ); Wed, 1 Jun 2022 17:32:16 -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 ESMTP id B680D1C4F02 for ; Wed, 1 Jun 2022 14:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654119134; 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=Kydqna2S/fNnNfFhR9vYtc6J6licD3U6v9tlZqx3JCg=; b=NjBbrw4kgt24+PkpMR5XfqpQjJSv6OUnBsxeBYMEfbqD63HCvIo1xrZetZY/mKKwJlDjnR NNmGegA40UTsuWL/AAllEkthficX+WmEnc5oVXRAtY9hJVloOfx+HWGmRPZbwBsAThvynl pVUSE39yj/d1UfnzzTt+b4ulUNcJvio= 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-503-nxe11axJOkGj6dRd8brr-A-1; Wed, 01 Jun 2022 17:32:12 -0400 X-MC-Unique: nxe11axJOkGj6dRd8brr-A-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 E8BA2383328C; Wed, 1 Jun 2022 21:32:11 +0000 (UTC) Received: from [10.18.17.215] (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id A81FCC23DBF; Wed, 1 Jun 2022 21:32:11 +0000 (UTC) Message-ID: <6734ae25-27eb-0024-8524-ab8885a5fae0@redhat.com> Date: Wed, 1 Jun 2022 17:32:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2 2/2] blk-cgroup: Optimize blkcg_rstat_flush() Content-Language: en-US To: Tejun Heo Cc: Jens Axboe , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei References: <20220601165324.60892-1-longman@redhat.com> <20220601165324.60892-2-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/1/22 17:28, Tejun Heo wrote: > On Wed, Jun 01, 2022 at 05:25:53PM -0400, Waiman Long wrote: >> I think the best way to protect against blkg destruction is to get a percpu >> reference when put into lockless list and put it back when removed. >> >> BTW, when I ran a test that continuously create and destroy containers, the >> total number of blkcg's kept on increasing. There are some freeing of >> blkcg's but no freeing of blkg's at all. Maybe we have a similar dying >> blkcg's problem here. I will take a further look at that when I have time. > They get pinned by per-cgroup writebacks which gets pinned by lingering page > cache and other remaining accounted memory areas, so I think they can hang > around if there's no memory pressure. But, yeah, it'd be great to verify > that they actually go away under memory pressure. > > Thanks. > Thanks for the explanation. It makes sense to me. Cheers, Longman