Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4149894pxf; Tue, 6 Apr 2021 09:03:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9f4dV+T95iIWrM8kijRYH4fTb2PaccLYxQk90NzfqFdZSRxfX2UQdBMFH29UYMjkCp/QP X-Received: by 2002:a6b:da0f:: with SMTP id x15mr24488187iob.181.1617725027721; Tue, 06 Apr 2021 09:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617725027; cv=none; d=google.com; s=arc-20160816; b=f9fALIN+QEzuSa61U09b34ZBJUvmW1CtdjflzGAAM/2UbbFIcbk7ad/wcmEd3ZIv47 fTRqMmPfflFgOQwHg9zCfiTGXw8qSkDXbYtneG10T8MvMdtLfkWgaG+y0xY0lSq+N4// nkyXFfnT6vK15dHvWTP+oAYEj/GPt3IOPL3YlvURCr1nqF+HSMglpLezXdtFhEhGjqE1 XGFkyS4LI4uX+m0EnlXBXCVonv4gCCt3+31wHvffLxuH/eNFAz28fFtf+NVDPBQ+0j9T 406ZpHMruwFnppM+5UwRvl38OF71+ZFTKOXd1oJ1cTwDbOWN9PMfvEyPpR2kSsDZRonk oWOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7N2Q7YytYeqt2MaBqK1lDpm+kzhM/RPoi3w0b8lTicM=; b=IWqAr0lGwASdkOUfAbB7hV05l0+dVbrMumqZ2llTePQcKHbLBC2yPLCIia467ss42T RAaUQY+H3Lhr1vJJXdVbjTPqc8zpSW5bUQXvklHn3zy1ZzwVdK8PT3z335/Ypobjga7D VbFjIZIFdTgCH8w59bUcLdNJKYskjYwzmZM4cpR/cs7dN+944HYjEZPZQVxon+6Eab7T fhYDdvB9/O9Mjo7d+aAUXWavTfj71HMkaNS/oFhpXVlFk8m2dUjNk7IoZd5z4pdtIZU6 rpnBqK3lQgF9LUd//6SsGcfK8IrMYmpGhZMIKEydodB5O4CATpB73Br6+FW4uNIzILkz mwIw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si18745351iov.92.2021.04.06.09.03.35; Tue, 06 Apr 2021 09:03:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238666AbhDFGat (ORCPT + 99 others); Tue, 6 Apr 2021 02:30:49 -0400 Received: from verein.lst.de ([213.95.11.211]:53118 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237859AbhDFGas (ORCPT ); Tue, 6 Apr 2021 02:30:48 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C34BA68BEB; Tue, 6 Apr 2021 08:30:38 +0200 (CEST) Date: Tue, 6 Apr 2021 08:30:38 +0200 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] block: shutdown blktrace in case of fatal signal pending Message-ID: <20210406063038.GA6337@lst.de> References: <20210323081440.81343-1-ming.lei@redhat.com> <20210323081440.81343-2-ming.lei@redhat.com> <20210330165330.GA13829@lst.de> <20210402172730.GA22923@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 03, 2021 at 04:10:16PM +0800, Ming Lei wrote: > We still may shutdown blktrace if current is the last opener, otherwise > new blktrace can't be started and memory should be leaked forever, and > what do you think of the revised version? I don't think this works. For one there might be users of the blktrace ioctl that explicitly rely on this not happening as difference processes might start the tracing vs actually consume the trace data. Second this might not actually work as another process could be the last opener. If you want to fix this for the blktrace tool (common) case I think we need a new ioctl that explicitly ties the buffer lifetime to the fd.