Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp5920pxf; Tue, 30 Mar 2021 17:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaFmyzv8yNulEpRyaCOBIX1Vaz8yMRxuXqpedo5dZizbPBZcBtBNku5qpmWVjPghNKH6Dw X-Received: by 2002:a17:906:e119:: with SMTP id gj25mr715062ejb.509.1617150069710; Tue, 30 Mar 2021 17:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617150069; cv=none; d=google.com; s=arc-20160816; b=J7qJ1k4FEJbDAKXQpVjDkcP+iX7HsAo4w88D6+Y1qL5LMIxrlb+4F68HrgCrTfcWKo JEuTfAIEPRo6xZzPzQc6gUCUENP3RUm1jfVxeP8NQ+n3AMtPUNoYf9h/tYJPcLnGYsnX zvIGMSwRPX1+lfEa5wq3lW5QkjpuTLBNiHFWooLDpAEk1EZfUSdV2sSlrlN+aSA8yH+q +K2nN0thKGSfu1YxdDbvReLTJ1kEwYE5epkYuABgpunCG35DHHQCVfTusn6RRaT5a9Cy yhjramdZMhWJ+bhDbiu9xDekS2+HzaWyx84oLS6AGdb+UdagtwyCM0+6WqYZPoyx6AuC inSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jpzj3I1Cp4N4TRFAijczwqSsbB26ItTieKnqXo2KsP0=; b=XOtGaT/Rp094mkx9jHYQ0/wTiGNFfCJIJ82IVsBIE7I0xhEPByeN1w5tx08PG7ZbzR MinAGNzO9YCMFclaLNbUQQuUNkAw2dfBUjsGBqAiR/DsMh3UMEIpmxFOXE0hB3Pb3Io8 SgXP3JE4LaEqzhgUo3QSYaeAZsK5ssbyAAXQN3Z3XzL5duxVyognreMBPCq9tj3oRAg5 9PCmayDQc1vtH/orUyKgdDClp6O2r3LAcUUZF3/evQyLPteOteKSUNyM/qYKY/rsq+XN wRw8p7qRk3wQPQK6eKAlzlQ9fvuck9DcXkUfbY3st6017IKAK1w1gGa9ltFCSgDFWyfT a3FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y2T0S7Xe; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si450982edi.319.2021.03.30.17.20.46; Tue, 30 Mar 2021 17:21:09 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y2T0S7Xe; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232702AbhCaARU (ORCPT + 99 others); Tue, 30 Mar 2021 20:17:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52053 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232800AbhCaARH (ORCPT ); Tue, 30 Mar 2021 20:17:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617149826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jpzj3I1Cp4N4TRFAijczwqSsbB26ItTieKnqXo2KsP0=; b=Y2T0S7XegMtGjwQGwk7j5i753YgWPh67AbNR/iSZyv7/tYuyodcKtgKlVhhP5RhNHxGYxe IX3kaffzB/h46CeH5I5ppgaPzKax+AioG1b3xLLcwYAWiCTppBsrbbwu4ow6ghB17XXu54 kY83Dpz1w8z+6jlH9NgeuUlf8ZA6tiY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-HW9HcCmpOymkbY2AsFs2EQ-1; Tue, 30 Mar 2021 20:17:03 -0400 X-MC-Unique: HW9HcCmpOymkbY2AsFs2EQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9991C83DD20; Wed, 31 Mar 2021 00:17:02 +0000 (UTC) Received: from T590 (ovpn-12-104.pek2.redhat.com [10.72.12.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 157FF19C59; Wed, 31 Mar 2021 00:16:54 +0000 (UTC) Date: Wed, 31 Mar 2021 08:16:50 +0800 From: Ming Lei To: Christoph Hellwig Cc: 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: References: <20210323081440.81343-1-ming.lei@redhat.com> <20210323081440.81343-2-ming.lei@redhat.com> <20210330165330.GA13829@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210330165330.GA13829@lst.de> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 06:53:30PM +0200, Christoph Hellwig wrote: > On Tue, Mar 23, 2021 at 04:14:39PM +0800, Ming Lei wrote: > > blktrace may allocate lots of memory, if the process is terminated > > by user or OOM, we need to provide one chance to remove the trace > > buffer, otherwise memory leak may be caused. > > > > Fix the issue by shutdown blktrace in case of task exiting in > > blkdev_close(). > > > > Signed-off-by: Ming Lei > > This just seems weird. blktrace has no relationship to open > block device instances. blktrace still needs to open one blkdev, then send its own ioctl commands to block layer. In case of OOM, the allocated memory in these ioctl commands won't be released. Or any other suggestion? -- Ming