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 52ACAC54E8E for ; Mon, 11 May 2020 13:39:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2186E206F9 for ; Mon, 11 May 2020 13:39:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2186E206F9 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 A76F1900051; Mon, 11 May 2020 09:39:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A26F5900036; Mon, 11 May 2020 09:39:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9169A900051; Mon, 11 May 2020 09:39:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 776AE900036 for ; Mon, 11 May 2020 09:39:04 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2218045A8 for ; Mon, 11 May 2020 13:39:04 +0000 (UTC) X-FDA: 76804544208.26.alley52_320affd9c8711 X-HE-Tag: alley52_320affd9c8711 X-Filterd-Recvd-Size: 3957 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 May 2020 13:39:03 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id h12so7424949pjz.1 for ; Mon, 11 May 2020 06:39:03 -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=a77Oq5OXHF7el+BrAxI3YkOcCnUkeWqP0J5f4YEVkXM=; b=sWSriHCYsBClZ01fBrHZOODHCxhkOTDCQ0BetWyZeTRWBGqJD9T2A5Ktc0sb8NuHGH uA5qQfYxba2DxQEWEnoaIoXyDr77dYaycOyMV+NROM/GS49qq3Q2atisUmUwltR1sBB5 YJ6+loTXv6laXdEyhjsw6exs8qXuOdIMsEbK4pBHhoW73I08OBg+Y24jDdcfOIhx/tnd 2F95CjkiC35nUyFnuHZKUpsRAstctLD2w1N5oZvYW8UfbZC/3YfiFIBZoRDPYFk7KA4d 8EcOxqZSVYJEyql7jbwgSujAw1HS19IBIWVlFxiLDnsG+6qSQoBWgGOLXWv2kU5iwfS0 v/9A== X-Gm-Message-State: AGi0PuZea8g7J6dahYd729A7DcAYtuDTnPXtXPqhwYrLJfcAyZ+uvDiW /1oA+rZ9sZHcpY0o5W+VfTY= X-Google-Smtp-Source: APiQypKqHlxgJmo3bwvHjknzSYEsG4x2Ee1DWrk4HLFXH26haXIT+z521EOT/qAn2yUInaHP1vs5wQ== X-Received: by 2002:a17:90a:c702:: with SMTP id o2mr22379928pjt.196.1589204342837; Mon, 11 May 2020 06:39:02 -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 t8sm8122734pgn.81.2020.05.11.06.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 06:39:01 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 8354D40605; Mon, 11 May 2020 13:39:00 +0000 (UTC) Date: Mon, 11 May 2020 13:39:00 +0000 From: Luis Chamberlain To: Bart Van Assche Cc: 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 Subject: Re: [PATCH v4 4/5] blktrace: break out of blktrace setup on concurrent calls Message-ID: <20200511133900.GL11244@42.do-not-panic.com> References: <20200509031058.8239-1-mcgrof@kernel.org> <20200509031058.8239-5-mcgrof@kernel.org> 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 Sat, May 09, 2020 at 06:09:38PM -0700, Bart Van Assche wrote: > On 2020-05-08 20:10, Luis Chamberlain wrote: > > @@ -493,6 +496,12 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, > > */ > > strreplace(buts->name, '/', '_'); > > > > + if (q->blk_trace) { > > + pr_warn("Concurrent blktraces are not allowed on %s\n", > > + buts->name); > > + return -EBUSY; > > + } > > + > > bt = kzalloc(sizeof(*bt), GFP_KERNEL); > > if (!bt) > > return -ENOMEM; > > Is this really sufficient? Shouldn't concurrent do_blk_trace_setup() > calls that refer to the same request queue be serialized to really > prevent that debugfs attribute creation fails? We'd have to add something like a linked list. Right now I'm just clarifying things which were not clear before. What you describe is a functional feature change. I'm just trying to fix a bug and clarify limitations. > How about using the block device name instead of the partition name in > the error message since the concurrency context is the block device and > not the partition? blk device argument can be NULL here. sg-generic is one case. Luis