Received: by 10.213.65.68 with SMTP id h4csp1685701imn; Thu, 29 Mar 2018 09:07:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Cf45k+S4mcTZB3MP4mvWk/PqkXwvhQcJAFP4j/HymB6r6h0puothsi7k5ipsdr4Vz0zAr X-Received: by 2002:a17:902:b611:: with SMTP id b17-v6mr8901490pls.27.1522339635311; Thu, 29 Mar 2018 09:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522339635; cv=none; d=google.com; s=arc-20160816; b=SG4mZmuVyPvyK1OiDDVP1oGP5vcPLm17JiDaGgf+u8XEVgEBOs+guZYayq67lb/7po zE+9A5wMZEWGKhSV3pedys3pZTG+57vZTLDflTwKuOZpod8dczFkHwvOFphADbJ/JwT5 JPb22GFkIFgcgxEA3rEAbjvM7bTgne44PC53DiDSDG9VDtfu/t/X3xZTvTH3b+GnTiV6 PRb9qtYIfoC/i7IJ84rbQPCOVxjMgfHmy2tSZffn4CHiKGIoq1PV2GRaG0utWtsPKkET Jk7vhnfQPg14sQoH/fvtL1/10eoNzs3XO3t+isz/SlSo//cm7AiXcgfDdyEekZZiF2io 4Xbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=8rDzg2C91GC5tN/FBnPeKvzOvNN7UUMfNTJxs9PyKwI=; b=VXtVYV2ZvC49LkHFmEqDLF71RQaXswjKh4kUZr+pghqUTDDlOvreLNtJ4tSmN0CAE+ 6Hiiaxzm7Cao6b6GVhGJ4qcLXqOY296G5CJ1tUDaaLePWAMOzopV/Wy5hmpB4oHj+V9V kzofU3KWTQHQ4mBkQWPHE7JRqJK5wEBJClWEZXSccY8int1QY0bmNAgMPKGLrHG9+U8B 77SXgMUsy+KyPSbPKSdNH9eXXP6KJoRk9Xs1sld0R7zCVdTm83CartZaQcHlWQGyskzZ YzY/2YsRvNo2s2y6dWItCs6BKPHAJXYwHO85csXfr9/UtQcicTJjR81dHJiRSsXKafys hJcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d65si4184340pga.307.2018.03.29.09.07.01; Thu, 29 Mar 2018 09:07:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbeC2QFc (ORCPT + 99 others); Thu, 29 Mar 2018 12:05:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:52174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbeC2QFb (ORCPT ); Thu, 29 Mar 2018 12:05:31 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 451F120856; Thu, 29 Mar 2018 16:05:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 451F120856 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Thu, 29 Mar 2018 12:05:28 -0400 From: Steven Rostedt To: Zhaoyang Huang Cc: Ingo Molnar , linux-kernel@vger.kernel.org, kernel-patch-test@lists.linaro.org Subject: Re: [PATCH v1] kernel/trace:check the val against the available mem Message-ID: <20180329120528.337bf6cb@gandalf.local.home> In-Reply-To: <1522320104-6573-1-git-send-email-zhaoyang.huang@spreadtrum.com> References: <1522320104-6573-1-git-send-email-zhaoyang.huang@spreadtrum.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Mar 2018 18:41:44 +0800 Zhaoyang Huang wrote: > It is reported that some user app would like to echo a huge > number to "/sys/kernel/debug/tracing/buffer_size_kb" regardless > of the available memory, which will cause the coinstantaneous > page allocation failed and introduce OOM. The commit checking the > val against the available mem first to avoid the consequence allocation. > One of my tests is to stress buffer_size_kb, and it fails nicely if you try to get too much. Although, it may cause an OOM, but that's expected. The application should do the test (try "free" on the command line). This isn't something that the kernel should be responsible for. If someone wants to allocate all memory for tracing, that's their prerogative. -- Steve