Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4428250ybg; Mon, 8 Jun 2020 07:39:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSZi0427sHt63OTDHYgjkDY/hSB2hKw4zuzXJITSnoCF98LJM1XAzXkwddOUDsAJ8JUqnw X-Received: by 2002:a17:906:c058:: with SMTP id bm24mr20611436ejb.73.1591627167019; Mon, 08 Jun 2020 07:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591627167; cv=none; d=google.com; s=arc-20160816; b=po7/p1GHYyHlPlehrz09n4rM8DrrV3Jt7YCV1pHOZM7GsGucZKonoOkGRci0UEk0Z1 HTgMHZ2oxg2dTV25ANhs8SLxd1WgFZwqW6ah26LK0GUNFciuy3srrAWW+bMAz7s8ix4Y HBYoAXOwbKsvqakFgpXe+zUfBtj2I/WGu2PzqRISA8kVTG0Bxt6DOER1lPLU52oF4ocn JQpTS/pIheyEKAIay5SEefQUzrOYJqN8MWf8dwhkI2Agi6lMLLGC3UdvrGoKjxNv+gLF ezKQatCOYPrpLflzXL+ZSN97hVkkCbIZgzC6c9X0YElmJkD8enPq5mLZRhmAYm7ocya/ qPXQ== 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=UURELxImxuCND0+8GyP+wxkcOphVLYwBkm3RmS8PzXE=; b=FxyJ6mHZCNKuLuURwBWtUSOs55AXHvcWp9jGUi7Hy7fd0Yca1SqHHAfiPBMOygz6ZA vJH4wtr2H1LHPrzKE8/6jzUpG/AahmZm5RjLmwBVWMZyCZ5LCRq/z8RC7C2XTNz3pmHL 5UZv/sWHQC6tU4+NyCPdEUNmGIcvhHupa5Nsg3Qie28iZx7O2tCZKa62QMnSoOl+HMZn onBSd8yhmyBAHqftjwKgdxl7OkVsG9tLvTos2KJqTWqz+jnFQgJGMzAY4Kh4sUF5cmVr tg0pXT89Q0jJV5w2UUChFVty87YVOCxGOjVaXO/wgX0yuHiXvaZuXswoa+ddjp2KRfXZ Kklg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si1221423edp.357.2020.06.08.07.39.04; Mon, 08 Jun 2020 07:39:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730022AbgFHOhM (ORCPT + 99 others); Mon, 8 Jun 2020 10:37:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:48986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbgFHOhL (ORCPT ); Mon, 8 Jun 2020 10:37:11 -0400 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 0B9C22053B; Mon, 8 Jun 2020 14:37:10 +0000 (UTC) Date: Mon, 8 Jun 2020 10:37:09 -0400 From: Steven Rostedt To: Kefeng Wang Cc: Divya Indi , , Aruna Ramakrishna Subject: Re: [PATCH] sample-trace-array: Fix sleeping function called from invalid context Message-ID: <20200608103709.39afa15f@gandalf.local.home> In-Reply-To: <20200608075437.1760242-1-wangkefeng.wang@huawei.com> References: <20200608075437.1760242-1-wangkefeng.wang@huawei.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 Mon, 8 Jun 2020 07:54:37 +0000 Kefeng Wang wrote: > BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935 > in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/5 > 1 lock held by swapper/5/0: > #0: ffff80001002bd90 (samples/ftrace/sample-trace-array.c:38){+.-.}-{0:0}, at: call_timer_fn+0x8/0x3e0 > CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.7.0+ #8 > Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 > Call trace: > dump_backtrace+0x0/0x1a0 > show_stack+0x20/0x30 > dump_stack+0xe4/0x150 > ___might_sleep+0x160/0x200 > __might_sleep+0x58/0x90 > __mutex_lock+0x64/0x948 > mutex_lock_nested+0x3c/0x58 > __ftrace_set_clr_event+0x44/0x88 > trace_array_set_clr_event+0x24/0x38 > mytimer_handler+0x34/0x40 [sample_trace_array] > > mutex_lock() will be called in interrupt context, using workqueueu to fix it. > > Signed-off-by: Kefeng Wang > Divya, Can you give a Reviewed-by for this? -- Steve