Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp119373ybg; Tue, 9 Jun 2020 18:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0znMg4NsYr7jf4s9Fm80ZhBf9oviSZSKOQnPUnPq5MF1bT73ykzdH31lOXSRVLCRUWJP6 X-Received: by 2002:a17:906:7a19:: with SMTP id d25mr1025872ejo.333.1591751415448; Tue, 09 Jun 2020 18:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591751415; cv=none; d=google.com; s=arc-20160816; b=eyFKBB9sHlkB2Qe7oqNU9cxDoP39IqT3dkwmPwfb51zAVy/YOuhEKRXvrdoQpnDLeV bVug3PjgwBZHR19SfwgWtFjwqsOgMtGmpcdNTfyN+jdZ3aRO2Ql+GA16bM9q1DTnVFDp +ymbyE8seAajO65pMlLLXF8vjq17IRy2gYvwm8Zb+arIOTMjcrHjRgZpKDxWvrfeSIpa lirw3OTg8aAyMXM8TESK/IvkZHxK8n88QQPK1h2cA8DvSht6UtqA/bgBmdmFdXXC+DPj 2i86l/CxT+wzUXkpnAnlwZgqtwXUGVeL2NZSsvoS//EL638dk1greaAjx8VIN8KjMTq9 JhWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=k2tceK0YYAVkHqkeQtoHylA5kF2fwNzw2xEN4YWkc9E=; b=ZXxuaNFosMp/ep1V79+Vwq32MAejGMbCgvR2oatH9bBHJUil/IuOszHGlnN4NJUhlZ eN/ImsnL4+JuoqcR8XCTFY12eDQvE5bFFgr6NTuhHrI5s0i63aAlYW/j8ijAPoOPO9Vy ZpaLNAz+GAMwwzvCuK82hE5301P7MNcDk68kE3bSc+j1GRKgPt4r9kj9AlbecqMHuHwm 3nnbHKqQVTacxnER9AQ9ZH2hcnOrjJdRCB3JDRkZc5XHtDVi7l5k1knLRxGpI423JTP3 BqO30j0yPtYZ2eVxhfNp9uqxAgAqeYv+CGzPACGUBi2qGYCBeXY/0HG1kAX+j9UphTGe 79Ww== 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 ss12si12169422ejb.188.2020.06.09.18.09.44; Tue, 09 Jun 2020 18:10:15 -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 S1726098AbgFJBHj (ORCPT + 99 others); Tue, 9 Jun 2020 21:07:39 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5872 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725988AbgFJBHj (ORCPT ); Tue, 9 Jun 2020 21:07:39 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C09C3D5C36590D77C739; Wed, 10 Jun 2020 09:07:36 +0800 (CST) Received: from [127.0.0.1] (10.166.215.93) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 10 Jun 2020 09:07:33 +0800 Subject: Re: [PATCH v2] sample-trace-array: Fix sleeping function called from invalid context To: Divya Indi , CC: Steven Rostedt , Aruna Ramakrishna References: <0047f80f-4fff-16ff-7ac0-20181f03f06a@oracle.com> <20200609135125.2206637-1-wangkefeng.wang@huawei.com> <53201591-082d-7e42-9043-237ae4239da6@oracle.com> From: Kefeng Wang Message-ID: Date: Wed, 10 Jun 2020 09:07:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <53201591-082d-7e42-9043-237ae4239da6@oracle.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.166.215.93] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/6/10 0:29, Divya Indi wrote: > On 6/9/20 6:51 AM, 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 workqueue to fix it. > Fixes: Missing it, will send v3, thanks. >> Signed-off-by: Kefeng Wang > Reviewed-by: Divya Indi > >