Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2274762ybc; Wed, 13 Nov 2019 11:42:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwK6+az3cxeueUJlQmMzHdxi2RcsDAP4YLouCaJIMB0rF51KefDcb3p0aQSW6g6FB6fthWR X-Received: by 2002:aa7:cc95:: with SMTP id p21mr5538257edt.189.1573674135061; Wed, 13 Nov 2019 11:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573674135; cv=none; d=google.com; s=arc-20160816; b=ndKR/EIdPAIlBWF9b1I+dSBqE1zUyLNA35ndDOmmssHpLelsd14cCzh1V3kXisIAfl ntyuc8Nc1+jRqFKlUwuo3xgKJj/aOa9e7QBJ1qwVb7ljn6PhRnN2AuoZI5fSjvhfvOG0 k+ggZn7gF3BT+w9eaUnydbJNdIH2AZtdvoPzchAJbg/otyqwSLBdeEQaMem+krfxqNLF X+cG8vrFrwKii/knZAu54tl+T+WceW5vlEjzNTE0wBbiVQ0BkzT1e4W21RQtKMJn+nz/ vlV8zt8kVytbOzirnf2UTw3i4xW3Iz4oFXrUkX9LlNfyyg5/vOHViqXtyD+juPzd07JT g+Cg== 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; bh=mz6pToO0mKtA/LUS4MuIdWlBLVDCp82WhnTAbnzB3mU=; b=nblOkPaHzSsBM4TFxMJPLKnIO7mr2kWjiojMItmM51QBcj+MBhT8YarifcukS7aYte JwSLyfWPq8eDFY/NP1FegIVO7N2FN6SMT4UFPbuhV0e1ynwegSn6pVcsRcy3+VCEFpRV 9Pp+JpPL8nZEfAFW32MfR6p76RuT/vKzsY3bvnlNHyFYwRbHbTfe2w1opohi6lYsqNao s2zHjTC4bXBrGPcW+xIFwFXWon218whtZFkjkEVMThVv5XxJ21maC627egsiyPAdmMaT yB8rH2RunbEcOzhwknmHEZJbd6C7D57dLPZNv39EIt7Bru8a9eT8btXROjNii3y5xnCC RwJA== 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 4si2515447edc.4.2019.11.13.11.41.50; Wed, 13 Nov 2019 11:42:15 -0800 (PST) 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 S1726910AbfKMTkN (ORCPT + 99 others); Wed, 13 Nov 2019 14:40:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:43870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfKMTkN (ORCPT ); Wed, 13 Nov 2019 14:40:13 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 B8E7E206DC; Wed, 13 Nov 2019 19:40:12 +0000 (UTC) Date: Wed, 13 Nov 2019 14:40:10 -0500 From: Steven Rostedt To: Chunyan Zhang Cc: Chunyan Zhang , Ingo Molnar , Linux Kernel Mailing List , Yuming Han Subject: Re: [PATCH] tracing: use kvcalloc for tgid_map array allocation Message-ID: <20191113144010.0368a715@gandalf.local.home> In-Reply-To: References: <1571884773-23990-1-git-send-email-chunyan.zhang@unisoc.com> <1571888070-24425-1-git-send-email-chunyan.zhang@unisoc.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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 Fri, 1 Nov 2019 11:21:11 +0800 Chunyan Zhang wrote: > gentle ping Sorry, was traveling during this time, and my INBOX exploded :-p > > On Thu, 24 Oct 2019 at 11:34, Chunyan Zhang wrote: > > > > > > From: Yuming Han > > > > Fail to allocate memory for tgid_map, because it requires order-6 page. > > detail as: > > > > c3 sh: page allocation failure: order:6, > > mode:0x140c0c0(GFP_KERNEL), nodemask=(null) > > c3 sh cpuset=/ mems_allowed=0 > > c3 CPU: 3 PID: 5632 Comm: sh Tainted: G W O 4.14.133+ #10 > > c3 Hardware name: Generic DT based system > > c3 Backtrace: > > c3 [] (dump_backtrace) from [](show_stack+0x18/0x1c) > > c3 [] (show_stack) from [](dump_stack+0x84/0xa4) > > c3 [] (dump_stack) from [](warn_alloc+0xc4/0x19c) > > c3 [] (warn_alloc) from [](__alloc_pages_nodemask+0xd18/0xf28) > > c3 [] (__alloc_pages_nodemask) from [](kmalloc_order+0x20/0x38) > > c3 [] (kmalloc_order) from [](kmalloc_order_trace+0x24/0x108) > > c3 [] (kmalloc_order_trace) from [](set_tracer_flag+0xb0/0x158) > > c3 [] (set_tracer_flag) from [](trace_options_core_write+0x7c/0xcc) > > c3 [] (trace_options_core_write) from [](__vfs_write+0x40/0x14c) > > c3 [] (__vfs_write) from [](vfs_write+0xc4/0x198) > > c3 [] (vfs_write) from [](SyS_write+0x6c/0xd0) > > c3 [] (SyS_write) from [](ret_fast_syscall+0x0/0x54) > > > > Switch to use kvcalloc to avoid unexpected allocation failures. > > > > Signed-off-by: Yuming Han OK, I'll apply this. -- Steve > > Signed-off-by: Chunyan Zhang > > --- > > kernel/trace/trace.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > > index 6a0ee9178365..2fa72419bbd7 100644 > > --- a/kernel/trace/trace.c > > +++ b/kernel/trace/trace.c > > @@ -4609,7 +4609,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled) > > > > if (mask == TRACE_ITER_RECORD_TGID) { > > if (!tgid_map) > > - tgid_map = kcalloc(PID_MAX_DEFAULT + 1, > > + tgid_map = kvcalloc(PID_MAX_DEFAULT + 1, > > sizeof(*tgid_map), > > GFP_KERNEL); > > if (!tgid_map) { > > -- > > 2.20.1 > > > >