Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1334391imm; Fri, 1 Jun 2018 21:55:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJJy/Kic1lleGrfUYK85HkuVwz4cEMBRvAk4l4nVV+22Vay0DAxg58nuziAn3P0q7f9WxQS X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr13941734plk.256.1527915318978; Fri, 01 Jun 2018 21:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527915318; cv=none; d=google.com; s=arc-20160816; b=H0y6nbWG++SW1E/xkQkWWYQ+T8S9O1S6Kr1FX3h6ZZGhGpoQRrRSKhYocFi9vzZBK7 9LplVIk5683tb3jTaVumTdbY0oU3pnIfMEr0eKqHpkoZif+1qsf3h6zY2OMs/ifrR8H0 V7R1ACK/+MYtK0/jD30NKtI19CL6faANxWJFbTSuGdr4M1iMYpPlMFhY7WJoGwvAk4BP Otl+V6J/J13puEmzgyMaTL1G5YJ7MsPQZz/uI8jfuh7fy2Js3hulrBjnvTMAVFkwofHo ySqq+Unj1IfAC4LbP7MHY3rrApVuo6lFjyti2/0hB+qehLJhN8VIg5X4kuQLEuMIqJTl mMeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=DX3BReYxRnx0ACpvQg14AzKsnZfRQuCExJqf+/TMiaA=; b=CFNJYhz2ogfBTdBGaZeEdRF/HTWCHY5b0CuWkbbapnCetUK3YCZAD4lHp5ht7KQbIn 9Y7hLJ4VlFJXEnRA9mgJkBlEQNuQFb8JrQy1kmmC7wMQhq1aL5sQt16QfD+vfgFoEaDI cwLxdDe4YS9xjPAdkJTidLu2yhZUFHSxhAmbSEEoOiIE72uJNx2z+sE58bhJW/LsUls8 lXRiXaXIdEdRXZPHEo5jk37z/tNFlwhfdcOQXkVFG3Y9sIrYWZUE0rPyr5npxvfHZqAx pB6f3AGrJxSUu2fCWk31PoBqwanB6HYUCfZsVLudIWvwqrL+HJG4LoHYoK1vJrfZfURn 6lCQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10-v6si29613710pgq.131.2018.06.01.21.55.02; Fri, 01 Jun 2018 21:55: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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750931AbeFBEyc (ORCPT + 99 others); Sat, 2 Jun 2018 00:54:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38090 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750748AbeFBEya (ORCPT ); Sat, 2 Jun 2018 00:54:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA2657C6C4; Sat, 2 Jun 2018 04:54:29 +0000 (UTC) Received: from ming.t460p (ovpn-12-47.pek2.redhat.com [10.72.12.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40FB21C5B3; Sat, 2 Jun 2018 04:54:08 +0000 (UTC) Date: Sat, 2 Jun 2018 12:54:02 +0800 From: Ming Lei To: Jens Axboe Cc: Tetsuo Handa , Bart.VanAssche@wdc.com, dvyukov@google.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, jthumshirn@suse.de, alan.christopher.jenkins@gmail.com, syzbot+c4f9cebf9d651f6e54de@syzkaller.appspotmail.com, martin.petersen@oracle.com, dan.j.williams@intel.com, hch@lst.de, oleksandr@natalenko.name, martin@lichtvoll.de, hare@suse.com, syzkaller-bugs@googlegroups.com, ross.zwisler@linux.intel.com, keith.busch@intel.com, linux-ext4@vger.kernel.org Subject: Re: INFO: task hung in blk_queue_enter Message-ID: <20180602045353.GA20257@ming.t460p> References: <6db16aa3a7c56b6dcca2d10b4e100a780c740081.camel@wdc.com> <201805220652.BFH82351.SMQFFOJOtFOVLH@I-love.SAKURA.ne.jp> <201805222020.FEJ82897.OFtJMFHOVLQOSF@I-love.SAKURA.ne.jp> <25708e84-6f35-04c3-a2e4-6854f0ed9e78@I-love.SAKURA.ne.jp> <20180601234946.GA655@ming.t460p> <95c419d8-7f19-f9c0-a53f-3d381fe93176@kernel.dk> <20180602023622.GA2306@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Sat, 02 Jun 2018 04:54:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Sat, 02 Jun 2018 04:54:30 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 10:31:13PM -0600, Jens Axboe wrote: > On 6/1/18 8:36 PM, Ming Lei wrote: > >> clear the bit when we need to, potentially even adding a debug check to > >> blk_queue_enter_live() that complains if the ref was not already > >> elevated. Though that would be expensive, compared to the percpu inc > >> now. Not saying the bit is necessarily the best way forward, but I do > >> like it a LOT more than adding an argument to generic_make_request. > > > > We may introduce generic_make_request_with_ref() for blk_queue_split(), > > what do you think of the following patch? > > Functionally it'll work as well. If you are fine with this one, I'm glad to prepare for a normal one, so that we can save one precious bio flag, and the total number is just 13. > > > In DM or MD, there is the following use case: > > > > 1) bio comes from fs, then one clone is made from this bio > > > > 2) the cloned bio is submitted via generic_make_request() from > > another context, such as wq. > > > > 3) then the flag of BIO_QUEUE_ENTERED is inherited and causes > > the queue usage counter isn't held. > > We don't copy flags on a clone. Yeah, you are right, seems I ignored that. Thanks, Ming