Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1219109pxj; Fri, 4 Jun 2021 08:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNqaPeVFopRyJGsFyh9Hwu5jDGABNTC6DvfdTzrrXf+qfi+W8UV4XLpRPqfMHdY6NepuRu X-Received: by 2002:a17:906:3042:: with SMTP id d2mr4874814ejd.234.1622821972952; Fri, 04 Jun 2021 08:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622821972; cv=none; d=google.com; s=arc-20160816; b=CMg1ULLvKGGGhB6IfRn7N4/ngNPtC1h77lBusFNx5V9iRfcjmhyzkwXInjusKbpGHI sjwg9vMJCT9axRfoXZuK2z3fqCQkF8TSKTFSGhVQ7gT1oW3VD5zfdGKYGQpLJOy14yTz I2B4WvLlvOaG5eW7Kv21Iwbbz6talFJOWwz8p6dSj9/8m4T6d74ziDXW5hubvux9HTJA XZwaRTBCY3KGlEqYKFqk4Dp+pdrIHtSemBBMJI/sIbFHnxPFusPIrj8DIzrlIQhTOjji z5+tvSYQ8C5VY4h3tcKFtThE85cnvMe3TNfngE4da+9QVJeAM9Iw7p49bBapesdnWaJ/ ND2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=uBZ/7zA0rgZN1i3qGEvYkxVHxjspKbk9HCZ8aw1XUNE=; b=yIAis0WIAqAvMN6Os3PFbrWfi0m9wQ7DnlOip02KoMsJfMTkMG2pJXtVrDiY/ZDyqL bwsQZXSofI+nWSc4hSk5Pz5ePLHgITyECoweRo3oJ2+9XVGwfMvgrSsX4wez4J5VReXu X4aTBltaFLteeIrBdMoua7fj7p4yJzmr/oraxpdXG5nwF5l2XO8RavalWcy9CSnzbdzX nz+9YQvkG8dvZ5eowa7aXq5m9bMhFVEHnAL27tB7+WIxmkE8yeQL5S5BuEz5bo/LVuxI K6vfaaDdRnlZrMLGAHos8VFmSuj8fkocsRXIcy0ovnFFAxCu3ZMrNT0n1/AaEOpv6J03 G5LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bY59MWvf; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si5194182eja.710.2021.06.04.08.52.29; Fri, 04 Jun 2021 08:52:52 -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=@gmail.com header.s=20161025 header.b=bY59MWvf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbhFDPxH (ORCPT + 99 others); Fri, 4 Jun 2021 11:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbhFDPxG (ORCPT ); Fri, 4 Jun 2021 11:53:06 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EF8CC061766; Fri, 4 Jun 2021 08:51:05 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id m13so7287724qtk.13; Fri, 04 Jun 2021 08:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uBZ/7zA0rgZN1i3qGEvYkxVHxjspKbk9HCZ8aw1XUNE=; b=bY59MWvfcUywNdjpMUbwtYEHsD11yoPOxdrhEQsx9FOhgynwo7kkXWedl9XQsAy9z3 DUMRa5rEumkb0I6USrRgSlbMnbT1g2T0ibgeTGBHZujAdzzK0kYRF8HohIgYHAhRutdm o419IsVMLvjkT3XOL/qlApJniWX2WmLMNFU+Py1BjoYyjpb0m/FO6Ahr5GkwAnRijC3X ld/j5/pTft68bjR1Nh+DaF1pjzrlM1aT0U7oGqroUG5X8rDWLFSyVl0zNfRs/P2N09Gh oZ33WXpfnbxdaTVwqGIpxP/TZ6HzIFfhtyg0nocOAlJwxXvoTmiD3Xiwj5G5++RAZRg3 YMwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=uBZ/7zA0rgZN1i3qGEvYkxVHxjspKbk9HCZ8aw1XUNE=; b=NY1lPjdJ7Xn8Zx/3Tf5uLZbQk+LvuWAgGsu2PLWZBAQAXLcRHzf6A6fcnAALgE0sCm A29WptnpYm2eVP64XN3RhfjswVHqcW3Wimr4u56u0Z8EKYLY/9QllS4j4hIRlTHwJyIv b0CDmcfBS5tn3/Tu1xwmXqB79tMHXUHYS+iSbIAPVPa091veZ8G7aNk+o/u9lLYZ7ZE6 xLPIjsW2Z2zVzZCUbacAFFV5ZH+kKLOegJtdoymB9m5wla5/SMnrrIkEuhwPDVJ65MU1 cx5hmG5FPrFUQjP1F3bOsWvB5EnjZ7Ramsmk7lB/BE51OmArEz0wrIB65V9lcgUE2CQ4 VKwg== X-Gm-Message-State: AOAM532W3CEfcUBv/hVs2zcI++CuuxpZRurpGWSZf4ggGJ1L1MXIFmom i6b81gHRj/EG6pDQleDWpWc= X-Received: by 2002:a05:622a:ce:: with SMTP id p14mr1413541qtw.133.1622821864221; Fri, 04 Jun 2021 08:51:04 -0700 (PDT) Received: from localhost ([199.192.137.73]) by smtp.gmail.com with ESMTPSA id z136sm1079735qkb.34.2021.06.04.08.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 08:51:03 -0700 (PDT) Sender: Tejun Heo Date: Fri, 4 Jun 2021 11:51:02 -0400 From: Tejun Heo To: Roman Gushchin Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Viro , Dennis Zhou , Dave Chinner , cgroups@vger.kernel.org Subject: Re: [PATCH v7 6/6] writeback, cgroup: release dying cgwbs by switching attached inodes Message-ID: References: <20210604013159.3126180-1-guro@fb.com> <20210604013159.3126180-7-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604013159.3126180-7-guro@fb.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Jun 03, 2021 at 06:31:59PM -0700, Roman Gushchin wrote: > +bool cleanup_offline_cgwb(struct bdi_writeback *wb) > +{ > + struct inode_switch_wbs_context *isw; > + struct inode *inode; > + int nr; > + bool restart = false; > + > + isw = kzalloc(sizeof(*isw) + WB_MAX_INODES_PER_ISW * > + sizeof(struct inode *), GFP_KERNEL); > + if (!isw) > + return restart; > + > + /* no need to call wb_get() here: bdi's root wb is not refcounted */ > + isw->new_wb = &wb->bdi->wb; Not a deal breaker but I wonder whether it'd be safer to migrate it to the nearest live ancestor rather than directly to the root. As adaptive migration isn't something guaranteed, there's some chance that this can behave as escape-to-root path in pathological cases especially for inodes which may be written to by multiple cgroups. Thanks. -- tejun