Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8257920imu; Thu, 15 Nov 2018 08:50:30 -0800 (PST) X-Google-Smtp-Source: AJdET5cZZXPzLkDqgQ6L6yyFSQOPjPUoRxCKhQCiUaBqknVrBoqvckIVbI+1NS+uShvRw5qUxSff X-Received: by 2002:a63:d208:: with SMTP id a8mr6371711pgg.77.1542300630294; Thu, 15 Nov 2018 08:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542300630; cv=none; d=google.com; s=arc-20160816; b=o1DV1cJEThbvDBBGc+SId5z+E4QN4ZvoLT7682F0ZoYhcLKbyjwc39es/6QUChfGPF sN6ZmJYENQxFP4uSU7ZZUaPr96WvufRIwGrEKOd2P5B4fyrJ+UAZBNUUwjTenwPOd61w wwzOjC+W4XeYZ0REVhZ+Cuk3A1oRpsrWTvljgHglXzzPhlq71JdWCSupQrIUGpO+F3ko H+nXQsQodY3gfhfdN+VJTNQoRCIo5RwXCI/LCU4/WHwAwzXyeEMOShidsG1/L3rV3s2t 6mIs9qPB7XKEFajmLYM/nfaBnOEVKcRj9XkAOc5kJFrS8qmKIvCuVUmwVAD4NYLBPVV3 Ua4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from; bh=qHcLC4CEUoWxYpQg2rsNMeaPzsHNJ9rAWnmWKbwnlhI=; b=07evV4sQz6W0XR1UCHjrMd/RI2HVPGDkDSpfJtUZm0JoPwn2DtuSjDpexXSgwQUgdo 4eUaZ5Y4JfNnRhJZINIRxF82N0HBBqQ25ylhkMzI9ef1opYV0NI5JS9dAGlDiPAk5JVa St88O8NiFvhXi+GmXnTYNluqeU8N85bEUOO2Effjv1YGd20wU3236N5PS6swgIXo+s3i f2RuNl6/8wSzFnJI9klOz0L7RsXdnNkxwJsXVnYcG5teI3Dk4OrJ+tFpio5rmZXWqx3o zN+45wLWMSqA6NtW2WbUIJdxTkcuzzH5HLq9a1pNusZCNDeHojk6gDaOMSuh57OOT+2w iRtA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si29392018pld.329.2018.11.15.08.50.05; Thu, 15 Nov 2018 08:50:30 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388423AbeKPC5x (ORCPT + 99 others); Thu, 15 Nov 2018 21:57:53 -0500 Received: from outbound.smtp.vt.edu ([198.82.183.121]:54980 "EHLO omr2.cc.vt.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387833AbeKPC5x (ORCPT ); Thu, 15 Nov 2018 21:57:53 -0500 Received: from mr4.cc.vt.edu (mr4.cc.vt.edu [IPv6:2607:b400:92:8300:0:7b:e2b1:6a29]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id wAFGnIu5001063 for ; Thu, 15 Nov 2018 11:49:18 -0500 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mr4.cc.vt.edu (8.14.7/8.14.7) with ESMTP id wAFGnDgs032678 for ; Thu, 15 Nov 2018 11:49:18 -0500 Received: by mail-qk1-f198.google.com with SMTP id d196so45899924qkb.6 for ; Thu, 15 Nov 2018 08:49:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=qHcLC4CEUoWxYpQg2rsNMeaPzsHNJ9rAWnmWKbwnlhI=; b=MEuSvta+m4S85g2SZXVcHl7lscP/vfFGMMIG9GZu1DkFG5T9zvoE/DyrgsAZVqyDxj CGUEnt5QQqiXeNFnY7yVCinUojvmsLJSlVumrp/tNl1aBN2Jpp384xPBpFbfK0vAioYq TIsy8+v2hiXPB+POQIN0luJvZpcdbLXRPvzjY7c0UD9ziAFozYtIjviUDpx97MP/nANi aX9d9BdHf7OfBpI4sds5LzuksjYcCnBCD/fueoF5AX2bNMcTLhNyCQyF2uQ6MJaDioeZ O31Pg8XwF8GS0+o+wWNP+pap9R829HEm8lzVYwm72e9Zrg+3wA79aFz9momY0xnD+jit 1Gmw== X-Gm-Message-State: AGRZ1gJu6xasi6BYATNG/Gkm43p4Zm+y3E2RMJi/Ue2xr1T9a2MGyZTp 31WBQOjcfL6bV6ri2KIBhadRXj2Iu5HWwqaXF34nZjUbahCn4Vpls77sqkZlPaT+DhkwWke07h7 LeZHFc7BEWmH07WaiDsuAOOK80h0ifqXfEYk= X-Received: by 2002:a0c:9384:: with SMTP id f4mr6918804qvf.239.1542300552857; Thu, 15 Nov 2018 08:49:12 -0800 (PST) X-Received: by 2002:a0c:9384:: with SMTP id f4mr6918778qvf.239.1542300552514; Thu, 15 Nov 2018 08:49:12 -0800 (PST) Received: from turing-police.cc.vt.edu (turing-police.cc.ipv6.vt.edu. [2001:468:c80:2103:f21f:afff:fe0c:8ada]) by smtp.gmail.com with ESMTPSA id n92sm1076581qtd.85.2018.11.15.08.49.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Nov 2018 08:49:11 -0800 (PST) From: valdis.kletnieks@vt.edu X-Google-Original-From: Valdis.Kletnieks@vt.edu X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Pintu Agarwal Cc: open list , linux-arm-kernel@lists.infradead.org, Russell King - ARM Linux , kernelnewbies@kernelnewbies.org, jungseoklee85@gmail.com, catalin.marinas@arm.com, will.deacon@arm.com, takahiro.akashi@linaro.org, mark.rutland@arm.com, barami97@gmail.com Subject: Re: [ARM64] Printing IRQ stack usage information In-Reply-To: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1542300549_2379P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Thu, 15 Nov 2018 11:49:09 -0500 Message-ID: <28496.1542300549@turing-police.cc.vt.edu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --==_Exmh_1542300549_2379P Content-Type: text/plain; charset=us-ascii On Thu, 15 Nov 2018 18:52:39 +0530, Pintu Agarwal said: > Currently, when I tested this (as a proc interface), I got the below output: > CPU UNUSED-STACK ACTUAL-STACK > 0 16368 16384 > 3) How should I test it to get the different usage values for unused stack ? > Can I get these values by implementing a sample interrupt handler, > and printing information from there? Hint 1: If you're in a state where seq_printf() is legal, how many IRQ's are on this processor's IRQ stack? Hint 2: What are the chances that some other CPU is currently in an IRQ? (run 'top' and look for what percent of time that's happening) Hint 3: what are the chances that the value of irq_stack_ptr is already stale by the time seq_printf() finishes running? Hint 4: what happens to the validity of your output if you get rescheduled in the middle of that for_each loop? (In other words, this code is terribly racy and is probably not going to answer whatever debugging question you were working on.. If your question is "Did one of the CPUs blow out its IRQ stack (or come close to doing so)?" there's better approaches. --==_Exmh_1542300549_2379P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQEVAwUBW+2jhY0DS38y7CIcAQJbXAf/Tzi661RNRip58FF5Idc+J3pchStOvO5N wYs3oy48KyG/cR71n8Ypwg6Lt5YKS13l/mrO17as+fwJwTMtTYJ5nZVUQVWQZEkE ME1vBAMmE/Xs1uBTwuy+Hnxi525xIKXE74iM9qChoRer2+VM9fTo7uCY3KcrGFRq RzTh2GkosxuzYdLM5w3wLEo1Y46egkCCKYPH+SfohiFdnn1m40LyinF5y+OSH6xZ ZJw0RUWEbJ0SZu5XHyEKVzeW9xXPluDvv13QC/qaTrUeGgzY6/lu4Gnp56rYDhLy aiQluwSzLN5Egl45pQlFz3oYa1Qg+ujSay7x7xlWJPKrdgNZWE4Nzw== =N6Jk -----END PGP SIGNATURE----- --==_Exmh_1542300549_2379P--