Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp918616ybz; Wed, 15 Apr 2020 22:30:39 -0700 (PDT) X-Google-Smtp-Source: APiQypKqwWdVXuwvsf7FS1VprBnLGgI8UmzCeG/JTtSFN+pHAhm2TxlVGNSeNcAhp2wV2rJsJwN7 X-Received: by 2002:a17:906:1cd5:: with SMTP id i21mr8137936ejh.251.1587015039168; Wed, 15 Apr 2020 22:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587015039; cv=none; d=google.com; s=arc-20160816; b=siRhcJ7gemjxBIci/SGMAWALkimGlhpV2sN9S8SSiqJz7FXEMqTSNi3tUi80Anj0u/ hXgzaLEYEDBLZDd+OccCHj9irdz+2+WrNgicHBZb/6bbpRspZhhLSqmU/cXZlZqzThO1 q4MNY0ZwLbwBo5iQ5fsI1vkMcDqFb8CR5m7pMeHFMWQ0crtLoYZ/qruUwpJlZ73YPNlB QVfreX82HAXzaaHXLH7h0LQa+kEGBPjMmjx+wQWktb1r3DDdDwuhVjStwCj7GD/VQwH0 LNmhcVAWlkbzg2FR0whC8nPzUl9J1ZuRR16aeYtn1gMhCPOt59W+v5o63ucV4Tr0E9BS yesA== 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; bh=ij4rGJFKYYZMX5F8riwLVS0GXQyfAT1zFiaKZy0C85M=; b=PnDMYHEotzh051f4x6nU+WJi/1t77YcBgdQR/1hA2L73WIiF62ICubAw4OSZpD2WsR F25blut4OUAMlYQiZ7DDvT0sdSYt2DYShIEAT0Mm2NpZASkoNQO9mMb+0xfAq5h21vBy 3b8e+6XXkjehpWQStDyZn5ZJzvk9VaEnWOV8CeOcKNog0RSUkGsEEQ2WweCzBMOKqZEk ghb8MRBSNdOtRlNwZRWEMyQ/jD4eoPZH/SIfE6y0td9QHdW9OuRmVUBwkDytl32cutbF cgyhNsTmAP5+bsDyYMp0Pqy3yM4VM0dI8pXWdKxzilkBFsMFNcnoh37j/6BaYgqI7T0c FRRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si5231692edq.187.2020.04.15.22.30.14; Wed, 15 Apr 2020 22:30:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406578AbgDPF3Q (ORCPT + 99 others); Thu, 16 Apr 2020 01:29:16 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45821 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406188AbgDPF3N (ORCPT ); Thu, 16 Apr 2020 01:29:13 -0400 Received: by mail-pl1-f194.google.com with SMTP id t4so936772plq.12; Wed, 15 Apr 2020 22:29:11 -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=AXqoMDO4c7CwVybHhi3bDUiC9dkPYsif7yaj0wo0CYlxeb9N5gWz87RzVzcXHKrJLS zjoY+8hKbZx0P+eSEz2RADWhJTjyluTfIWccuK9hHW0vUy9OkrOjUoyR4x3lSGij/6He Puv2VpYCfbs3ONMEsxSMc08FpyqqteoFgCgsOwHz0NW9HxonulPy5Tllb4geL/wYhMom zCDRc26VCf4wjtH6amIcABBMySfZY87VaOKMwijXxmXETdk+z9ouza42t0hdLX50NAd5 L9xCyPWPXVutBpX77ZYCkqmd6gVtiu4UR5Lfqqg4r2dziJnaCsuC6ooF0ccAdimoj1GT g2rw== X-Gm-Message-State: AGi0PuaAaikMEhpoPjnJ5HMZvfyoN/xB/7R3UmyI9CFC4SwRmi9K1fDO LiCqiCSUUgT5AktNz7FtqG4= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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