Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp804160imm; Fri, 31 Aug 2018 13:51:31 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb4TGnRe9IoIKrIePJWv0BtuTHjg2UnpCM+5e2my9w7f39QmPO2iWa5all3IGkuUtwMx+43 X-Received: by 2002:a62:da0b:: with SMTP id c11-v6mr17774696pfh.68.1535748691706; Fri, 31 Aug 2018 13:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535748691; cv=none; d=google.com; s=arc-20160816; b=HTq0qTqL6UJ/Iz9IDXGTFJ9GoVk9FfL+H6rA9mrMg9o60fkvU1lov3pvE7NvPbPymw 7zx/nYsQw6j19SuYiUWrYAvf4o+PFM5hrY2QDvk8wZ9iw6F9PnfAaGl+07q3syN5qHcR 9UVKD4lYPeUC4yFNGEnXGoupCYI5XloGC5kXo38+5GgWLTPMw554W+QXSdrY8E6CsOaX ctULDOhiIazNfy9AoGAplfJRTtNU4YvgxbVVnmbhwN94VS8/CarrvfTb1Oj4njxMH930 FOQraO8pTpHaFar9dzgjD00JTVb5kZgJpglGKbLAplNHUsYSVSyW0s+pNdwdDhgvLacS LDNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=X4uyyJnze8eQmgn7dZYeBfQiceoBSu//s7aDIvG4h+U=; b=VTeDnK3KMblXpSAUojRK//s7cch6fhzPDu0uDAuV1bBafEKX9Esliku+pxtW88Zrm0 3yJFmF0AyrPwm8yRYSzcYlZNOG4snn2A6NNauwGEGg1atpKwWFXc0PVTSn/6XNaBVtJK +QjMp4HXNXzMr/5SE/J62jDAjnJgzc6hW/0c4I+Fq++ZCS9iZKHLL0RAgjbdxC3ba+tH qgMyMH8YjwFWokV1JORl2I4G6Ll+ErIMqSmG/8EEm2a1tDjKxTjt9LuVkEruLlFuqaIa QzjIxiMf7hgBPwMeTpaIzur2x+ajxsHX7FjJ5AjHK5Vkzyz1gTUd0thlDjAmWpgFQRrp RJeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=bHZ5ElZZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19-v6si12000970pfb.89.2018.08.31.13.51.15; Fri, 31 Aug 2018 13:51:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=bHZ5ElZZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbeIAA7L (ORCPT + 99 others); Fri, 31 Aug 2018 20:59:11 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:37605 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbeIAA7L (ORCPT ); Fri, 31 Aug 2018 20:59:11 -0400 Received: by mail-it0-f67.google.com with SMTP id h20-v6so8824893itf.2 for ; Fri, 31 Aug 2018 13:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=X4uyyJnze8eQmgn7dZYeBfQiceoBSu//s7aDIvG4h+U=; b=bHZ5ElZZvw9mwSsdtRJKf3t4yaUTAiAzaWOPHinmtCSElcUgb9MejbLyVmzcIW8Nw0 APcdfFcUXlB5BS5twjDhEkSh3M+c0i9Taw/FV2bQobku2M0kN5a9yrc4TTqsWd0Oac6v ndm0sVN/hSVuQ/ZSwnSk6SJMMoOWyx32wv44//arPDr/J6FCFMstB6y1sbs+L5bkYaML Tuvcyizzuh+IxIXHuSxyIXaVkLML8ZWVi9bW2zoD+5CSfsdG3EimrQVh5VWdhTVeORLg eGTWzNLerelUF14K2CN04kVpPJnCW4AaiC+2iMmn0T6pmkj8+CDPLmEcXNlMVfrjQTqS Kxtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X4uyyJnze8eQmgn7dZYeBfQiceoBSu//s7aDIvG4h+U=; b=cQ/d2VWOAJyKa8tnTKUDBGqM88NvpHxKlAG/fBgTfNjID6NcxE+JVZm2mPYOgjZMWC iCfKSJ8W1b4UmI9Ju5sRqlBd1PcF8vymvNzTlVPsOfl3vxWB1hPAt0LmotUmeMXO69wW pJ60K7eWKX/M/Qtzt0NPGufcDFX7T1VC7Q/d4mZ+Qi2VUPlYv2Du9a7lw/fyQVRMD1pF Ql03vC7Im0vcUua/aUuCNKM7t/Y0+IzP1w0gP7GtHJucQBApk3YOSJn10JGvrA6Prkol UjVVREyrDkPBivAXj+vWwJp8JyumhOh5JPSOZk/OWzSaDiTVaSgtuyyrbWAs5r5vKgLh 9oTA== X-Gm-Message-State: APzg51BPktLrLAz3zjNvFL1RyB79RHI9Zh0DZkueh41kGVZ1bmMYgTSW 2hlSa+Ej2VwsQB/1xom7myuhC611VBo= X-Received: by 2002:a02:3b55:: with SMTP id i21-v6mr13810520jaf.118.1535748598011; Fri, 31 Aug 2018 13:49:58 -0700 (PDT) Received: from [192.168.1.212] (107.191.0.22.static.utbb.net. [107.191.0.22]) by smtp.gmail.com with ESMTPSA id k142-v6sm2695525itb.0.2018.08.31.13.49.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 13:49:56 -0700 (PDT) Subject: Re: [PATCH 0/3] fix blkcg offlining and destruction To: Dennis Zhou , Tejun Heo , Johannes Weiner , Josef Bacik Cc: kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180831202244.21678-1-dennisszhou@gmail.com> From: Jens Axboe Message-ID: <7b5ec635-c251-7ac3-bebd-2cfd687ffed6@kernel.dk> Date: Fri, 31 Aug 2018 14:49:54 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180831202244.21678-1-dennisszhou@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/31/18 2:22 PM, Dennis Zhou wrote: > Hi everyone, > > This is a split of an earlier series I sent out [1] containing the first > 3 patches with fixes from feedback. This series tackles the first > problem where blkcgs were not being destroyed. > > There is a regression in blkcg destruction where references weren't > properly put causing blkcgs to never be destroyed. Previously, blkgs > were destroyed during offlining of the blkcg. This puts back the blkcg > reference a blkg holds allowing blkcg ref to reach zero. Then, > blkcg_css_free() is called as part of the final cleanup. > > To address the problem, 0001 reverts the broken commit, 0002 delays > blkg destruction until writeback has finished, and 0003 closes the > window on a race condition between a css migration and dying, and > blkg association. This should fix the issue where blkg_get() was getting > called when a blkcg had already begun exiting. If a bio finds itself > here, it will just fall back to root. Oddly enough at one point, > blk-throttle was using policy data from and associating with potentially > different blkgs, thus how this was exposed. > > [1] https://lore.kernel.org/lkml/20180831015356.69796-1-dennisszhou@gmail.com/T > > This patchset contains the following 3 patches: > 0001-Revert-blk-throttle-fix-race-between-blkcg_bio_issue.patch > 0002-blkcg-delay-blkg-destruction-until-after-writeback-h.patch > 0003-blkcg-use-tryget-logic-when-associating-a-blkg-with-.patch > > 0001 reverts the broken commit. > 0002 delays blkg destruction until after writeback. > 0003 fixes a race condition for ongoing IO and blkcg destruction. Applied for 4.19, thanks Dennis. -- Jens Axboe