From patchwork Tue Jan 9 09:27:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 123822 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3796769qgn; Tue, 9 Jan 2018 01:28:31 -0800 (PST) X-Google-Smtp-Source: ACJfBoudZDeCyRpFsY8+stoPJaO9RwY8w5mY02WSagf4VoZFqdrBK5cwEfZimdRasckaAeMCuTIS X-Received: by 10.84.133.226 with SMTP id f89mr14773164plf.407.1515490111671; Tue, 09 Jan 2018 01:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515490111; cv=none; d=google.com; s=arc-20160816; b=Op17buOQgj8hQGqhiOSciz815TPktyHpOLNrW1xX6tUsdYLrTL/M6IebNI1SOkSuPF QT0mWPdpTrdBuCYRMBkVUofUFYkM19Yr4Y79iW3DzaPwLhCD1DXVa9buA5gR912cX5/C b++y4HQs8V30N5kiKCs9OHkN8mSl3FSmuanN6HUlG2/HA6JTXwRS0EnvmQ4p2C4ZcA3k A8QDLuRMfbAYiKdJq0LnLJ9qRn4p0xT5j7LDUm/IxY+lkLAuAPMjp/s/5csoP/SJhROi l2GEjLIjhlf2V7d/4Dt7jZGY6IIiK1JluIZqyWC0gtXgv0q7YQIz4vbVXvD3xnxqALR5 mxNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=HXbiwH/hQd6lJB2g00vxKJ1zfWW+jO65rSjxIZdwMfg=; b=P1NpdmD1gHX4HEPPYQ7YNyT5bIdKq3aypbllxKQEY/acVW0k8OabWQg4I695An2lXo xYublMzpTc4m4QEJJL9EqXnfrk7nSNZ91OF2DJN/FxWbjvVJzqwy/jzvm+nFzTUvyBra 4qPd9kWUc8LVTuf0bcv9hLovB+KhUoeZGBJIaax9c50ZydvYmg73nTYxTHDntfzDbhmh ddsB+IB1VROPin8yexFvRNAnEVbgfTe+LNImuiRX6stI23Q30pjkI+YmsYvbtsGokA0h He855SGQ1BcwRiwUJzP45osVoyPQpOfPykklHiXwRQkFFuEHbnKV8nerK14RbIRnkZ7N 2xJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E5iacIn1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc7si10145681plb.428.2018.01.09.01.28.31; Tue, 09 Jan 2018 01:28:31 -0800 (PST) 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=@linaro.org header.s=google header.b=E5iacIn1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbeAIJ23 (ORCPT + 28 others); Tue, 9 Jan 2018 04:28:29 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37316 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752561AbeAIJ2R (ORCPT ); Tue, 9 Jan 2018 04:28:17 -0500 Received: by mail-wm0-f66.google.com with SMTP id f140so19159297wmd.2 for ; Tue, 09 Jan 2018 01:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HXbiwH/hQd6lJB2g00vxKJ1zfWW+jO65rSjxIZdwMfg=; b=E5iacIn1nDzIMMS1NsBT9e0Bf9JglcvtrLSGqweMeLwq9pXncRf6akOOyBG1wynlxB zfQPHE7feW6ccnnzDnVAsSSx5bkJLGsbLcH9WCRiTygATG/1AypL8U0H8LT9po73+bQw P1W4hFX1CpPsLR9qK3dshZUtRlti7/16AmBGI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HXbiwH/hQd6lJB2g00vxKJ1zfWW+jO65rSjxIZdwMfg=; b=OfagpGMf5oN/9NV2/q6qoWSwzuMmtBQ6I3AyQmKoKXqpJebkQYlXOjXZefMvOAxn2P RzbPFLRyc4ETJZ9O2lIndWKu372Z70ZT7zGw6pvk/TDukf1kELUlcJqJ1yPyb5weeaeF 65WM7A/+X5jQ8E1RvwIP9ku7ciDMy8VsxTsCNDsuseP0Fho+T176wmwQdyxhiaEAKbo8 9BHWOhuoXxVDylBL3CTTBeNq6RPHqf8vsWigvgmRb365RZvYJCiC51cQ0dPczDPlcGWL xiDm+URREfriL/Uu+r2dEt5J7aMnjHGy5JGWyBmpYMeaAvFk+u0695wfMqCUjfE/H0fh Zh0g== X-Gm-Message-State: AKGB3mLMhs9xOAcip50Drzavho4DAOnwEVLDlyWxqjrB/KMfmM8s71o9 lzjrzsEZmh1GjGyVM83aCHCbog== X-Received: by 10.28.132.203 with SMTP id g194mr12044144wmd.69.1515490096254; Tue, 09 Jan 2018 01:28:16 -0800 (PST) Received: from localhost.localdomain (146-241-48-150.dyn.eolo.it. [146.241.48.150]) by smtp.gmail.com with ESMTPSA id y134sm19179828wme.12.2018.01.09.01.28.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 01:28:15 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, broonie@kernel.org, linus.walleij@linaro.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, 162996@studenti.unimore.it, Paolo Valente Subject: [PATCH BUGFIX V2 2/2] block, bfq: release oom-queue ref to root group on exit Date: Tue, 9 Jan 2018 10:27:59 +0100 Message-Id: <20180109092759.5454-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109092759.5454-1-paolo.valente@linaro.org> References: <20180109092759.5454-1-paolo.valente@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On scheduler init, a reference to the root group, and a reference to its corresponding blkg are taken for the oom queue. Yet these references are not released on scheduler exit, which prevents these objects from be freed. This commit adds the missing reference releases. Reported-by: Davide Ferrari Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.15.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index ea48b5c8f088..c56a495af2e8 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5015,6 +5015,9 @@ static void bfq_exit_queue(struct elevator_queue *e) hrtimer_cancel(&bfqd->idle_slice_timer); + /* release oom-queue reference to root group */ + bfqg_and_blkg_put(bfqd->root_group); + #ifdef CONFIG_BFQ_GROUP_IOSCHED blkcg_deactivate_policy(bfqd->queue, &blkcg_policy_bfq); #else