From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4FF1C2D0EF for ; Thu, 16 Apr 2020 05:29:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6C6C820767 for ; Thu, 16 Apr 2020 05:29:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C6C820767 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 13F9D8E007D; Thu, 16 Apr 2020 01:29:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F0718E0001; Thu, 16 Apr 2020 01:29:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 006958E007D; Thu, 16 Apr 2020 01:29:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id DB0CB8E0001 for ; Thu, 16 Apr 2020 01:29:12 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 98F40181AEF21 for ; Thu, 16 Apr 2020 05:29:12 +0000 (UTC) X-FDA: 76712589744.09.burn04_8a972de32fc0b X-HE-Tag: burn04_8a972de32fc0b X-Filterd-Recvd-Size: 4472 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Apr 2020 05:29:12 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id n24so936842plp.13 for ; Wed, 15 Apr 2020 22:29:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ij4rGJFKYYZMX5F8riwLVS0GXQyfAT1zFiaKZy0C85M=; b=YuC5TRG7NeEPHePstIbSOogTeEu/5XvKoJh9Prh765L1aymfXSnEbYL/b1C0wQn839 I6fFcCXpAasDFAQrWbZPbU5AaCl3I3GvwTmNtdvfO8meFFCn9ukinbMcRFUsrE02yxE0 ScMdsfdPVt9W1sP5rTbWfc2Ig3PpE5ESYr8/kUU87Wz+awt0B7QSRsYtOQEmeGuy6/QA m/BHhirikoPHl1/Rva/ILOe/Jgm9EGJxsSKEmLvesIg/T2tCTb9kN4GwOMuXRJhmYqit KNopC2BZ7WGwmF3Te2A32NcaK6rmELf9i5Wl4hDlQNVW0X5y/vSGMPIEp8BfZuOHhnHq rYvA== X-Gm-Message-State: AGi0Pua+t3+62J1iZWVSh3HTy39KdD4hW+mikvEpk2rxvpy5tou+vz5U ppNOCXd5vgM7JTZCFooPOq4= X-Google-Smtp-Source: APiQypJtVA7tYtC5+yKFDxY4H+Ux5Opdy5jE7rOi5sFzYU8r893dt7Op6/U6W4QfePu/vQgcNikFYg== X-Received: by 2002:a17:902:b10d:: with SMTP id q13mr8105119plr.265.1587014951372; Wed, 15 Apr 2020 22:29:11 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id f3sm1303896pjo.24.2020.04.15.22.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 22:29:10 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 914EF40277; Thu, 16 Apr 2020 05:29:09 +0000 (UTC) Date: Thu, 16 Apr 2020 05:29:09 +0000 From: Luis Chamberlain To: Bart Van Assche Cc: Christoph Hellwig , axboe@kernel.dk, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org, mhocko@suse.com, yukuai3@huawei.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Omar Sandoval , Hannes Reinecke , Michal Hocko Subject: Re: [PATCH 3/5] blktrace: refcount the request_queue during ioctl Message-ID: <20200416052909.GI11244@42.do-not-panic.com> References: <20200414041902.16769-1-mcgrof@kernel.org> <20200414041902.16769-4-mcgrof@kernel.org> <20200414154044.GB25765@infradead.org> <20200415061649.GS11244@42.do-not-panic.com> <20200415071425.GA21099@infradead.org> <20200415123434.GU11244@42.do-not-panic.com> <73332d32-b095-507f-fb2a-68460533eeb7@acm.org> <20200416011247.GB11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Apr 15, 2020 at 08:43:32PM -0700, Bart Van Assche wrote: > On 2020-04-15 18:12, Luis Chamberlain wrote: > > On Wed, Apr 15, 2020 at 07:18:22AM -0700, Bart Van Assche wrote: > >> blk_get_queue() prevents concurrent freeing of struct request_queue but > >> does not prevent concurrent blk_cleanup_queue() calls. > > > > Wouldn't concurrent blk_cleanup_queue() calls be a bug? If so should > > I make it clear that it would be or simply prevent it? > > I think calling blk_cleanup_queue() while the queue refcount > 0 is well > established behavior. At least the SCSI core triggers that behavior > since a very long time. I prefer not to change that behavior. I see. An alternative is to simply check if we already are cleaning up and if so abort early on the blk_cleanup_queue(). That would allow re-entrant calls, and just be a no-op to the additional calls. Or is the re-entrant, two attemps to really do all the work blk_cleanup_queue() expected functionality already? > Regarding patch 3/5: how about dropping that patch? If the queue > refcount can drop to zero while blk_trace_ioctl() is in progress I think > that should be fixed in the block_device_operations.open callback > instead of in blk_trace_ioctl(). I'll take a look, thanks! Luis