Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4060955pxf; Tue, 23 Mar 2021 01:17:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZRVMou39vuKDEiFb1RWqc2e6KmAK3zWR0/Y7ZYMAq55lgdmx+bwUGh5OZb9gJ1GsOxCkL X-Received: by 2002:aa7:cf02:: with SMTP id a2mr3379416edy.59.1616487450133; Tue, 23 Mar 2021 01:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616487450; cv=none; d=google.com; s=arc-20160816; b=i/c5vEeQ0aK7WZCXmAthazKyMCR/V+wNV0zO3Wt3qj/WuCrjcahXUN8XAs4gGN19rD AJB45WLDGdOSfIA93w6RMTpv4UBdxj+aCOU8b8N4BnsgCLtebaU8DZVbzI+moa1D9eFS F6aRSiGMt4M/3DfiF2wXOmwLClpmoTg9nGDswNqhjWa58jD4IZeKD/dfhotNAszRulcQ nxp/7Y9i3GvqfPZtR60FWAl8m252bxNKth7jbjdYlyNOGwZk+JY83ToSwcONWMwOmyeI kdTvvjZG51qUt+8WBVt88Hl1+0tNMxqGNbMwVN8FN1vUzEYJsvEyCRXOL8lADWGMs+k0 BY0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=F7K6Lh/BNZuQrbqNqcyksNAihXl0YSqISZq+0vfi9Ww=; b=ycuF2RP3ns7vj+93tDDy7D9BdTYTIRLNcDVSllZRDcuR3WE/wmYvBow21L/NKzykq6 UtuYB3wv8eGzwZvhFh+tf5x1B/e90XpSxiH5E09LZAunvRNnCdYqzbUEZAOlcNkJPPk2 VY01d+P0a3WUFJwh8DkEdjmxKUjFs/43qAL07SVBciVZX4L1jg6zp+ZVm0RxaGSxe7cg 0aIihwIBuWeFsd4nKvaX9YjrEanBcUTWUfwkrsp1zB46VEJFQA4duMYKrBoY806Ve4K1 JEzhCK4XoK9r6xdkFOv2LE/+vIfL5tqMo1b4zbxluBTsH/h16ZNkkuOeQ+44rPzNHJAX JLOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YPrFVUcg; 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 t17si13608568ejx.576.2021.03.23.01.17.07; Tue, 23 Mar 2021 01:17:30 -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=YPrFVUcg; 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 S229953AbhCWIPV (ORCPT + 99 others); Tue, 23 Mar 2021 04:15:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21685 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbhCWIO6 (ORCPT ); Tue, 23 Mar 2021 04:14:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616487298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=F7K6Lh/BNZuQrbqNqcyksNAihXl0YSqISZq+0vfi9Ww=; b=YPrFVUcg8ovZmejr6KGPViLSeZ9CMTOCkcq2M53zXoAJEV37qdO9CIex8K3++rjwO6crSq F9l+dY+N4IjnSdHMromoFgc70q4N2ndite1lcQtCWBUuObML+H9gez8S7DotHhHrlwST1x ZbV3JDD1So/p0GU+vInVATF8UEsH9hM= 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-495-wuS5JpfkMiidJHFaeq4bXA-1; Tue, 23 Mar 2021 04:14:56 -0400 X-MC-Unique: wuS5JpfkMiidJHFaeq4bXA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 750F6800D53; Tue, 23 Mar 2021 08:14:54 +0000 (UTC) Received: from localhost (ovpn-13-171.pek2.redhat.com [10.72.13.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AD6160BD8; Tue, 23 Mar 2021 08:14:47 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , linux-kernel@vger.kernel.org, Ming Lei Subject: [PATCH 0/2] blktrace: fix trace buffer leak and limit trace buffer size Date: Tue, 23 Mar 2021 16:14:38 +0800 Message-Id: <20210323081440.81343-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org blktrace may pass big trace buffer size via '-b', meantime the system may have lots of CPU cores, so too much memory can be allocated for blktrace. The 1st patch shutdown bltrace in blkdev_close() in case of task exiting, for avoiding trace buffer leak. The 2nd patch limits max trace buffer size for avoiding potential OOM. Ming Lei (2): block: shutdown blktrace in case of fatal signal pending blktrace: limit allowed total trace buffer size fs/block_dev.c | 6 ++++++ kernel/trace/blktrace.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) -- 2.29.2