From patchwork Sat Oct 20 18:56:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Zhou X-Patchwork-Id: 10650581 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 05AEE1508 for ; Sat, 20 Oct 2018 18:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAA3D28608 for ; Sat, 20 Oct 2018 18:56:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDAF228640; Sat, 20 Oct 2018 18:56:31 +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,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 46A232863B for ; Sat, 20 Oct 2018 18:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727459AbeJUDHq (ORCPT ); Sat, 20 Oct 2018 23:07:46 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:40396 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727350AbeJUDHq (ORCPT ); Sat, 20 Oct 2018 23:07:46 -0400 Received: by mail-yb1-f196.google.com with SMTP id w7-v6so14585695ybm.7; Sat, 20 Oct 2018 11:56:24 -0700 (PDT) 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; bh=rkdP/SDB6tKFV4oYMZiWk9dFrzIYzeYwYUcXwPb7M8A=; b=QexyJyJiRlLCNBKylhaK5FcHkp/e/U3xtpB6EIM+4kmZIRso90tfJc2Txwlbje99YR iODna1Mrpkyer/AjAwXxqttdvbHiZ26mLflo+enDKmj71UwOoOSTsgPeObf/zCchRBG6 NTV1ZHkPbIhpS0AXvPYygsCA7+nsx2P3FbsGfhU6+AMPWf1wHpQCwdRO+c67g4bPe8a2 FIxj5O1AQoRyB1j12Sh1uoOSOMa10pVmCX3QK6uPRCTYUc13HkpEoKsx35lg/F/jZUpj H0iWBrgoayouA8+9pbHnTLGqbzfmDLPsNM/JuPgB9r4y75MaPN1dBHC0Q1K7jDyGzW8H 0j8g== X-Gm-Message-State: ABuFfog2e4IPQhSCe+9Zup4J9yLn53qDAk9wZ1+YioD57zOMV1MwIu9L aGozXref7ZzgtdPQEgpNA2k= X-Google-Smtp-Source: ACcGV61f4tC2d2YDjezPBhDsP5mLcuQw8H/opf+XpskqFmVz7z99xspEFoafQfXo+rw27+9rjXGvNQ== X-Received: by 2002:a25:58c6:: with SMTP id m189-v6mr25817809ybb.80.1540061784079; Sat, 20 Oct 2018 11:56:24 -0700 (PDT) Received: from dennisz-mbp.thefacebook.com ([199.201.65.3]) by smtp.gmail.com with ESMTPSA id h63-v6sm1977456ywb.110.2018.10.20.11.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Oct 2018 11:56:23 -0700 (PDT) From: Dennis Zhou To: Jens Axboe Cc: Tejun Heo , Valdis Kletnieks , kernel-team@fb.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Dennis Zhou Subject: [PATCH 0/2] block: fixes for always associate blkg Date: Sat, 20 Oct 2018 14:56:10 -0400 Message-Id: <20181020185612.51587-1-dennis@kernel.org> X-Mailer: git-send-email 2.13.5 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 Hi everyone, It was reported in [1] that blk_get_rl() cleanup patch was causing a null pointer dereference. After some back and forth debugging with Valdis, it turns out I wasn't properly handling association with recursive calls to make_request(). Another issue was identified with the blk_get_rl() update as it is possible under certain circumstances that a blkg cannot be allocated when called in blk_get_rl(). This could result in the blkcg_root being returned. However, the blkcg_root is a special case where all blkgs share the request_queue's request_list. The original series can be found at [2]. [1] https://lore.kernel.org/lkml/13987.1539646128@turing-police.cc.vt.edu/ [2] https://lore.kernel.org/lkml/20180911184137.35897-1-dennisszhou@gmail.com/ This patchset contains the following 2 patches: 0001-blkcg-fix-edge-case-for-blk_get_rl-under-memory-pres.patch 0002-blkcg-reassociate-bios-when-make_request-is-called-r.patch 0001 addresses an edge case where a blkg cannot be created and can possibly return a blkg associated with the blkcg_root. 0002 fixes the stale association when make_request() is called recursively. This patchset is on top of axboe#for-4.20/block bbc152825afc. diffstats below: Dennis Zhou (2): blkcg: fix edge case for blk_get_rl() under memory pressure blkcg: reassociate bios when make_request() is called recursively block/bio.c | 20 ++++++++++++++++++++ block/blk-core.c | 1 + include/linux/bio.h | 3 +++ include/linux/blk-cgroup.h | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) Thanks, Dennis