Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp281360ybx; Thu, 31 Oct 2019 20:26:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6oEhNhh3Xe6cEQNLrPP9FHtJKUi3hNPTStteeGuhMDEuALWpEe8WAjyheojbEmvQf186L X-Received: by 2002:a50:c2c2:: with SMTP id u2mr10272874edf.133.1572578793192; Thu, 31 Oct 2019 20:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572578793; cv=none; d=google.com; s=arc-20160816; b=ZIJz1nAP9BiiPBvcbmOrDnszM6LQTADRz/HkRLDiq/2RXncoTOL4XJ/vDdrGXKcGcX IDx7/rZHB3qYiZDNRGj9PhrEk/8nncEmjKSjYnO6WjMHSbDiPnngt0AXRb4TfsZkE1jf oHsxSweDDDnRCsIJj9ieLbPXq+0jr+MJztUhjfx/2K49DltQtGaueiZwSN51mAxtICDH 6KUSHP4uji18fuzfi0vqDQqgCJCsXpwsH5cjpFAVXCAq3Z+lub9SfRCfUyiaAVBYxSSd qMg7JGDyMTMJ+zASOaL3MF8PAkcySKgppNZTFy3GDraq/zwUdmmZXGQA8dX2V9Kn+gnj lhuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nfOsgaRkn3NOEwzErdQ68wVfpHSfbPimdlfU+q2GrO4=; b=xGV34uj6EZ9Q2RC+DqfISztVlFYwp1ouyblBO9MKWQwodt//Awxyww+6a8GlDmPyMM ABXpUqZPCaNUWtyhvMDL1xIeowVluILqjqd8fHih85aZHECDIclJbZ4i6qOU+HAPc9vq FgOjdJu3ucel/iHgAGyXbpLQUzzDRUN6t7H4nPEVQTWPi+vbCe5PjJMqiIrDzDJkeHv9 Poc23+xMEaDQhZ2JjRYXuvg2Ev6CPRLSVJOjNVr496b9SRNMSnJFB/B8F68Gh1SQZkKq 1DZxllI/h8QRbZDaoALprI8P5VcHMrx2MIHoVxygMtVuAGEgoOVRGEQZjCVOOT5cZmBm 9naQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UVE3wNr3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ob24si4639401ejb.295.2019.10.31.20.26.07; Thu, 31 Oct 2019 20:26:33 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UVE3wNr3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729700AbfKADVu (ORCPT + 99 others); Thu, 31 Oct 2019 23:21:50 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40308 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbfKADVu (ORCPT ); Thu, 31 Oct 2019 23:21:50 -0400 Received: by mail-wm1-f66.google.com with SMTP id w9so7846740wmm.5 for ; Thu, 31 Oct 2019 20:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nfOsgaRkn3NOEwzErdQ68wVfpHSfbPimdlfU+q2GrO4=; b=UVE3wNr3OWzJkNn+4Ud2CGjFeMY31fHdKyasZtVdlJm81o2q0SLBm9bg1H5AQouRvl UisWWh6P7ifd4uuQyQSuzWMaF8B/lAamUz8cw40NI0oIY4QvKPvYeoO4fx6dr6JB5iGu Ydy2kBnsMysyaf/+KwNbvvYUdhdbNl4xK0jBBKRAAKHqk8zGCaxLfall/r435v2pcgIf 8MwHsrhVxaTIfTu8TdRXOxWIqrGwzkCY9nxrYkR7I0oDmwoLVZco1qmgm7HQO6JabrLZ EuyFiGtG53I+ANvUP1IezXouLWf7Uo27vsf49uk6WfUYHDTV1iJy5XYQJ8UJojElamGt sP+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nfOsgaRkn3NOEwzErdQ68wVfpHSfbPimdlfU+q2GrO4=; b=JpNg0k8CkMFBq31L4dTaXs8mmi0AaXpvwvH+3ObupQ7A1tJIjG+Bj0hPaHsFLDifnZ GdzaZLdfJQEKKILArbSr3jhQFgpw85h7gNPEQQ6hj27Ph3Ws4+zRmV8eXmu9wyl4bdlt 2flpmhyPVw1qrq4yCqaRu4sFeCpQEsY+yPIxlN2HGnsiLCTuxl0gxSvMBDjwprWAyg1A cGbsSbPCnLlcyFGIZk03TZmzA6L/dwEem8LDJnTP3JyX7FjSTSJipVM5G8Aev7ljiRhh FL5oNi6BFOWnRAixYu5SoQ/+w+h9EcVny67ZcwYEOyC0+i3IydyiqYiB/0QOP3U8wSgf THQQ== X-Gm-Message-State: APjAAAUM6A23GGl1Wub2enBpSgjPreKUgPTZpGBfC9ZLyB4LeicViAs5 //pL0V4AKvdXpFZBaEqbUTrhkyiCqasosR6nNnQ= X-Received: by 2002:a1c:6641:: with SMTP id a62mr7983126wmc.54.1572578508171; Thu, 31 Oct 2019 20:21:48 -0700 (PDT) MIME-Version: 1.0 References: <1571884773-23990-1-git-send-email-chunyan.zhang@unisoc.com> <1571888070-24425-1-git-send-email-chunyan.zhang@unisoc.com> In-Reply-To: <1571888070-24425-1-git-send-email-chunyan.zhang@unisoc.com> From: Chunyan Zhang Date: Fri, 1 Nov 2019 11:21:11 +0800 Message-ID: Subject: Re: [PATCH] tracing: use kvcalloc for tgid_map array allocation To: Chunyan Zhang Cc: Steven Rostedt , Ingo Molnar , Linux Kernel Mailing List , Yuming Han Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gentle ping 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 > 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 > >