From patchwork Tue Jul 31 16:39:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10551059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD6CB13B8 for ; Tue, 31 Jul 2018 16:39:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF1512AFF1 for ; Tue, 31 Jul 2018 16:39:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3A0E2B020; Tue, 31 Jul 2018 16:39:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F6462AFF1 for ; Tue, 31 Jul 2018 16:39:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbeGaSUT (ORCPT ); Tue, 31 Jul 2018 14:20:19 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:39244 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbeGaSUT (ORCPT ); Tue, 31 Jul 2018 14:20:19 -0400 Received: by mail-qt0-f194.google.com with SMTP id q12-v6so16622047qtp.6 for ; Tue, 31 Jul 2018 09:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Ynv16cRdCJokyiijLAYrdbaj8D0/BLE8Fbgp/55buuk=; b=wXOyV41QR6HeL9OO6K4SUnuZnTMUuqGHXRpOBsce4ed4RaPAoy92nwisu6SWIAxGAb Jp7nVdvEPx8SQpFcwc3wpoGurQMU5nhtGscs+3A/3m8FH2rpfKk5fO0+B8H8flnvhA+o WXAXw273v/UANGeWSLxhSolYZQ3o6D+rqDVqUTVMxnfnHNJpbs9l4vN/qnhF1JYeIK6x Oh9LXiKXYkysiKTdUyrnRGnxpVp56EHQuHJQ9WY9EGLU2yWLomH77m/7w9CSpUSKIPIa cjViQL04BheA2udvpsNTTm6zE+kCNJhYo+4uXhRbGRAPbSecwIJoic16+s7AyUwvptdv ZZ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Ynv16cRdCJokyiijLAYrdbaj8D0/BLE8Fbgp/55buuk=; b=puC2IkVtMr3cxQhic5j7peu6bgsWUQKGxparoVgE3SK9gBZTK4TXl2na7ync4XoYtN 6H3mFqqyGYCmCqTMwzk3K0EgW5uNh+lbvaM7gnKQK8y37vYZgoOdBPgo2/bR0IKHmL7F G7I9aph6x/Mz9d5HGddACrKqRRufGazgZaW68XoCYDQAeSN3DxieXQRJiVPlHgS4jHZI lvFNRFTJIWO9RcCj/dsqisrkJ9+CGNV6fGW/nc65IX8lg6eJualqHMNBLLlSgpSN4kzj jpa6ooej34fPvaUUmKNOJjmH55bUMrwKsmrlal+1I77DTDnKwcSGdgQ4FfdRo6WwfQ8V 8hCQ== X-Gm-Message-State: AOUpUlFwWnn19JIGLcWCccOrNGFR0oNoX0wVaCUKOYM/aY0zssi9l5eT RYV01oZla9LvXJv7bUfTE73oSg== X-Google-Smtp-Source: AAOMgpejxAbUHr7jmh06SxYl03BmHPqdymE7bapzp/ovlm8lLMyKAbZbR9DrLpxFyrvVU58t/kBnmw== X-Received: by 2002:aed:3c34:: with SMTP id t49-v6mr20593368qte.404.1533055152009; Tue, 31 Jul 2018 09:39:12 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id k3-v6sm11089353qta.37.2018.07.31.09.39.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Jul 2018 09:39:11 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 3/3] blk-cgroup: clear the throttle queue on fork Date: Tue, 31 Jul 2018 12:39:04 -0400 Message-Id: <20180731163904.21856-4-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180731163904.21856-1-josef@toxicpanda.com> References: <20180731163904.21856-1-josef@toxicpanda.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We were hitting a panic in production where we put too many times on the request queue. This is because we'd get the throttle_queue of the parent if we fork()'ed while we needed to be throttled, but we didn't have a reference on it. Instead just clear these flags on fork so the child doesn't pay for the sins of its father. Signed-off-by: Josef Bacik --- kernel/fork.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index 9440d61b925c..694ae0e56866 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -843,6 +843,11 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) tsk->fail_nth = 0; #endif +#ifdef CONFIG_BLK_CGROUP + tsk->throttle_queue = NULL; + tsk->use_memdelay = 0; +#endif + return tsk; free_stack: