Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp503311ima; Sat, 20 Oct 2018 11:57:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV60QnbGuLh6vSAtbqBfBf62DpmpzbFwQWfP8Ypi7AneBNNKyXIIzcM89jzqKEuGxxqxVq58b X-Received: by 2002:a63:4c4e:: with SMTP id m14-v6mr37431280pgl.173.1540061838375; Sat, 20 Oct 2018 11:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540061838; cv=none; d=google.com; s=arc-20160816; b=K+vqxBV9/3eqqkvZsG7ZPGXoZo0OXCHQKIMvF9LPTd0yz3hR6QHEn0D4//iXIq23BD 3owCIsOsLvIv80ewYS4RfTgjpyImIjD6UG2kMZfTeXOUNpgvW346RebCd13My4coQ1pn ea0xzEncobdwj0uGLUH5H9EXSLcXktZfpXgPwK2bRzUcVIT0Ni4c8VkZ9iwErj+KsAPZ WXU9B94UOI4FVbYZkF0aVmFMkwR+I50x5BCMg4Ph2fAZdP6F8pvvLGXYPcfw0BJI6dzl hQfSAHkAqFQvQuRt0/czNgoyh0QHpPLNP7Z6mGHMZw2f8EwCWdmHN4oWE3ZdOt9xtFlZ zTCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=rkdP/SDB6tKFV4oYMZiWk9dFrzIYzeYwYUcXwPb7M8A=; b=g5RosIs/MktkU7f0APotU5e7ZHd1KhUnqCmurBJW5q1fNnjEKnIjdrzHzgxdedu8hc a8nQiPtRuCgeel65CLMmJ39spn5ST9sZTQDv4qAmFdd4/51hGLT3JKtgjY+a1oECHPQt zEBpFV72DNsCGezPjC/HvgzCFREt36ViEG5ocS9kVpZfiy6NdZHv2Vti2bgn1rLPN3no sBMDLTZqtMtgkpWCBEWLVOacP+6uZ8VOXradPwHLekIc/WgXPzOVBWmAHyZG7k7NxRS9 Z5xB4zF+FjGob2gqMRLwwhhTaNTZb++Kt2mQ6ZXMWy09yw0IHuYGldarZj5by0/AytjF oM/w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9-v6si29026219pgl.446.2018.10.20.11.56.51; Sat, 20 Oct 2018 11:57:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727590AbeJUDHq (ORCPT + 99 others); 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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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