Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp233600pxb; Mon, 13 Sep 2021 17:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt+Mwqb61toJGodGYz56vDHk2Q32KjJUrwQ3IUwqnL1MyWt9XrKmfGJa1rMaS9LJOHuSAd X-Received: by 2002:a6b:c3cb:: with SMTP id t194mr5435574iof.50.1631580864031; Mon, 13 Sep 2021 17:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631580864; cv=none; d=google.com; s=arc-20160816; b=hFrottVddRu2dEsbLEn4GjH0ZVkU9ElAlxvwWbc4DTEOSBaJdoaBzkvvkxsZq3D626 MaX5cXlRvwpp63qRSVvTX9QEHpG5y30A3vskP8iBCmDjXUo+i8SC+eEbwIMG76NkM3ju irF7jA/dexmQxCWzuL54pQI67rMeioyp03FkdqhUp0/cOwfhHX7x92O8JPvPbiEcqqLN xOH6gZMUhzyawvwMf9HyaUF7HSSV8G+t3gYQcD1l8kNW3Rt9rxooI6irrkhfYRVBB89R f7y2McFSrTa3sqjD4fPkrwCrWdL/BvHkxYq4XZAz/YcWs5UA/h3Evy+M9HkWnf4erBq5 v9uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=j/URbjttbgh/qE1agh24JiENV0g90v5EslC9AJDtoVI=; b=IvTliOB1hVQ5uId4MBtCLlIKwFDT6LPMqydvpiH39hdN8iL+cxBJF2II7q47GygI00 3ozCER4tYYHdVXUqLHpiIM/+1CUYpYU+njzJd5KDN+RZ7rihJwaMFTu+SpsM8iW3hXDf VS2BwEs2TFM6oK3GywgyxvsGMSSQngJM1LHCcy4TUDbUSS7as0HatFEuk3YgEyaAL60W Vat/l+il+5a3tioAlurhWnQnH2bPXcXeEKW/Oc4GOohaJVbEOG6T2l8saNPu1PoLtBwL UU/h4PQE/D8i+LmpS4cUkPtEqAGeokzH5cSirF5cGbuvgwQIXy9wgCYEme8xou5c0/RE wgMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VZ4titcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r199si2433590jac.71.2021.09.13.17.54.09; Mon, 13 Sep 2021 17:54:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VZ4titcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S240728AbhIMSr0 (ORCPT + 99 others); Mon, 13 Sep 2021 14:47:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33544 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240259AbhIMSrZ (ORCPT ); Mon, 13 Sep 2021 14:47:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631558769; 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=j/URbjttbgh/qE1agh24JiENV0g90v5EslC9AJDtoVI=; b=VZ4titcWHZbS9g9SixWDwZsImRZ95LNeGYfbjjMcyfV0CvhGzk/z3L5+BBTB8xbnf+lcWx 7bcf3Z5O7+itPDj3F3Fjy4Wj7an9HdWcudE9sSn1w/w5LPxwpZARzS/9GgwEBOfM4JhOD7 62yasYNYXQ9n0FkPqN5uB5EUGTjObLw= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-38-LrpCgUyCNqCeTzNGQ8lYww-1; Mon, 13 Sep 2021 14:46:08 -0400 X-MC-Unique: LrpCgUyCNqCeTzNGQ8lYww-1 Received: by mail-qt1-f200.google.com with SMTP id c22-20020ac80096000000b0029f6809300eso55754915qtg.6 for ; Mon, 13 Sep 2021 11:46:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=j/URbjttbgh/qE1agh24JiENV0g90v5EslC9AJDtoVI=; b=EfDG4F5FgqhJqztQzlnwvEc/i8RSRdtCBRTotGdOgvPYpeX1rNbw4smqg4F5L5K2cs +WHiXcCrppRqpA18pxz2PLxfe4NW9R7r9ILzgjUMkDuMSZchEOCJe7zYI3Jy8SCU4AHb UoGlxLcFcO16KTWGj3JA8YQ3UbazrmEkzT3T3FUZku9BP2HbcnqyJOEamjsuqnlRAPhp VypSUc6tp+nr2coy8kMp0eTGwCPks9oxcyaCR8FGnFVSEd2+T68jdKpgNhCduDnc1+nZ PRzHb6gRzZvrqszVJWBMN4ZR6BGDvbuWOyw9TgwdlfXtvDvf578KM8cadX+jK9rQ423P y4rA== X-Gm-Message-State: AOAM5319aBx5JHZ4wTKXYwmiQn9c7hM9QZleTWFix29aZjySkE1ecxW1 +aXU1xUPJ2L6thiK4L3cIVG4bUZTAONNCr4SMZ0za9aZG7OnKbq/F2rFIXW5BtmLHoTCe/JSAIn dLSrSJoNjRfd0tTETLBNnKEqe97v79ZUTtgYWY4MDqk7bo3xDn0M3gSsTb4MYQ4z4Qo/y0sve X-Received: by 2002:a05:620a:2e4:: with SMTP id a4mr1076408qko.288.1631558767007; Mon, 13 Sep 2021 11:46:07 -0700 (PDT) X-Received: by 2002:a05:620a:2e4:: with SMTP id a4mr1076383qko.288.1631558766792; Mon, 13 Sep 2021 11:46:06 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id l126sm5983384qke.96.2021.09.13.11.46.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 11:46:06 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH 1/2] cgroup: Fix incorrect warning from cgroup_apply_control_disable() To: Tejun Heo , Waiman Long Cc: Zefan Li , Johannes Weiner , Juri Lelli , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210910024256.7615-1-longman@redhat.com> <125c4202-68d1-1a4e-03d6-2b18f0794ba4@redhat.com> Message-ID: Date: Mon, 13 Sep 2021 14:46:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/21 2:45 PM, Tejun Heo wrote: > On Mon, Sep 13, 2021 at 02:43:44PM -0400, Waiman Long wrote: >>> The problem with percpu_ref_is_dying() is the fact that it becomes true >>> after percpu_ref_exit() is called in css_free_rwork_fn() which has an >>> RCU delay. If you want to catch the fact that kill_css() has been >>> called, we can check the CSS_DYING flag which is set in kill_css() by >>> commit 33c35aa481786 ("cgroup: Prevent kill_css() from being called more >>> than once"). Will that be an acceptable alternative? >> Something like >> >> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c >> index 881ce1470beb..851e54800ad8 100644 >> --- a/kernel/cgroup/cgroup.c >> +++ b/kernel/cgroup/cgroup.c >> @@ -3140,6 +3140,9 @@ static void cgroup_apply_control_disable(struct cgroup >> *cg >>                         if (!css) >>                                 continue; >> >> +                       if (css->flags & CSS_DYING) >> +                               continue; >> + > So, I don't think this would be correct. It is assumed that there are no > dying csses when control reaches this point. The right fix is making sure > that remount path clears up dying csses before calling into this path. Thanks for the suggestion. I will look into that. Cheers, Longman