Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp796405imm; Sat, 22 Sep 2018 10:46:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV63OFvfTfyf/K++eO2e1bmtHoCZaaAp21NmHQpc9a4m5C0VvvNjFCprN8THcKTnq81IjWShL X-Received: by 2002:a63:5558:: with SMTP id f24-v6mr3096854pgm.37.1537638407397; Sat, 22 Sep 2018 10:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537638407; cv=none; d=google.com; s=arc-20160816; b=bqYRsbXUV6sTIt31e4UN3cQAB1XW35uxx1227xcXhB6SyXFNLyWjUpxC/JdYuj+h9C 7f+xALiBBEv/yr3mGWangQG7pfk56MEM7Z2/PBVWwHANYgn6jBpxMOGhf34z2jlpQ5dK hyBOzlrp3k4/xANrKt32uWrzVQd5AJUrsJAfs5HGVt5jUmzYrsGe5dnVhd7i8C+EeN0V MSCmYWGXIsEXmJNHTrLrmJWFKmnifvKBSWQoj7YVr+UlHkc0cQ+fwP/s3kYF5eL1VDN4 sQueMdDa4N0DvyYSUplibteZ4XhGY3QY2W39a+SZ0zgjS0zO0rYE3u4rChDaivR+Bar3 Aspw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dmarc-filter :dkim-signature:dkim-signature; bh=f88pbSIlnuZALApWvFXTLVpsPbt7S9SEwKmPc8adls8=; b=TiYAS9ifxQ+dySg+UQCIWTwWdc75g3fDxkfh5gVxnIwzGNeDfTVS52N07e/u6cPAAQ MqpXcrLLIC7XepGGb25FyYJr7a+JN448A9XRHIaqcxWwlT9Vd++2ir7GiImUgiAFwAYA fil7QVl5JluERfHpvetblBXkai4NUFHIK1ZuGDQ9odjfwJxiywOni/aTn9C++TFAwqD0 daPVULM7sblk43702HfcBQVkkIgCboOhzIWsrADxH6Z506d2vpFQXpBzeamhWIcbgEJg rNwK7iB0r1hJkhgBObKJuxURhGMbXR+zJvu3B3ACvpvUAXcGTOjkpxOiXaAcVquDij2A Zh6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=A4SHPokC; dkim=pass header.i=@codeaurora.org header.s=default header.b="N/aUkQpJ"; 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 h11-v6si31679872pfk.81.2018.09.22.10.46.16; Sat, 22 Sep 2018 10:46:47 -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=@codeaurora.org header.s=default header.b=A4SHPokC; dkim=pass header.i=@codeaurora.org header.s=default header.b="N/aUkQpJ"; 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 S1727736AbeIVXke (ORCPT + 99 others); Sat, 22 Sep 2018 19:40:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60572 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbeIVXke (ORCPT ); Sat, 22 Sep 2018 19:40:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BB38660DD9; Sat, 22 Sep 2018 17:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537638371; bh=5iGM/oS6fptPo1x5d7UeBAteCjF71bYUubfE9UYFn9M=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=A4SHPokCmZ0rYIsQyiwX3c62ScmvvIcdVJpl7q186arwkW75wwyM+vG4GzY0cwuV7 /XRRlY/2rld/U0NMVkJ9QvahcZpL9t7yFrIY68dBy7AyNX3hA51ziBEKeEvzLt/E7T bo4UievpKcPO0/DOhIIqsa05feTJfxrZVVJ1t2KM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.43.47] (unknown [223.237.247.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2502F60DAD; Sat, 22 Sep 2018 17:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537638370; bh=5iGM/oS6fptPo1x5d7UeBAteCjF71bYUubfE9UYFn9M=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=N/aUkQpJvUu8bjZTiRLMhqulB2NOIAie/lmhMQKS2ELqwVuBZFn7l9QpD70vU7PhX 7oVpST3omm4uU/tzNWun7hc37C/5u4Pn4Rt6v3bsMuGxMmQFZoaZab9+nvfaEqCEhS SPcmOfyWDlsmLsdLrgVhqlUwj5pLRJEntQjM3PUk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2502F60DAD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=saiprakash.ranjan@codeaurora.org Subject: Re: [PATCH 2/6] pstore: Add event tracing support From: Sai Prakash Ranjan To: Joel Fernandes Cc: Steven Rostedt , Ingo Molnar , Laura Abbott , Kees Cook , Anton Vorontsov , Rob Herring , devicetree@vger.kernel.org, Colin Cross , Jason Baron , Tony Luck , Arnd Bergmann , Catalin Marinas , Will Deacon , Masami Hiramatsu , Joe Perches , Jim Cromie , Rajendra Nayak , Vivek Gautam , Sibi Sankar , linux-arm-kernel@lists.infradead.org, LKML , linux-arm-msm@vger.kernel.org, Greg Kroah-Hartman , Ingo Molnar , Tom Zanussi , Prasad Sodagudi , tsoni@codeaurora.org, Bryan Huntsman , Tingwei Zhang , kernel-team References: Message-ID: Date: Sat, 22 Sep 2018 23:15:53 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/22/2018 10:07 PM, Sai Prakash Ranjan wrote: > On 9/22/2018 2:35 PM, Joel Fernandes wrote: >> On Sat, Sep 8, 2018 at 4:28 PM Sai Prakash Ranjan >> wrote: > > >> Also I think this spinlock can be moved further down. >> > > OK. Something like this would suffice? > > {{{ > spin_lock_irqsave(&psinfo->buf_lock, flags); > > record.buf = (char *)(seq->buffer); > record.size = seq->len; > psinfo->write(&record); > > spin_unlock_irqrestore(&psinfo->buf_lock, flags); > }}} > > If I move the spinlock further down like above, I get this backtrace: [ 1.367708] console [pstore-1] enabled [ 1.368874] pstore: Registered ramoops as persistent store backend [ 1.372637] ramoops: attached 0x100000@0xbff00000, ecc: 0/0 [ 1.389382] WARNING: CPU: 2 PID: 2 at kernel/trace/trace_output.c:289 trace_raw_output_prep+0x18/0xa0 [ 1.389416] Modules linked in: [ 1.397572] CPU: 2 PID: 2 Comm: kthreadd Not tainted 4.19.0-rc4-00032-g71e30ed20433-dirty #9 [ 1.409122] pstate: 80000005 (Nzcv daif -PAN -UAO) [ 1.415804] pc : trace_raw_output_prep+0x18/0xa0 [ 1.420404] lr : trace_raw_output_sched_process_fork+0x1c/0x70 [ 1.425176] sp : ffff00000803bc00 [ 1.430815] x29: ffff00000803bc00 x28: ffff80003ca68d80 [ 1.434204] x27: ffff00000810d000 x26: 0000000000000001 [ 1.439586] x25: 0000000000000000 x24: ffff80000eb05090 [ 1.444881] x23: ffff80003ca68d80 x22: ffff00000803bd58 [ 1.450176] x21: ffff000009e63000 x20: ffff80003cbf8988 [ 1.455470] x19: ffff80000eb04000 x18: ffffffffffffffff [ 1.460766] x17: 000000000006df2c x16: 0000000000000000 [ 1.466061] x15: ffff000009b496c8 x14: 0000000000000040 [ 1.471356] x13: ffffffffffffffff x12: 0000000000000000 [ 1.476651] x11: ffff80003c49a6a8 x10: 00000000000005d8 [ 1.481947] x9 : ffff80003c89f400 x8 : ffff00000803bc60 [ 1.487242] x7 : 0000000000000034 x6 : 0000000005d97d4a [ 1.492536] x5 : 00ffffffffffffff x4 : 0000000000000050 [ 1.497831] x3 : 0000000000000056 x2 : ffff000009b657a0 [ 1.503127] x1 : ffff000009b657c0 x0 : ffff80000eb04000 [ 1.508422] Call trace: [ 1.513716] trace_raw_output_prep+0x18/0xa0 [ 1.515890] pstore_event_call+0xbc/0x130 [ 1.520402] trace_event_buffer_commit+0xf8/0x248 [ 1.524308] trace_event_raw_event_sched_process_fork+0xc0/0xf8 [ 1.528999] _do_fork+0x234/0x418 [ 1.534724] kernel_thread+0x48/0x58 [ 1.538196] kthreadd+0x178/0x1f0 [ 1.541842] ret_from_fork+0x10/0x1c [ 1.545052] ---[ end trace 97d58905d13e7aea ]--- [ 1.560654] s1: supplied by regulator-dummy [ 1.560714] s1: Bringing 0uV into 375000-375000uV -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation